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
This commit is contained in:
Dima Buzdyk 2024-04-04 18:47:42 +05:00 committed by GitHub
parent 9d81245eff
commit ff7faca943
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4056,7 +4056,8 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& 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;