From ff7faca943bd243f434eb707d76de17ff88211b3 Mon Sep 17 00:00:00 2001 From: Dima Buzdyk <46728448+buzzhuzz@users.noreply.github.com> Date: Thu, 4 Apr 2024 18:47:42 +0500 Subject: [PATCH] Fix model load in debug build (#4656) * Fix model load in debug build Debug build exit with error on model load due to failed assertion (file path redacted): orca-slicer: <...>/OrcaSlicer/src/libslic3r/Model.cpp:1361: void Slic3r::ModelObject::update_min_max_z(): Assertion `! this->instances.empty()' failed. Assertion failed due to model->ensure_on_bed() being called for object which yet to be load from file. Do not call ensure_on_bed() for models read from file since they may be read with no default instance. ensure_on_bed() called later within withing Plater::load_model_objects() for each object added. * Rework according to code review comment --- src/slic3r/GUI/Plater.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6fd95de599..22868af0cb 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -4056,7 +4056,8 @@ std::vector Plater::priv::load_files(const std::vector& input_ return empty_result; } - model_object->ensure_on_bed(is_project_file); + if (!model_object->instances.empty()) + model_object->ensure_on_bed(is_project_file); } tolal_model_count += model_idx;