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-01-18 15:15:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-18 16:25:55 +0300
commit985712e5ee178789dbdf9124a896252db042ba50 (patch)
tree3362fd14f079071fa12ba9404105a96ba90c13df /source/blender/editors/util/ed_util.c
parentc8067a555932b122b9495dacbac86992a5ff1a8e (diff)
Fix loading a file saved w/ dyntopo
Ensure ED_editors_init doesn't create any undo steps before the initial memfile undo is written.
Diffstat (limited to 'source/blender/editors/util/ed_util.c')
-rw-r--r--source/blender/editors/util/ed_util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index abc4f20ac71..3bd87314c12 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -95,16 +95,15 @@ void ED_editors_init(bContext *C)
Scene *scene = CTX_data_scene(C);
wmWindowManager *wm = CTX_wm_manager(C);
- if (wm->undo_stack == NULL) {
- wm->undo_stack = BKE_undosys_stack_create();
- }
-
/* This is called during initialization, so we don't want to store any reports */
ReportList *reports = CTX_wm_reports(C);
int reports_flag_prev = reports->flag & ~RPT_STORE;
SWAP(int, reports->flag, reports_flag_prev);
+ /* Don't do undo pushes when calling an operator. */
+ wm->op_undo_depth++;
+
/* toggle on modes for objects that were saved with these enabled. for
* e.g. linked objects we have to ensure that they are actually the
* active object in this scene. */
@@ -177,6 +176,7 @@ void ED_editors_init(bContext *C)
}
SWAP(int, reports->flag, reports_flag_prev);
+ wm->op_undo_depth--;
}
/* frees all editmode stuff */