mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-01 09:22:58 -05:00
Fix a crash in the object list after arranging
Arranging rebuilds the plates in arrange order, which re-sorts the model objects. The object list then synced its selection from GLVolumes that still carried the old object indices, and with a part or modifier selected it read past the end of another object's volumes. Reload the scene before syncing the object list, and skip indices that are out of range. Ported from Snapmaker/OrcaSlicer@fd6e55e734 Co-authored-by: XieJiajun <68017138+PILIPALA030@users.noreply.github.com>
This commit is contained in:
1 parent
e07ea09de0
commit
039b8c4ed9
2 files changed
+5
No files matched your search
@@ -5322,6 +5322,8 @@ void ObjectList::update_selections()
|
||||
int obj_idx = gl_vol->object_idx();
|
||||
int vol_idx = gl_vol->volume_idx();
|
||||
assert(obj_idx >= 0 && vol_idx >= 0);
|
||||
if (obj_idx >= int(m_objects->size()) || vol_idx >= int(object(obj_idx)->volumes.size()))
|
||||
continue;
|
||||
if (object(obj_idx)->volumes[vol_idx]->is_cut_connector())
|
||||
sels.Add(m_objects_model->GetInfoItemByType(m_objects_model->GetItemById(obj_idx), InfoItemType::CutConnectors));
|
||||
else {
|
||||
|
||||
@@ -1005,6 +1005,9 @@ void ArrangeJob::finalize(bool canceled, std::exception_ptr &eptr) {
|
||||
// BBS: update slice context and gcode result.
|
||||
m_plater->update_slicing_context_to_current_partplate();
|
||||
|
||||
// The plates were rebuilt in arrange order, so the GLVolume ids are stale until the scene reloads.
|
||||
m_plater->get_view3D_canvas3D()->reload_scene(true);
|
||||
|
||||
wxGetApp().obj_list()->reload_all_plates();
|
||||
|
||||
m_plater->update();
|
||||
|
||||
Reference in new issue
Block a user