Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-01-09 10:08:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-10 00:03:09 +0300
commit99d001a10f3c151e7952048760a07e1ca3f9aa8c (patch)
tree1637724d20975e1ea7b54a800b382e5152918ec6 /source
parent7f5bae28db0ce3d3bb62c66b45bba1fedfecaf93 (diff)
Fix sculpt redo failing to enable dyntopo
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c10
1 files changed, 8 insertions, 2 deletions
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);
+ }
}
/* -------------------------------------------------------------------- */