From 239ab3a8e3968ead66a1092550be9aa8fec9ea48 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 27 Feb 2020 11:36:08 +0100 Subject: [PATCH] Slight change in clipping plane updating after hollowing finishes The clipping plane in SLA gizmos is only moved in case that the gizmo is currently active and hollowing is actually enabled. --- src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index 8be642922d0..35292f31cfa 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -1143,10 +1143,19 @@ bool CommonGizmosData::update_from_backend(GLCanvas3D& canvas, ModelObject* mode new_clp_pos = 0.f; m_clipping_plane_was_moved = false; } else { - // After we got a drilled mesh, move the cp to 25% (if not used already) + // After we got a drilled mesh, move the cp to 25%. This only applies when + // the hollowing gizmo is active and hollowing is enabled if (m_clipping_plane_distance == 0.f && mesh_exchanged && m_has_drilled_mesh) { - new_clp_pos = 0.25f; - m_clipping_plane_was_moved = false; // so it uses current camera direction + const DynamicPrintConfig& cfg = + (m_model_object && m_model_object->config.has("hollowing_enable")) + ? m_model_object->config + : wxGetApp().preset_bundle->sla_prints.get_edited_preset().config; + + if (cfg.has("hollowing_enable") && cfg.opt_bool("hollowing_enable") + && canvas.get_gizmos_manager().get_current_type() == GLGizmosManager::Hollow) { + new_clp_pos = 0.25f; + m_clipping_plane_was_moved = false; // so it uses current camera direction + } } } m_clipping_plane_distance = new_clp_pos;