From 2c881d550f7c1844b83cdf1d0b06b06f4ce59ea1 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Tue, 31 Jan 2023 15:00:17 +0100 Subject: [PATCH] Follow up fix to inactive sla gizmos SPE-1422 --- src/slic3r/GUI/Gizmos/GLGizmoSlaBase.cpp | 6 +++++- src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaBase.cpp index 025cb2627..3ac438902 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaBase.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaBase.cpp @@ -62,7 +62,11 @@ void GLGizmoSlaBase::update_volumes() new_volume->set_instance_transformation(po->model_object()->instances[m_parent.get_selection().get_instance_idx()]->get_transformation()); new_volume->set_sla_shift_z(po->get_current_elevation()); new_volume->mesh_raycaster = std::make_unique(backend_mesh); - m_input_enabled = po->last_completed_step() >= m_min_sla_print_object_step; + auto last_comp_step = static_cast(po->last_completed_step()); + if (last_comp_step == slaposCount) + last_comp_step = -1; + + m_input_enabled = last_comp_step >= m_min_sla_print_object_step; if (m_input_enabled) new_volume->selected = true; // to set the proper color else diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp index 0bab4020a..86b8565ae 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp @@ -66,7 +66,11 @@ void GLGizmoSlaSupports::data_changed() m_c->instances_hider()->set_hide_full_scene(true); const SLAPrintObject* po = m_c->selection_info()->print_object(); const int required_step = get_min_sla_print_object_step(); - if (po != nullptr && po->last_completed_step() < required_step) + auto last_comp_step = static_cast(po->last_completed_step()); + if (last_comp_step == slaposCount) + last_comp_step = -1; + + if (po != nullptr && last_comp_step < required_step) reslice_until_step((SLAPrintObjectStep)required_step, false); update_volumes();