[Bf-blender-cvs] [99d001a10f3] blender2.7: Fix sculpt redo failing to enable dyntopo

Campbell Barton noreply at git.blender.org
Wed Jan 9 22:08:00 CET 2019


Commit: 99d001a10f3c151e7952048760a07e1ca3f9aa8c
Author: Campbell Barton
Date:   Wed Jan 9 18:08:14 2019 +1100
Branches: blender2.7
https://developer.blender.org/rB99d001a10f3c151e7952048760a07e1ca3f9aa8c

Fix sculpt redo failing to enable dyntopo

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

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

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

diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index aab3e009a9d..95b24ded278 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -60,6 +60,8 @@
 #include "BKE_mesh.h"
 #include "BKE_subsurf.h"
 #include "BKE_undo_system.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -1000,8 +1002,12 @@ void sculpt_undo_push_end(void)
 			BKE_pbvh_node_layer_disp_free(unode->node);
 	}
 
-	UndoStack *ustack = ED_undo_stack_get();
-	BKE_undosys_step_push(ustack, NULL, NULL);
+	/* We could remove this and enforce all callers run in an operator using 'OPTYPE_UNDO'. */
+	wmWindowManager *wm = G_MAIN->wm.first;
+	if (wm->op_undo_depth == 0) {
+		UndoStack *ustack = ED_undo_stack_get();
+		BKE_undosys_step_push(ustack, NULL, NULL);
+	}
 }
 
 /* -------------------------------------------------------------------- */



More information about the Bf-blender-cvs mailing list