Fix of missing invalidation on object name change (#8059, #12193, SPE-2139)

This commit is contained in:
Lukas Matena 2024-02-06 09:19:32 +01:00
parent 8dc1d70d85
commit 3ef556f43c
2 changed files with 6 additions and 1 deletions

View File

@ -1239,7 +1239,10 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
model_volume_list_copy_configs(model_object /* dst */, model_object_new /* src */, ModelVolumeType::PARAMETER_MODIFIER);
layer_height_ranges_copy_configs(model_object.layer_config_ranges /* dst */, model_object_new.layer_config_ranges /* src */);
// Copy the ModelObject name, input_file and instances. The instances will be compared against PrintObject instances in the next step.
model_object.name = model_object_new.name;
if (model_object.name != model_object_new.name) {
update_apply_status(this->invalidate_step(psGCodeExport));
model_object.name = model_object_new.name;
}
model_object.input_file = model_object_new.input_file;
// Only refresh ModelInstances if there is any change.
if (model_object.instances.size() != model_object_new.instances.size() ||

View File

@ -694,6 +694,8 @@ void ObjectList::update_name_in_model(const wxDataViewItem& item) const
//update object name with text marker in ObjectList
m_objects_model->SetName(get_item_name(obj->name, true), item);
}
// Renaming an object should invalidate gcode export - schedule Print::apply call.
wxGetApp().plater()->schedule_background_process();
return;
}