mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 11:56:06 +08:00
Tech ENABLE_WORLD_COORDINATE_SCALE_REVISITED - Detection of required transformation baking done on mouse dragging event in place of mouse up event for gizmo scale
Fixed conflicts during rebase with master
This commit is contained in:
parent
622796e9e3
commit
e86cbf0d8c
@ -1268,16 +1268,15 @@ void ObjectManipulation::set_uniform_scaling(const bool use_uniform_scale)
|
|||||||
const Selection &selection = wxGetApp().plater()->canvas3D()->get_selection();
|
const Selection &selection = wxGetApp().plater()->canvas3D()->get_selection();
|
||||||
#if ENABLE_WORLD_COORDINATE_SCALE_REVISITED
|
#if ENABLE_WORLD_COORDINATE_SCALE_REVISITED
|
||||||
if (!use_uniform_scale) {
|
if (!use_uniform_scale) {
|
||||||
int res = selection.bake_transform_if_needed(false);
|
int res = selection.bake_transform_if_needed();
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
// Enforce uniform scaling.
|
// Enforce uniform scaling.
|
||||||
m_lock_bnt->SetLock(true);
|
m_lock_bnt->SetLock(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (res == 0) {
|
else if (res == 0)
|
||||||
// Recalculate cached values at this panel, refresh the screen.
|
// Recalculate cached values at this panel, refresh the screen.
|
||||||
this->UpdateAndShow(true);
|
this->UpdateAndShow(true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_uniform_scale = use_uniform_scale;
|
m_uniform_scale = use_uniform_scale;
|
||||||
|
@ -1311,7 +1311,7 @@ void Selection::translate(unsigned int object_idx, unsigned int instance_idx, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_WORLD_COORDINATE_SCALE_REVISITED
|
#if ENABLE_WORLD_COORDINATE_SCALE_REVISITED
|
||||||
int Selection::bake_transform_if_needed(bool apply_scale) const
|
int Selection::bake_transform_if_needed() const
|
||||||
{
|
{
|
||||||
if ((is_single_full_instance() && wxGetApp().obj_manipul()->is_world_coordinates()) ||
|
if ((is_single_full_instance() && wxGetApp().obj_manipul()->is_world_coordinates()) ||
|
||||||
(is_single_volume_or_modifier() && !wxGetApp().obj_manipul()->is_local_coordinates())) {
|
(is_single_volume_or_modifier() && !wxGetApp().obj_manipul()->is_local_coordinates())) {
|
||||||
@ -1349,13 +1349,7 @@ int Selection::bake_transform_if_needed(bool apply_scale) const
|
|||||||
if (dlg.ShowModal() != wxID_YES)
|
if (dlg.ShowModal() != wxID_YES)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (apply_scale) {
|
wxGetApp().plater()->take_snapshot(_("Bake transform"));
|
||||||
wxGetApp().plater()->get_current_canvas3D()->do_scale(L("Scale + Bake transform"));
|
|
||||||
Plater::SuppressSnapshots suppress(wxGetApp().plater());
|
|
||||||
wxGetApp().plater()->take_snapshot(_("Bake transform"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
wxGetApp().plater()->take_snapshot(_("Bake transform"));
|
|
||||||
|
|
||||||
// Bake the rotation into the meshes of the object.
|
// Bake the rotation into the meshes of the object.
|
||||||
wxGetApp().model().objects[volume.composite_id.object_id]->bake_xy_rotation_into_meshes(volume.composite_id.instance_id);
|
wxGetApp().model().objects[volume.composite_id.object_id]->bake_xy_rotation_into_meshes(volume.composite_id.instance_id);
|
||||||
|
@ -371,8 +371,7 @@ public:
|
|||||||
// -1 if the user refused to proceed with baking when asked
|
// -1 if the user refused to proceed with baking when asked
|
||||||
// 0 if the baking was performed
|
// 0 if the baking was performed
|
||||||
// 1 if no baking was needed
|
// 1 if no baking was needed
|
||||||
// if apply_scale == true the scaling of the current selection is applied
|
int bake_transform_if_needed() const;
|
||||||
int bake_transform_if_needed(bool apply_scale) const;
|
|
||||||
#endif // ENABLE_WORLD_COORDINATE_SCALE_REVISITED
|
#endif // ENABLE_WORLD_COORDINATE_SCALE_REVISITED
|
||||||
|
|
||||||
void erase();
|
void erase();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user