diff --git a/src/slic3r/GUI/GLGizmo.cpp b/src/slic3r/GUI/GLGizmo.cpp index 7a64e5f45b..c485c90e7e 100644 --- a/src/slic3r/GUI/GLGizmo.cpp +++ b/src/slic3r/GUI/GLGizmo.cpp @@ -2365,8 +2365,10 @@ RENDER_AGAIN: } if (value_changed) { // Update side panel - wxGetApp().obj_settings()->UpdateAndShow(true); - wxGetApp().obj_list()->update_settings_items(); + wxTheApp->CallAfter([]() { + wxGetApp().obj_settings()->UpdateAndShow(true); + wxGetApp().obj_list()->update_settings_items(); + }); } bool generate = m_imgui->button(_(L("Auto-generate points [A]"))); @@ -2400,7 +2402,7 @@ RENDER_AGAIN: if (remove_selected || remove_all) { force_refresh = false; - m_parent.reload_scene(true); + m_parent.set_as_dirty(); if (remove_all) select_point(AllPoints); delete_selected_points(remove_all); @@ -2413,7 +2415,7 @@ RENDER_AGAIN: } if (force_refresh) - m_parent.reload_scene(true); + m_parent.set_as_dirty(); } #endif // ENABLE_IMGUI diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 082ea42c68..0857265f32 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -376,7 +376,8 @@ void ObjectList::selection_changed() fix_multiselection_conflicts(); // update object selection on Plater - update_selections_on_canvas(); + if (!m_prevent_canvas_selection_update) + update_selections_on_canvas(); // to update the toolbar and info sizer if (!GetSelection() || m_objects_model->GetItemType(GetSelection()) == itObject) { @@ -2129,6 +2130,10 @@ bool ObjectList::has_multi_part_objects() void ObjectList::update_settings_items() { + m_prevent_canvas_selection_update = true; + wxDataViewItemArray sel; + GetSelections(sel); // stash selection + wxDataViewItemArray items; m_objects_model->GetChildren(wxDataViewItem(0), items); @@ -2136,7 +2141,9 @@ void ObjectList::update_settings_items() const wxDataViewItem& settings_item = m_objects_model->GetSettingsItem(item); select_item(settings_item ? settings_item : m_objects_model->AddSettingsChild(item)); } - UnselectAll(); + // restore selection: + SetSelections(sel); + m_prevent_canvas_selection_update = false; } void ObjectList::update_object_menu() diff --git a/src/slic3r/GUI/GUI_ObjectList.hpp b/src/slic3r/GUI/GUI_ObjectList.hpp index 138bacac4a..7d14eb13f0 100644 --- a/src/slic3r/GUI/GUI_ObjectList.hpp +++ b/src/slic3r/GUI/GUI_ObjectList.hpp @@ -127,6 +127,10 @@ class ObjectList : public wxDataViewCtrl bool m_prevent_update_extruder_in_config = false; // We use this flag to avoid updating of the extruder value in config // during updating of the extruder count. + bool m_prevent_canvas_selection_update = false; // This flag prevents changing selection on the canvas. See function + // update_settings_items - updating canvas selection is undesirable, + // because it would turn off the gizmos (mainly a problem for the SLA gizmo) + bool m_parts_changed = false; bool m_part_settings_changed = false; diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index 22def06230..4f6d89244e 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -191,7 +191,8 @@ void View3D::reload_scene(bool refresh_immediately, bool force_full_scene_refres void View3D::render() { if (m_canvas != nullptr) - m_canvas->render(); + //m_canvas->render(); + m_canvas->set_as_dirty(); } Preview::Preview(wxWindow* parent, DynamicPrintConfig* config, BackgroundSlicingProcess* process, GCodePreviewData* gcode_preview_data, std::function schedule_background_process_func)