Fix wipe tower invalidating other beds

This commit is contained in:
Martin Šach 2024-12-06 11:45:41 +01:00 committed by Lukas Matena
parent 626b49e702
commit 34242a1932
2 changed files with 5 additions and 1 deletions

View File

@ -211,13 +211,16 @@ void restore_object_instances(Model& model, const ObjectInstances &object_instan
void with_single_bed_model(Model &model, const int bed_index, const std::function<void()> &callable) { void with_single_bed_model(Model &model, const int bed_index, const std::function<void()> &callable) {
const InstanceOffsets original_offssets{MultipleBedsUtils::get_instance_offsets(model)}; const InstanceOffsets original_offssets{MultipleBedsUtils::get_instance_offsets(model)};
const ObjectInstances original_objects{get_object_instances(model)}; const ObjectInstances original_objects{get_object_instances(model)};
const int original_bed{s_multiple_beds.get_active_bed()};
Slic3r::ScopeGuard guard([&]() { Slic3r::ScopeGuard guard([&]() {
restore_object_instances(model, original_objects); restore_object_instances(model, original_objects);
restore_instance_offsets(model, original_offssets); restore_instance_offsets(model, original_offssets);
s_multiple_beds.set_active_bed(original_bed);
}); });
s_multiple_beds.move_from_bed_to_first_bed(model, bed_index); s_multiple_beds.move_from_bed_to_first_bed(model, bed_index);
s_multiple_beds.remove_instances_outside_outside_bed(model, bed_index); s_multiple_beds.remove_instances_outside_outside_bed(model, bed_index);
s_multiple_beds.set_active_bed(bed_index);
callable(); callable();
} }

View File

@ -1123,8 +1123,9 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
} }
// Check the position and rotation of the wipe tower. // Check the position and rotation of the wipe tower.
if (model.wipe_tower() != m_model.wipe_tower()) if (model.wipe_tower() != m_model.wipe_tower()) {
update_apply_status(this->invalidate_step(psSkirtBrim)); update_apply_status(this->invalidate_step(psSkirtBrim));
}
m_model.wipe_tower() = model.wipe_tower(); m_model.wipe_tower() = model.wipe_tower();
ModelObjectStatusDB model_object_status_db; ModelObjectStatusDB model_object_status_db;