From 1e99ce9535ace1d1858efe38e5f9a0a7db135a6e Mon Sep 17 00:00:00 2001 From: "liz.li" Date: Mon, 11 Sep 2023 15:29:24 +0800 Subject: [PATCH] ENH: select a volume in assembly view can enter painting In assembly view, default selection is volume and painting needs an object. It's inconvenient to select a full object to get in painting. Jira: STUDIO-3322 Change-Id: I980e5a3ca7a9c5cf2800f28a38c1c68b978a343b --- src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp | 3 ++- src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp index 8ad89a9f2d..a7bfdf034b 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp @@ -54,7 +54,8 @@ bool GLGizmoMmuSegmentation::on_is_selectable() const bool GLGizmoMmuSegmentation::on_is_activable() const { - return GLGizmoPainterBase::on_is_activable() && wxGetApp().filaments_cnt() > 1; + const Selection& selection = m_parent.get_selection(); + return !selection.is_empty() && (selection.is_single_full_instance() || selection.is_any_volume()) && wxGetApp().filaments_cnt() > 1; } //BBS: use the global one in 3DScene.cpp diff --git a/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp b/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp index 4e29d10afb..f57c927490 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp @@ -117,7 +117,9 @@ bool CommonGizmosDataPool::check_dependencies(CommonGizmosDataID required) const void SelectionInfo::on_update() { const Selection& selection = get_pool()->get_canvas()->get_selection(); - if (selection.is_single_full_instance()) { + // BBS still keep object pointer when selection is volume + //if (selection.is_single_full_instance()) { + if (!selection.is_empty()) { m_model_object = selection.get_model()->objects[selection.get_object_idx()]; m_z_shift = selection.get_volume(*selection.get_volume_idxs().begin())->get_sla_shift_z(); }