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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-11-18 15:53:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-11-18 15:53:34 +0300
commit115a5bf65a6b7f4b16a50f4c9a4611925d9eccb0 (patch)
treeaa04e8f4a2d3532b80f092578b0cc8e0721d0d60
parent1cb07530a95615d2bec95ac76c62617838ff0a35 (diff)
Correct error in last commit
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c20
1 files changed, 13 insertions, 7 deletions
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;
}