mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-01 12:02:01 +08:00
Fix of #9809: Crash after splitting an object into parts.
Now after splitting an object into parts, custom supports, seams, and multimaterial painting are removed, and the user is notified about it. Also, this commit fixed the text of the notification about removing custom supports, seams, and multimaterial painting by Simplify gizmo. And it also fixed that info about custom supports, seams, and multimaterial painting was still shown in the right panel after the model simplification event when custom supports, seams, and multimaterial were removed.
This commit is contained in:
parent
a41dd8eeed
commit
db60d23c18
@ -2175,6 +2175,10 @@ void ObjectList::split()
|
|||||||
|
|
||||||
take_snapshot(_(L("Split to Parts")));
|
take_snapshot(_(L("Split to Parts")));
|
||||||
|
|
||||||
|
// Before splitting volume we have to remove all custom supports, seams, and multimaterial painting.
|
||||||
|
wxGetApp().plater()->clear_before_change_mesh(obj_idx, _u8L("Custom supports, seams and multimaterial painting were "
|
||||||
|
"removed after splitting the object."));
|
||||||
|
|
||||||
volume->split(nozzle_dmrs_cnt);
|
volume->split(nozzle_dmrs_cnt);
|
||||||
|
|
||||||
(*m_objects)[obj_idx]->input_file.clear();
|
(*m_objects)[obj_idx]->input_file.clear();
|
||||||
@ -2186,6 +2190,10 @@ void ObjectList::split()
|
|||||||
changed_object(obj_idx);
|
changed_object(obj_idx);
|
||||||
// update printable state for new volumes on canvas3D
|
// update printable state for new volumes on canvas3D
|
||||||
wxGetApp().plater()->canvas3D()->update_instance_printable_state_for_object(obj_idx);
|
wxGetApp().plater()->canvas3D()->update_instance_printable_state_for_object(obj_idx);
|
||||||
|
|
||||||
|
// After removing custom supports, seams, and multimaterial painting, we have to update info about the object to remove information about
|
||||||
|
// custom supports, seams, and multimaterial painting in the right panel.
|
||||||
|
wxGetApp().obj_list()->update_info_items(obj_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::merge(bool to_multipart_object)
|
void ObjectList::merge(bool to_multipart_object)
|
||||||
@ -4682,7 +4690,8 @@ void ObjectList::fix_through_netfabb()
|
|||||||
msg += "\n";
|
msg += "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
plater->clear_before_change_mesh(obj_idx);
|
plater->clear_before_change_mesh(obj_idx, _u8L("Custom supports, seams and multimaterial painting were "
|
||||||
|
"removed after repairing the mesh."));
|
||||||
std::string res;
|
std::string res;
|
||||||
if (!fix_model_by_win10_sdk_gui(*(object(obj_idx)), vol_idx, progress_dlg, msg, res))
|
if (!fix_model_by_win10_sdk_gui(*(object(obj_idx)), vol_idx, progress_dlg, msg, res))
|
||||||
return false;
|
return false;
|
||||||
|
@ -540,7 +540,11 @@ void GLGizmoSimplify::apply_simplify() {
|
|||||||
const Selection& selection = m_parent.get_selection();
|
const Selection& selection = m_parent.get_selection();
|
||||||
auto plater = wxGetApp().plater();
|
auto plater = wxGetApp().plater();
|
||||||
plater->take_snapshot(_u8L("Simplify ") + create_volumes_name(m_volume_ids, selection));
|
plater->take_snapshot(_u8L("Simplify ") + create_volumes_name(m_volume_ids, selection));
|
||||||
plater->clear_before_change_mesh(selection.get_object_idx());
|
plater->clear_before_change_mesh(selection.get_object_idx(), _u8L("Custom supports, seams and multimaterial painting were "
|
||||||
|
"removed after simplifying the mesh."));
|
||||||
|
// After removing custom supports, seams, and multimaterial painting, we have to update info about the object to remove information about
|
||||||
|
// custom supports, seams, and multimaterial painting in the right panel.
|
||||||
|
wxGetApp().obj_list()->update_info_items(selection.get_object_idx());
|
||||||
|
|
||||||
for (const auto &item: m_state.result) {
|
for (const auto &item: m_state.result) {
|
||||||
const ObjectID &id = item.first;
|
const ObjectID &id = item.first;
|
||||||
|
@ -3127,6 +3127,10 @@ void Plater::priv::split_object()
|
|||||||
Model new_model = model;
|
Model new_model = model;
|
||||||
ModelObject* current_model_object = new_model.objects[obj_idx];
|
ModelObject* current_model_object = new_model.objects[obj_idx];
|
||||||
|
|
||||||
|
// Before splitting object we have to remove all custom supports, seams, and multimaterial painting.
|
||||||
|
wxGetApp().plater()->clear_before_change_mesh(obj_idx, _u8L("Custom supports, seams and multimaterial painting were "
|
||||||
|
"removed after splitting the object."));
|
||||||
|
|
||||||
wxBusyCursor wait;
|
wxBusyCursor wait;
|
||||||
ModelObjectPtrs new_objects;
|
ModelObjectPtrs new_objects;
|
||||||
current_model_object->split(&new_objects);
|
current_model_object->split(&new_objects);
|
||||||
@ -7338,7 +7342,7 @@ bool Plater::set_printer_technology(PrinterTechnology printer_technology)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plater::clear_before_change_mesh(int obj_idx)
|
void Plater::clear_before_change_mesh(int obj_idx, const std::string ¬ification_msg)
|
||||||
{
|
{
|
||||||
ModelObject* mo = model().objects[obj_idx];
|
ModelObject* mo = model().objects[obj_idx];
|
||||||
|
|
||||||
@ -7356,8 +7360,7 @@ void Plater::clear_before_change_mesh(int obj_idx)
|
|||||||
get_notification_manager()->push_notification(
|
get_notification_manager()->push_notification(
|
||||||
NotificationType::CustomSupportsAndSeamRemovedAfterRepair,
|
NotificationType::CustomSupportsAndSeamRemovedAfterRepair,
|
||||||
NotificationManager::NotificationLevel::PrintInfoNotificationLevel,
|
NotificationManager::NotificationLevel::PrintInfoNotificationLevel,
|
||||||
_u8L("Custom supports, seams and multimaterial painting were "
|
notification_msg);
|
||||||
"removed after repairing the mesh."));
|
|
||||||
// _u8L("Undo the repair"),
|
// _u8L("Undo the repair"),
|
||||||
// [this, snapshot_time](wxEvtHandler*){
|
// [this, snapshot_time](wxEvtHandler*){
|
||||||
// // Make sure the snapshot is still available and that
|
// // Make sure the snapshot is still available and that
|
||||||
|
@ -273,7 +273,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_mesh(int obj_idx);
|
void clear_before_change_mesh(int obj_idx, const std::string ¬ification_msg);
|
||||||
void changed_mesh(int obj_idx);
|
void changed_mesh(int obj_idx);
|
||||||
|
|
||||||
void changed_object(int obj_idx);
|
void changed_object(int obj_idx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user