[Bf-blender-cvs] [4c7b1766a7f] master: Fix undo steps not allowing re-using old BMain in non-global undo.

Bastien Montagne noreply at git.blender.org
Fri Oct 30 11:55:32 CET 2020


Commit: 4c7b1766a7f1316a5ee8c01d2a8746372e7446e8
Author: Bastien Montagne
Date:   Fri Oct 30 11:51:48 2020 +0100
Branches: master
https://developer.blender.org/rB4c7b1766a7f1316a5ee8c01d2a8746372e7446e8

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.

===================================================================

M	source/blender/blenkernel/intern/undo_system.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list