Blender Git Commit Log

Git Commits -> Revision c5ed2eb

Revision c5ed2eb by Brecht Van Lommel (master)
April 7, 2020, 15:14 (GMT)
Undo: change depsgraph recalc flags handling to improve performance

These changes only have an effect when the experimental Undo Speedup preference
is enabled.

* For DEG_id_tag_update, accumulate recalc flags immediately before the undo
push happens instead of afterwards. Otherwise the undo state does not
contain enough flags, and the current state may contain too many flags.

This also means we call DEG_id_tag_update after undo with the accumulated
flags to ensure they are flushed to other datablocks.

* For undo, accumulate recalc flags in id->recalc and clear accumulated flags
immediately. Not clearing would cause circular behavior where accumulated
flags may never end up being cleared.

This matches what happens after an undo push where these are also cleared,
indicating that the undo state and current in-memory state match exactly.

* Don't change id->recalc of identical datablocks, it should not be needed.
There is one exception for armatures where pointers across datablocks
exist which otherwise would cause problems. There may be a better solution
to this but it seems to work in agent 327 production files.

* This contains a change in undofile.c to avoid detecting all datablocks as
changed for the first of the two undo steps, where we restore to the state
of the last undo push before going to the one before.

Without this the whole system is much less efficient. However this is unsafe
in the sense that if an app handler or operators edits a datablock after an
undo push, that change will not be undone.

It can be argued that this is acceptable behavior, since a following undo push
will include that change and this may already have unexpected side effects.

Ref T60695

Differential Revision: https://developer.blender.org/D7339

Commit Details:

Full Hash: c5ed2eb95e3d75121b93b0271abf6cdec69d5a66
Parent Commit: 02598e6
Lines Changed: +103, -64

5 Modified Paths:

/source/blender/blenkernel/intern/scene.c (+0, -2) (Diff)
/source/blender/blenloader/intern/readfile.c (+66, -53) (Diff)
/source/blender/blenloader/intern/undofile.c (+4, -1) (Diff)
/source/blender/depsgraph/intern/depsgraph_tag.cc (+4, -3) (Diff)
/source/blender/editors/undo/memfile_undo.c (+29, -5) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021