diff options
author | Bastien Montagne <bastien@blender.org> | 2020-10-30 13:51:48 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-10-30 13:51:48 +0300 |
commit | 4c7b1766a7f1316a5ee8c01d2a8746372e7446e8 (patch) | |
tree | 6fbe1b98bd4b7fc205f90873583b939cc7908f1c /source/blender/blenkernel/intern/undo_system.c | |
parent | 30b17e30f8f27c709efc0cefe99e0fcb9166d5dc (diff) |
Fix undo steps not allowing re-using old BMain in non-global undo.
Non-memfile undo steps never properly initialized the flag allowing to
re-use old Main data during undo/redo. This lead to doing a complete
full re-reading of data when undoing/redoing mode switches e.g.
Note that current undo system is supposed to support any kind of mode
switch across those steps, however this needs to be properly deeply
tested, so only comitting this to master. It would be way too risky for
2.91 release.
Diffstat (limited to 'source/blender/blenkernel/intern/undo_system.c')
-rw-r--r-- | source/blender/blenkernel/intern/undo_system.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c index 8e89aa8098d..a319c55709d 100644 --- a/source/blender/blenkernel/intern/undo_system.c +++ b/source/blender/blenkernel/intern/undo_system.c @@ -549,6 +549,8 @@ bool BKE_undosys_step_push_with_type(UndoStack *ustack, BLI_strncpy(us->name, name, sizeof(us->name)); } us->type = ut; + /* True by default, code needs to explicitely set it to false if necessary. */ + us->use_old_bmain_data = true; /* Initialized, not added yet. */ CLOG_INFO(&LOG, 1, "addr=%p, name='%s', type='%s'", us, us->name, us->type->name); |