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>2018-05-15 20:30:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-15 20:37:06 +0300
commit4461be1b722a4f6e5af4854eb12023b3670a4c3d (patch)
tree100ebfe3f3d4edc778812a2ce2cf2252553f4058 /source/blender/blenkernel/intern/undo_system.c
parent91504ed26e426445637a6aa73455052618ff0875 (diff)
Fix T55032: Redo w/ file saved in edit-mode failed
It's important edit-mode has a step stored for redo to work, file load now ensures this in a generic way.
Diffstat (limited to 'source/blender/blenkernel/intern/undo_system.c')
-rw-r--r--source/blender/blenkernel/intern/undo_system.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c
index 5a0081bff16..7eaf42591f0 100644
--- a/source/blender/blenkernel/intern/undo_system.c
+++ b/source/blender/blenkernel/intern/undo_system.c
@@ -251,6 +251,15 @@ void BKE_undosys_stack_init_from_main(UndoStack *ustack, struct Main *bmain)
undosys_stack_push_main(ustack, "original", bmain);
}
+/* called after 'BKE_undosys_stack_init_from_main' */
+void BKE_undosys_stack_init_from_context(UndoStack *ustack, bContext *C)
+{
+ const UndoType *ut = BKE_undosys_type_from_context(C);
+ if ((ut != NULL) && (ut != BKE_UNDOSYS_TYPE_MEMFILE) && (ut->mode == BKE_UNDOTYPE_MODE_STORE)) {
+ BKE_undosys_step_push_with_type(ustack, C, "original mode", ut);
+ }
+}
+
/* name optional */
bool BKE_undosys_stack_has_undo(UndoStack *ustack, const char *name)
{