From 221af991c2474a8f382042b667269e3346dab25e Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Fri, 14 May 2021 11:52:33 +0200 Subject: [PATCH] Fixed update of PrintRegions after removing an object. The bug has been introduced during recent PrintRegion refactoring. --- src/libslic3r/PrintApply.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index f0e262fdc..c906a0041 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -372,6 +372,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ std::set model_object_status; // 1) Synchronize model objects. + bool print_regions_reshuffled = false; if (model.id() != m_model.id()) { // Kill everything, initialize from scratch. // Stop background processing. @@ -383,6 +384,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ delete object; } m_objects.clear(); + print_regions_reshuffled = true; m_model.assign_copy(model); for (const ModelObject *model_object : m_model.objects) model_object_status.emplace(model_object->id(), ModelObjectStatus::New); @@ -462,6 +464,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ } for (ModelObject *model_object : model_objects_old) delete model_object; + print_regions_reshuffled = true; } } } @@ -595,7 +598,6 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ } // 4) Generate PrintObjects from ModelObjects and their instances. - bool print_regions_reshuffled = false; { PrintObjectPtrs print_objects_new; print_objects_new.reserve(std::max(m_objects.size(), m_model.objects.size()));