From dea188083c280742cd24f93531d268415ed22cf4 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 20 Oct 2021 12:50:21 +0200 Subject: [PATCH 1/3] Tech ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS - Fixed update of sidebar object manipulation reset buttons after using a gizmo --- src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index 0c8f161a9..1a2cb6be1 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -721,6 +721,12 @@ bool GLGizmosManager::on_mouse(wxMouseEvent& evt) gizmo_event(SLAGizmoEventType::RightUp, mouse_pos, evt.ShiftDown(), evt.AltDown(), control_down); processed = true; } +#if ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS + else if (evt.LeftUp()) { + selection.stop_dragging(); + wxGetApp().obj_manipul()->set_dirty(); + } +#endif // ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS } else { // mouse inside toolbar From 22e63af0ceb3d641d5284b27515893e9fd00c593 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 20 Oct 2021 13:07:54 +0200 Subject: [PATCH 2/3] Tech ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS - Fixed update of sidebar object manipulation reset buttons after editing object's transformation fields --- src/slic3r/GUI/GUI_ObjectManipulation.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp index 09492db09..c279fad90 100644 --- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp +++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp @@ -820,6 +820,9 @@ void ObjectManipulation::change_position_value(int axis, double value) Selection& selection = canvas->get_selection(); selection.start_dragging(); selection.translate(position - m_cache.position, selection.requires_local_axes()); +#if ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS + selection.stop_dragging(); +#endif // ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS canvas->do_move(L("Set Position")); m_cache.position = position; @@ -851,6 +854,9 @@ void ObjectManipulation::change_rotation_value(int axis, double value) selection.rotate( (M_PI / 180.0) * (transformation_type.absolute() ? rotation : rotation - m_cache.rotation), transformation_type); +#if ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS + selection.stop_dragging(); +#endif // ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS canvas->do_rotate(L("Set Orientation")); m_cache.rotation = rotation; @@ -923,6 +929,9 @@ void ObjectManipulation::do_scale(int axis, const Vec3d &scale) const selection.start_dragging(); selection.scale(scaling_factor, transformation_type); +#if ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS + selection.stop_dragging(); +#endif // ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS wxGetApp().plater()->canvas3D()->do_scale(L("Set Scale")); } From 79ff8a0dda91af5028c8d6540e6bc2a168794599 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 20 Oct 2021 13:19:15 +0200 Subject: [PATCH 3/3] Tech ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS - Follow-up of dea188083c280742cd24f93531d268415ed22cf4 and 22e63af0ceb3d641d5284b27515893e9fd00c593. Added missing calls to Selection::stop_dragging() --- src/slic3r/GUI/GLCanvas3D.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index b0a83d93f..b44fa167a 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2568,12 +2568,15 @@ void GLCanvas3D::on_key(wxKeyEvent& evt) if (camera_space) { Eigen::Matrix inv_view_3x3 = wxGetApp().plater()->get_camera().get_view_matrix().inverse().matrix().block(0, 0, 3, 3); displacement = multiplier * (inv_view_3x3 * direction); - displacement(2) = 0.0; + displacement.z() = 0.0; } else displacement = multiplier * direction; m_selection.translate(displacement); +#if ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS + m_selection.stop_dragging(); +#endif // ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS m_dirty = true; } ); @@ -2672,6 +2675,9 @@ void GLCanvas3D::on_key(wxKeyEvent& evt) auto do_rotate = [this](double angle_z_rad) { m_selection.start_dragging(); m_selection.rotate(Vec3d(0.0, 0.0, angle_z_rad), TransformationType(TransformationType::World_Relative_Joint)); +#if ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS + m_selection.stop_dragging(); +#endif // ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS m_dirty = true; // wxGetApp().obj_manipul()->set_dirty(); };