Skip to content

Commit

Permalink
Fix of #5517 "Unsupported Selection" error when copy pasting objects …
Browse files Browse the repository at this point in the history
…with modifiers...
  • Loading branch information
YuSanka committed Dec 30, 2020
1 parent 6effa30 commit c747502
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/slic3r/GUI/GUI_ObjectList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3671,16 +3671,28 @@ void ObjectList::update_selections()
return;
sels.Add(m_objects_model->GetItemById(selection.get_object_idx()));
}
if (selection.is_single_volume() || selection.is_any_modifier()) {
else if (selection.is_single_volume() || selection.is_any_modifier()) {
const auto gl_vol = selection.get_volume(*selection.get_volume_idxs().begin());
if (m_objects_model->GetVolumeIdByItem(m_objects_model->GetParent(item)) == gl_vol->volume_idx())
return;
}

// but if there is selected only one of several instances by context menu,
// then select this instance in ObjectList
if (selection.is_single_full_instance())
else if (selection.is_single_full_instance())
sels.Add(m_objects_model->GetItemByInstanceId(selection.get_object_idx(), selection.get_instance_idx()));
// Can be the case, when we have selected itSettings | itLayerRoot | itLayer in the ObjectList and selected object/instance in the Scene
// and then select some object/instance in 3DScene using Ctrt+left click
// see https://github.com/prusa3d/PrusaSlicer/issues/5517
else {
// Unselect all items in ObjectList
m_last_selected_item = wxDataViewItem(nullptr);
m_prevent_list_events = true;
UnselectAll();
m_prevent_list_events = false;
// call this function again to update selection from the canvas
update_selections();
return;
}
}
else if (selection.is_single_full_object() || selection.is_multiple_full_object())
{
Expand Down

0 comments on commit c747502

Please sign in to comment.