From 03f17a13e756038603d471c80d22d45012f1059a Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 27 Feb 2020 17:53:51 +0100 Subject: [PATCH] Bugfix: SLA pad and supports were sometimes shown on instances that should have been hidden The showing/hiding block cannot depend on whether the mesh was recently updated. It would then not hide the supports and pad, which are calculated later than the hollowed mesh. --- src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp | 15 +++++---------- src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp | 17 ++++++----------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index 5f3430a78..f33a7bd8b 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -75,17 +75,12 @@ void GLGizmoHollow::set_sla_support_data(ModelObject*, const Selection&) if (m_c->has_drilled_mesh()) m_holes_in_drilled_mesh = m_c->m_model_object->sla_drain_holes; } + } - if (m_state == On) { - m_parent.toggle_model_objects_visibility(false); - m_parent.toggle_model_objects_visibility(true, m_c->m_model_object, m_c->m_active_instance); - m_parent.toggle_sla_auxiliaries_visibility(m_show_supports, m_c->m_model_object, m_c->m_active_instance); - } - // following was removed so that it does not show the object when it should - // be hidden because the supports gizmo is active. on_set_state takes care - // of showing the object. - //else - // m_parent.toggle_model_objects_visibility(true, nullptr, -1); + if (m_state == On) { + m_parent.toggle_model_objects_visibility(false); + m_parent.toggle_model_objects_visibility(true, m_c->m_model_object, m_c->m_active_instance); + m_parent.toggle_sla_auxiliaries_visibility(m_show_supports, m_c->m_model_object, m_c->m_active_instance); } } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp index 368dac037..0e98f7364 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp @@ -68,22 +68,17 @@ void GLGizmoSlaSupports::set_sla_support_data(ModelObject* model_object, const S update_clipping_plane(m_c->m_clipping_plane_was_moved); - if (m_state == On) { - m_parent.toggle_model_objects_visibility(false); - m_parent.toggle_model_objects_visibility(/*! m_c->m_cavity_mesh*/ true, m_c->m_model_object, m_c->m_active_instance); - m_parent.toggle_sla_auxiliaries_visibility(! m_editing_mode, m_c->m_model_object, m_c->m_active_instance); - } - // following was removed so that it does not show the object when it should - // be hidden because the supports gizmo is active. on_set_state takes care - // of showing the object. - //else - // m_parent.toggle_model_objects_visibility(true, nullptr, -1); - disable_editing_mode(); if (m_c->m_model_object) reload_cache(); } + if (m_state == On) { + m_parent.toggle_model_objects_visibility(false); + m_parent.toggle_model_objects_visibility(true, m_c->m_model_object, m_c->m_active_instance); + m_parent.toggle_sla_auxiliaries_visibility(! m_editing_mode, m_c->m_model_object, m_c->m_active_instance); + } + // If we triggered autogeneration before, check backend and fetch results if they are there if (m_c->m_model_object) { if (m_c->m_model_object->sla_points_status == sla::PointsStatus::Generating)