mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 06:04:01 -06:00
Fix of #5517 "Unsupported Selection" error when copy pasting objects with modifiers...
This commit is contained in:
parent
6effa30322
commit
c747502db9
1 changed files with 15 additions and 3 deletions
|
@ -3671,16 +3671,28 @@ void ObjectList::update_selections()
|
||||||
return;
|
return;
|
||||||
sels.Add(m_objects_model->GetItemById(selection.get_object_idx()));
|
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());
|
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())
|
if (m_objects_model->GetVolumeIdByItem(m_objects_model->GetParent(item)) == gl_vol->volume_idx())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// but if there is selected only one of several instances by context menu,
|
// but if there is selected only one of several instances by context menu,
|
||||||
// then select this instance in ObjectList
|
// 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()));
|
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())
|
else if (selection.is_single_full_object() || selection.is_multiple_full_object())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue