From faf20a26503a6b30655ca520f77b8020fcea6f7a Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 12 Dec 2022 15:37:36 +0100 Subject: [PATCH] Fixed crash while reloading scene when using sla printer with multipart objects --- src/slic3r/GUI/GLCanvas3D.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 1cb1ca4f3..23e974a55 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1944,9 +1944,9 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re // Shift-up all volumes of the object so that it has the right elevation with respect to the print bed for (GLVolume* volume : m_volumes.volumes) if (volume->object_idx() < (int)m_model->objects.size() && m_model->objects[volume->object_idx()]->instances[volume->instance_idx()]->is_printable()) { - const SLAPrintObject *po = sla_print()->objects()[volume->object_idx()]; - float zoffs = po->get_current_elevation() / sla_print()->relative_correction().z(); - volume->set_sla_shift_z(zoffs); + const SLAPrintObject* po = sla_print()->get_print_object_by_model_object_id(volume->object_idx()); + if (po != nullptr) + volume->set_sla_shift_z(po->get_current_elevation() / sla_print()->relative_correction().z()); } }