From fc089fd2c54b31de4b5a260c1f573b04eda2e4df Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 2 Dec 2021 11:24:21 +0100 Subject: [PATCH] Code refactoring for https://github.com/prusa3d/PrusaSlicer/commit/d88ef826cd9be79ef55d735dda5a938a085da3f2 reload_scene() call were followed by update(). It synchronizes back-end with front-end and then it calls reload_scene() again. However in SLA mode reload_scene() expects the back-end to be synchronized with front-end, thus we get asserts that we all have ignored for a long time. So, we call ObjectList::update_info_items() after the call of update() where reload_scene() is already called and GLCanvas3D::is_object_sinking() will return correct value --- src/slic3r/GUI/Plater.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index e61015388..baa6fd4ce 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2736,16 +2736,17 @@ std::vector Plater::priv::load_model_objects(const ModelObjectPtrs& mode _L("Object too large?")); } - // Now ObjectList uses GLCanvas3D::is_object_sinkin() to show/hide "Sinking" InfoItem, - // so 3D-scene should be updated before object additing to the ObjectList - this->view3D->reload_scene(false, (unsigned int)UpdateParams::FORCE_FULL_SCREEN_REFRESH); - notification_manager->close_notification_of_type(NotificationType::UpdatedItemsInfo); for (const size_t idx : obj_idxs) { wxGetApp().obj_list()->add_object_to_list(idx); } update(); + // Update InfoItems in ObjectList after update() to use of a correct value of the GLCanvas3D::is_sinking(), + // which is updated after a view3D->reload_scene(false, flags & (unsigned int)UpdateParams::FORCE_FULL_SCREEN_REFRESH) call + for (const size_t idx : obj_idxs) + wxGetApp().obj_list()->update_info_items(idx); + object_list_changed(); this->schedule_background_process();