diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index d15789195..1291d1f73 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1396,7 +1396,36 @@ ModelInstanceEPrintVolumeState GLCanvas3D::check_volumes_outside_state() const return state; } -void GLCanvas3D::toggle_sla_auxiliaries_visibility(bool visible, const ModelObject* mo, int instance_idx) +void GLCanvas3D::toggle_selected_volume_visibility(bool selected_visible) +{ + m_render_sla_auxiliaries = !selected_visible; + if (selected_visible) { + const Selection::IndicesList &idxs = m_selection.get_volume_idxs(); + if (idxs.size() > 0) { + for (GLVolume *vol : m_volumes.volumes) { + if (vol->composite_id.object_id >= 1000 && vol->composite_id.object_id < 1000 + wxGetApp().plater()->get_partplate_list().get_plate_count()) + continue; // the wipe tower + if (vol->composite_id.volume_id >= 0) { + vol->is_active = false; + } + } + for (unsigned int idx : idxs) { + GLVolume *v = const_cast(m_selection.get_volume(idx)); + v->is_active = true; + } + } + } else { // show all + for (GLVolume *vol : m_volumes.volumes) { + if (vol->composite_id.object_id >= 1000 && vol->composite_id.object_id < 1000 + wxGetApp().plater()->get_partplate_list().get_plate_count()) + continue; // the wipe tower + if (vol->composite_id.volume_id >= 0) { + vol->is_active = true; + } + } + } +} + +void GLCanvas3D::toggle_sla_auxiliaries_visibility(bool visible, const ModelObject *mo, int instance_idx) { m_render_sla_auxiliaries = visible; diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 3b147d8ff..ba9273fa0 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -730,6 +730,7 @@ public: const GCodeViewer::SequentialView& get_gcode_sequential_view() const { return m_gcode_viewer.get_sequential_view(); } void update_gcode_sequential_view_current(unsigned int first, unsigned int last) { m_gcode_viewer.update_sequential_view_current(first, last); } + void toggle_selected_volume_visibility(bool selected_visible); void toggle_sla_auxiliaries_visibility(bool visible, const ModelObject* mo = nullptr, int instance_idx = -1); void toggle_model_objects_visibility(bool visible, const ModelObject* mo = nullptr, int instance_idx = -1, const ModelVolume* mv = nullptr); void update_instance_printable_state_for_object(size_t obj_idx);