Fixed splitting of the objects with instances
This commit is contained in:
parent
2200e42174
commit
618d0e4910
3 changed files with 6 additions and 2 deletions
|
@ -1115,6 +1115,9 @@ void ObjectList::add_object_to_list(size_t obj_idx)
|
|||
Expand(item);
|
||||
}
|
||||
|
||||
if (model_object->instances.size()>1)
|
||||
increase_object_instances(obj_idx, model_object->instances.size());
|
||||
|
||||
#ifndef __WXOSX__
|
||||
selection_changed();
|
||||
#endif //__WXMSW__
|
||||
|
|
|
@ -270,7 +270,8 @@ void ObjectManipulation::update_settings_value(const GLCanvas3D::Selection& sele
|
|||
{
|
||||
if (selection.is_single_full_object())
|
||||
{
|
||||
if (!wxGetApp().model_objects()->empty() && (*wxGetApp().model_objects())[selection.get_object_idx()]->instances.size() == 1)
|
||||
auto obj_idx = selection.get_object_idx();
|
||||
if (obj_idx >=0 && !wxGetApp().model_objects()->empty() && (*wxGetApp().model_objects())[obj_idx]->instances.size() == 1)
|
||||
{
|
||||
// all volumes in the selection belongs to the same instance, any of them contains the needed data, so we take the first
|
||||
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
||||
|
|
|
@ -528,7 +528,7 @@ wxDataViewItem PrusaObjectDataViewModel::AddInstanceChild(const wxDataViewItem &
|
|||
parent_node->Insert(inst_root_node, insert_pos);
|
||||
// notify control
|
||||
ItemAdded(parent_item, inst_root_item);
|
||||
num++;
|
||||
if (num == 1) num++;
|
||||
}
|
||||
|
||||
// Add instance nodes
|
||||
|
|
Loading…
Reference in a new issue