diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 32c6cc5f6..befeb085d 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -3565,6 +3565,18 @@ void ObjectList::update_info_items(size_t obj_idx, wxDataViewItemArray* selectio } +void ObjectList::add_objects_to_list(std::vector obj_idxs, bool call_selection_changed, bool notify_partplate, bool do_info_update) +{ +#ifdef __WXOSX__ + AssociateModel(nullptr); +#endif + for (const size_t idx : obj_idxs) { + add_object_to_list(idx, call_selection_changed, notify_partplate, do_info_update); + } +#ifdef __WXOSX__ + AssociateModel(m_objects_model); +#endif +} void ObjectList::add_object_to_list(size_t obj_idx, bool call_selection_changed, bool notify_partplate, bool do_info_update) { @@ -3807,10 +3819,16 @@ void ObjectList::update_lock_icons_for_model() void ObjectList::delete_all_objects_from_list() { +#ifdef __WXOSX__ + AssociateModel(nullptr); +#endif m_prevent_list_events = true; reload_all_plates(); m_prevent_list_events = false; part_selection_changed(); +#ifdef __WXOSX__ + AssociateModel(m_objects_model); +#endif } void ObjectList::increase_object_instances(const size_t obj_idx, const size_t num) diff --git a/src/slic3r/GUI/GUI_ObjectList.hpp b/src/slic3r/GUI/GUI_ObjectList.hpp index aef19b80e..bafa0b5ba 100644 --- a/src/slic3r/GUI/GUI_ObjectList.hpp +++ b/src/slic3r/GUI/GUI_ObjectList.hpp @@ -326,6 +326,7 @@ public: // Add object to the list // @param do_info_update: [Arthur] this function becomes slow as more functions are added, but I only need a fast version in FillBedJob, and I don't care about any info updates, so I pass a do_info_update param to skip all the uneccessary steps. + void add_objects_to_list(std::vector obj_idxs, bool call_selection_changed = true, bool notify_partplate = true, bool do_info_update = true); void add_object_to_list(size_t obj_idx, bool call_selection_changed = true, bool notify_partplate = true, bool do_info_update = true); // Add object's volumes to the list // Return selected items, if add_to_selection is defined diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 677240ca6..2b209cf72 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3863,9 +3863,7 @@ std::vector Plater::priv::load_model_objects(const ModelObjectPtrs& mode //} notification_manager->close_notification_of_type(NotificationType::UpdatedItemsInfo); - for (const size_t idx : obj_idxs) { - wxGetApp().obj_list()->add_object_to_list(idx); - } + wxGetApp().obj_list()->add_objects_to_list(obj_idxs); update(); // Update InfoItems in ObjectList after update() to use of a correct value of the GLCanvas3D::is_sinking(),