Fix T71564: Undo stroke lags after entering sculpt mode

Regression since 2.80, see: T71434
This commit is contained in:
Campbell Barton 2019-11-18 23:30:33 +11:00
parent 99640d0622
commit 1cb07530a9
Notes: blender-bot 2023-02-14 01:52:41 +01:00
Referenced by issue #82388, Regression: Sculpt mode undo: Broken when undoing to a Global/memfile undo step after  rB4c7b1766a7f1
Referenced by issue #71564, Undo of the first stroke after entering sculpt mode for 2.8 models is lagging
1 changed files with 7 additions and 0 deletions

View File

@ -7876,6 +7876,13 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
WM_toolsystem_update_from_context_view3d(C);
/* Without this the memfile undo step is used,
* while it works it causes lag when undoing the first undo step, see T71564. */
wmWindowManager *wm = CTX_wm_manager(C);
if (wm->op_undo_depth <= 1) {
sculpt_undo_push_begin(op->type->name);
}
return OPERATOR_FINISHED;
}