Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2018-11-01 18:22:16 +0300
committerYuSanka <yusanka@gmail.com>2018-11-01 18:24:20 +0300
commit618d0e4910d9a1368f6aafbeaaf15bbae5dbfbf4 (patch)
tree24e638edb75f4467d83f8ac74b17f6e6741e8503
parent2200e421745a4b79c810cf4e7f05dd191beb6bfe (diff)
Fixed splitting of the objects with instances
-rw-r--r--src/slic3r/GUI/GUI_ObjectList.cpp3
-rw-r--r--src/slic3r/GUI/GUI_ObjectManipulation.cpp3
-rw-r--r--src/slic3r/GUI/wxExtensions.cpp2
3 files changed, 6 insertions, 2 deletions
diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp
index def2d6218..d1f9f4df1 100644
--- a/src/slic3r/GUI/GUI_ObjectList.cpp
+++ b/src/slic3r/GUI/GUI_ObjectList.cpp
@@ -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__
diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp
index 8cb7944f6..fc34c0d09 100644
--- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp
+++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp
@@ -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());
diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp
index 547975c37..8d7498170 100644
--- a/src/slic3r/GUI/wxExtensions.cpp
+++ b/src/slic3r/GUI/wxExtensions.cpp
@@ -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