Instance selection in object list according to the canvas selection

This commit is contained in:
YuSanka 2018-11-05 13:53:30 +01:00
parent 0810beae77
commit 95af5c7cc6
3 changed files with 51 additions and 10 deletions

View file

@ -1198,11 +1198,18 @@ void ObjectList::update_selections()
auto& selection = _3DScene::get_canvas(wxGetApp().canvas3D())->get_selection();
wxDataViewItemArray sels;
for (auto idx: selection.get_volume_idxs())
{
const auto gl_vol = selection.get_volume(idx);
sels.Add(m_objects_model->GetItemByVolumeId(gl_vol->object_idx(), gl_vol->volume_idx()));
if (selection.is_single_full_object()) {
for (auto idx : selection.get_volume_idxs()) {
const auto gl_vol = selection.get_volume(idx);
sels.Add(m_objects_model->GetItemByVolumeId(gl_vol->object_idx(), gl_vol->volume_idx()));
}
}
else if (selection.is_single_full_instance()) {
for (auto idx : selection.get_instance_idxs()) {
sels.Add(m_objects_model->GetItemByInstanceId(selection.get_object_idx(), idx));
}
}
select_items(sels);
}