From 2bee8e2fb299bd5081e86e5830159fcfefdae035 Mon Sep 17 00:00:00 2001 From: yw4z Date: Thu, 19 Nov 2026 16:41:43 +0300 Subject: [PATCH] Fix: Non positive volumes of selected or non selected object visible on Texture displacement gizmo (#17656) The Texture displacement gizmo made every volume visible again on each frame, so modifiers, negative volumes and support blockers/enforcers from other objects and instances showed through. It now restores only the selected instance, and hides the selected object's non-part volumes while the gizmo is open. (cherry picked from commit c56506d68bd722ddb43dd6c7181a5cc45a56ac82) --- src/slic3r/GUI/GLCanvas3D.cpp | 5 +++++ src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.cpp | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index ba3e2da505..19476b9e3d 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2177,6 +2177,11 @@ void GLCanvas3D::toggle_model_objects_visibility(bool visible, const ModelObject vol->force_neutral_color = false; else if (gizmo_type == GLGizmosManager::MmSegmentation) vol->is_active = false; + else if (gizmo_type == GLGizmosManager::TextureDisplacement) { + vol->force_native_color = true; + if (vol->is_modifier) // GLVolume::is_modifier == any non-model-part volume + vol->is_active = false; + } else vol->force_native_color = true; } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.cpp b/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.cpp index f386e6713e..cf0fbe62ab 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoTextureDisplacement.cpp @@ -732,7 +732,11 @@ void GLGizmoTextureDisplacement::render_painter_gizmo() if (const ModelVolume *part = preview_part(*preview); part != nullptr) previewed.push_back(part); } - m_parent.toggle_model_objects_visibility(true); + m_parent.toggle_model_objects_visibility( + true, + m_c->selection_info()->model_object(), + m_c->selection_info()->get_active_instance() + ); for (const ModelVolume *volume : previewed) m_parent.toggle_model_objects_visibility(false, m_c->selection_info()->model_object(), m_c->selection_info()->get_active_instance(), volume);