Fix through Netfabb notification - remove 'undo' hypertext for now and
refuse to fix when a gizmo is opened (because of missing updates)
This is a follow-up of 1249fdb
This commit is contained in:
parent
8b980d4b77
commit
20aa8d65bf
1 changed files with 27 additions and 11 deletions
|
@ -3365,7 +3365,18 @@ void Plater::priv::fix_through_netfabb(const int obj_idx, const int vol_idx/* =
|
||||||
if (obj_idx < 0)
|
if (obj_idx < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
size_t snapshot_time = undo_redo_stack().active_snapshot_time();
|
// Do not fix anything when a gizmo is open. There might be issues with updates
|
||||||
|
// and what is worse, the snapshot time would refer to the internal stack.
|
||||||
|
if (q->canvas3D()->get_gizmos_manager().get_current_type() != GLGizmosManager::Undefined) {
|
||||||
|
notification_manager->push_notification(
|
||||||
|
NotificationType::CustomSupportsAndSeamRemovedAfterRepair,
|
||||||
|
NotificationManager::NotificationLevel::RegularNotification,
|
||||||
|
_u8L("ERROR: Please close all manipulators available from "
|
||||||
|
"the left toolbar before fixing the mesh."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// size_t snapshot_time = undo_redo_stack().active_snapshot_time();
|
||||||
Plater::TakeSnapshot snapshot(q, _L("Fix through NetFabb"));
|
Plater::TakeSnapshot snapshot(q, _L("Fix through NetFabb"));
|
||||||
|
|
||||||
ModelObject* mo = model.objects[obj_idx];
|
ModelObject* mo = model.objects[obj_idx];
|
||||||
|
@ -3383,16 +3394,21 @@ void Plater::priv::fix_through_netfabb(const int obj_idx, const int vol_idx/* =
|
||||||
notification_manager->push_notification(
|
notification_manager->push_notification(
|
||||||
NotificationType::CustomSupportsAndSeamRemovedAfterRepair,
|
NotificationType::CustomSupportsAndSeamRemovedAfterRepair,
|
||||||
NotificationManager::NotificationLevel::RegularNotification,
|
NotificationManager::NotificationLevel::RegularNotification,
|
||||||
_u8L("Custom supports and seams were removed after repairing the mesh."),
|
_u8L("Custom supports and seams were removed after repairing the mesh."));
|
||||||
_u8L("Undo the repair"),
|
// _u8L("Undo the repair"),
|
||||||
[this, snapshot_time](wxEvtHandler*){
|
// [this, snapshot_time](wxEvtHandler*){
|
||||||
if (undo_redo_stack().has_undo_snapshot(snapshot_time))
|
// // Make sure the snapshot is still available and that
|
||||||
undo_redo_to(snapshot_time);
|
// // we are in the main stack and not in a gizmo-stack.
|
||||||
else
|
// if (undo_redo_stack().has_undo_snapshot(snapshot_time)
|
||||||
notification_manager->push_notification(
|
// && q->canvas3D()->get_gizmos_manager().get_current() == nullptr)
|
||||||
_u8L("Cannot undo to before the mesh repair!"));
|
// undo_redo_to(snapshot_time);
|
||||||
return true;
|
// else
|
||||||
});
|
// notification_manager->push_notification(
|
||||||
|
// NotificationType::CustomSupportsAndSeamRemovedAfterRepair,
|
||||||
|
// NotificationManager::NotificationLevel::RegularNotification,
|
||||||
|
// _u8L("Cannot undo to before the mesh repair!"));
|
||||||
|
// return true;
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
fix_model_by_win10_sdk_gui(*mo, vol_idx);
|
fix_model_by_win10_sdk_gui(*mo, vol_idx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue