Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVojtech Bubnik <bubnikv@gmail.com>2021-06-01 12:12:55 +0300
committerVojtech Bubnik <bubnikv@gmail.com>2021-06-01 12:12:55 +0300
commit7681eb849645799dc3952b0425a7300c9b71810e (patch)
tree8c468290bfab9945700210c699cd28ee2bad52f0 /src/libslic3r
parent206bef76239bd4ce2051d36ac73f34de7b83b770 (diff)
PrintRegion refactoring: Fixed a crash when an object is moved from outside
the print bed inside and it becomes printable.
Diffstat (limited to 'src/libslic3r')
-rw-r--r--src/libslic3r/PrintApply.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp
index 88023fee1..fe90abbd7 100644
--- a/src/libslic3r/PrintApply.cpp
+++ b/src/libslic3r/PrintApply.cpp
@@ -1068,10 +1068,13 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
bool layer_height_ranges_differ = ! layer_height_ranges_equal(model_object.layer_config_ranges, model_object_new.layer_config_ranges, model_object_new.layer_height_profile.empty());
bool model_origin_translation_differ = model_object.origin_translation != model_object_new.origin_translation;
auto print_objects_range = print_object_status_db.get_range(model_object);
- assert(print_objects_range.begin() != print_objects_range.end());
+ // The list actually can be empty if all instances are out of the print bed.
+ //assert(print_objects_range.begin() != print_objects_range.end());
// All PrintObjects in print_objects_range shall point to the same prints_objects_regions
- model_object_status.print_object_regions = print_objects_range.begin()->print_object->m_shared_regions;
- model_object_status.print_object_regions->ref_cnt_inc();
+ if (print_objects_range.begin() != print_objects_range.end()) {
+ model_object_status.print_object_regions = print_objects_range.begin()->print_object->m_shared_regions;
+ model_object_status.print_object_regions->ref_cnt_inc();
+ }
if (solid_or_modifier_differ || model_origin_translation_differ || layer_height_ranges_differ ||
! model_object.layer_height_profile.timestamp_matches(model_object_new.layer_height_profile)) {
// The very first step (the slicing step) is invalidated. One may freely remove all associated PrintObjects.