Copy and paste -> Disabled paste of instances when selection is in Volume mode

This commit is contained in:
Enrico Turri 2019-04-12 08:49:24 +02:00
parent 3e902ecfbd
commit 6ff12111a6
2 changed files with 13 additions and 2 deletions

View File

@ -3717,7 +3717,17 @@ bool Plater::can_paste_from_clipboard() const
const Selection& selection = p->view3D->get_canvas3d()->get_selection(); const Selection& selection = p->view3D->get_canvas3d()->get_selection();
const Selection::Clipboard& clipboard = selection.get_clipboard(); const Selection::Clipboard& clipboard = selection.get_clipboard();
Selection::EMode mode = clipboard.get_mode(); 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(); } bool Plater::can_delete() const { return p->can_delete(); }

View File

@ -1078,7 +1078,8 @@ void Selection::paste_from_clipboard()
} }
case Instance: case Instance:
{ {
paste_objects_from_clipboard(); if (m_mode == Instance)
paste_objects_from_clipboard();
break; break;
} }