diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-09 10:08:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-09 10:10:16 +0300 |
commit | ef33215bb777eb3eb0d7d5527f39fb7788deb7ec (patch) | |
tree | 9139f1f20527bb92894a4b617e5570fdefa2bdc3 /source | |
parent | 7e6d7d53cf9d269c402b4eef5eae7b8c363b6707 (diff) |
Fix sculpt redo failing to enable dyntopo
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 10 |
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 090bc335d66..d3bcee3dc2e 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -62,6 +62,8 @@ #include "BKE_subsurf.h" #include "BKE_subdiv_ccg.h" #include "BKE_undo_system.h" +#include "BKE_global.h" +#include "BKE_main.h" #include "DEG_depsgraph.h" @@ -1009,8 +1011,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); + } } /* -------------------------------------------------------------------- */ |