[Bf-blender-cvs] [115a5bf65a6] blender-v2.81-release: Correct error in last commit

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


Commit: 115a5bf65a6b7f4b16a50f4c9a4611925d9eccb0
Author: Campbell Barton
Date:   Mon Nov 18 23:53:34 2019 +1100
Branches: blender-v2.81-release
https://developer.blender.org/rB115a5bf65a6b7f4b16a50f4c9a4611925d9eccb0

Correct error in last commit

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

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 6032c3615c6..89bc7912ccf 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -7868,6 +7868,19 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
     }
     ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, false, op->reports);
     BKE_paint_toolslots_brush_validate(bmain, &ts->sculpt->paint);
+
+    if (ob->mode & mode_flag) {
+      Mesh *me = ob->data;
+      /* Dyntopo add's it's own undo step. */
+      if ((me->flag & ME_SCULPT_DYNAMIC_TOPOLOGY) == 0) {
+        /* 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);
+        }
+      }
+    }
   }
 
   WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene);
@@ -7876,13 +7889,6 @@ 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