From 6ff12111a60f4cef51d03033dd3b3da224424703 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 12 Apr 2019 08:49:24 +0200 Subject: [PATCH] Copy and paste -> Disabled paste of instances when selection is in Volume mode --- src/slic3r/GUI/Plater.cpp | 12 +++++++++++- src/slic3r/GUI/Selection.cpp | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 027db69f5..c18091e4b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3717,7 +3717,17 @@ bool Plater::can_paste_from_clipboard() const const Selection& selection = p->view3D->get_canvas3d()->get_selection(); const Selection::Clipboard& clipboard = selection.get_clipboard(); Selection::EMode mode = clipboard.get_mode(); - return !clipboard.is_empty() && ((mode == Selection::Instance) || selection.is_from_single_instance()); + + if (clipboard.is_empty()) + return false; + + if ((mode == Selection::Volume) && !selection.is_from_single_instance()) + return false; + + if ((mode == Selection::Instance) && (selection.get_mode() != Selection::Instance)) + return false; + + return true; } bool Plater::can_delete() const { return p->can_delete(); } diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index 315aa487a..22df9ed19 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -1078,7 +1078,8 @@ void Selection::paste_from_clipboard() } case Instance: { - paste_objects_from_clipboard(); + if (m_mode == Instance) + paste_objects_from_clipboard(); break; }