SPE-1838: Remove custom supports, seams, and multi-material painting from an embossed text when the geometry of the embossed text changes.

This commit is contained in:
Lukáš Hejl 2024-03-15 17:20:44 +01:00
parent 8601d829d7
commit aaf14f94bb
3 changed files with 23 additions and 0 deletions

View File

@ -1338,6 +1338,14 @@ bool GLGizmoEmboss::process(bool make_snapshot)
if (!start_update_volume(std::move(data), *m_volume, selection, m_raycast_manager)) if (!start_update_volume(std::move(data), *m_volume, selection, m_raycast_manager))
return false; return false;
wxGetApp().plater()->clear_before_change_volume(*m_volume, _u8L("Custom supports, seams and multimaterial painting were "
"removed after embossed text changed."));
// When we changed geometry and removed custom supports, seams, and multimaterial painting
// we have to update info about the object to remove information about custom supports,
// seams, and multimaterial painting from the right panel.
wxGetApp().obj_list()->update_info_items(selection.get_object_idx());
// notification is removed befor object is changed by job // notification is removed befor object is changed by job
remove_notification_not_valid_font(); remove_notification_not_valid_font();
return true; return true;

View File

@ -6633,6 +6633,20 @@ bool Plater::set_printer_technology(PrinterTechnology printer_technology)
return ret; return ret;
} }
void Plater::clear_before_change_volume(ModelVolume &mv, const std::string &notification_msg) {
// When we change the geometry of the volume, we remove any custom supports/seams/multi-material painting.
if (const bool paint_removed = !mv.supported_facets.empty() || !mv.seam_facets.empty() || !mv.mm_segmentation_facets.empty(); paint_removed) {
mv.supported_facets.reset();
mv.seam_facets.reset();
mv.mm_segmentation_facets.reset();
get_notification_manager()->push_notification(
NotificationType::CustomSupportsAndSeamRemovedAfterRepair,
NotificationManager::NotificationLevel::PrintInfoNotificationLevel,
notification_msg);
}
}
void Plater::clear_before_change_mesh(int obj_idx, const std::string &notification_msg) void Plater::clear_before_change_mesh(int obj_idx, const std::string &notification_msg)
{ {
ModelObject* mo = model().objects[obj_idx]; ModelObject* mo = model().objects[obj_idx];

View File

@ -215,6 +215,7 @@ public:
void reslice_FFF_until_step(PrintObjectStep step, const ModelObject &object, bool postpone_error_messages = false); void reslice_FFF_until_step(PrintObjectStep step, const ModelObject &object, bool postpone_error_messages = false);
void reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages = false); void reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages = false);
void clear_before_change_volume(ModelVolume &mv, const std::string &notification_msg);
void clear_before_change_mesh(int obj_idx, const std::string &notification_msg); void clear_before_change_mesh(int obj_idx, const std::string &notification_msg);
void changed_mesh(int obj_idx); void changed_mesh(int obj_idx);