diff options
author | bubnikv <bubnikv@gmail.com> | 2017-06-15 21:15:53 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-06-15 21:15:53 +0300 |
commit | cb43f19a90c05b5b8830b5594bc8e2f933d48dfc (patch) | |
tree | 19cc49ed200fcd52245405ac22af84c3e053e158 | |
parent | aa54c3402b300f3e192189c8d5d8f82e4ada15b5 (diff) |
Fixed a variable layer height profile update issue.version_1.35.5
https://github.com/prusa3d/Slic3r/issues/358
-rw-r--r-- | xs/src/libslic3r/Print.cpp | 12 | ||||
-rw-r--r-- | xs/src/libslic3r/PrintObject.cpp | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp index a7153c181..712570ff9 100644 --- a/xs/src/libslic3r/Print.cpp +++ b/xs/src/libslic3r/Print.cpp @@ -401,8 +401,6 @@ bool Print::apply_config(DynamicPrintConfig config) // The layer_height_profile is not valid for some reason (updated by the user or invalidated due to some option change). // Invalidate the slicing step, which in turn invalidates everything. object->invalidate_step(posSlice); - // Following line sets the layer_height_profile_valid flag. - object->update_layer_height_profile(); // Trigger recalculation. invalidated = true; } @@ -478,13 +476,15 @@ exit_for_rearrange_regions: for (PrintObject *object : this->objects) model_objects.push_back(object->model_object()); this->clear_objects(); - for (ModelObject *mo : model_objects) { + for (ModelObject *mo : model_objects) this->add_model_object(mo); - // Update layer_height_profile from the main thread as it may pull the data from the associated ModelObject. - this->objects.back()->update_layer_height_profile(); - } invalidated = true; } + + // Always make sure that the layer_height_profiles are set, as they should not be modified from the worker threads. + for (PrintObject *object : this->objects) + if (! object->layer_height_profile_valid) + object->update_layer_height_profile(); return invalidated; } diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 30da8b4ae..588e46ef6 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -1468,6 +1468,7 @@ void PrintObject::reset_layer_height_profile() { // Reset the layer_heigth_profile. this->layer_height_profile.clear(); + this->layer_height_profile_valid = false; // Reset the source layer_height_profile if it exists at the ModelObject. this->model_object()->layer_height_profile.clear(); this->model_object()->layer_height_profile_valid = false; |