[Bf-blender-cvs] [1cb07530a95] blender-v2.81-release: Fix T71564: Undo stroke lags after entering sculpt mode

Campbell Barton noreply at git.blender.org
Mon Nov 18 13:35:52 CET 2019


Commit: 1cb07530a95615d2bec95ac76c62617838ff0a35
Author: Campbell Barton
Date:   Mon Nov 18 23:30:33 2019 +1100
Branches: blender-v2.81-release
https://developer.blender.org/rB1cb07530a95615d2bec95ac76c62617838ff0a35

Fix T71564: Undo stroke lags after entering sculpt mode

Regression since 2.80, see: T71434

===================================================================

M	source/blender/editors/sculpt_paint/sculpt.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index f7a5052b74a..6032c3615c6 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -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;
 }



More information about the Bf-blender-cvs mailing list