From 47084bac9f3c4c95b6fa3e3c3d5b1e661b2bec47 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 Apr 2020 17:38:34 +0200 Subject: Fix T75542: toggling modifier visibility not working correct with undo speedup The problem was that in direct_link_id_restore_recalc, recalc_undo_accumulated should contain the changes from the target state to the current state. However it had already been cleared at that point, to start accumulating changes up to the next undo push. Delaying the clear of this flag seems like the obvious solution, but it's hard to find the right place for that (if there is one). Instead this splits up the flag into two separate variables. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D7402 --- source/blender/makesdna/DNA_ID.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 1e894d44f87..dd3964dfc15 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -246,11 +246,16 @@ typedef struct ID { int icon_id; int recalc; /** - * Used by undo code. Value of recalc is stored there when reading an ID from memfile, and not - * touched by anything, which means it can be used as 'reference' recalc value for the next undo - * step, when going backward (i.e. actual undo, redo can just use recalc value directly). + * Used by undo code. recalc_after_undo_push contains the changes between the + * last undo push and the current state. This is accumulated as IDs are tagged + * for update in the depsgraph, and only cleared on undo push. + * + * recalc_up_to_undo_push is saved to undo memory, and is the value of + * recalc_after_undo_push at the time of the undo push. This means it can be + * used to find the changes between undo states. */ - int recalc_undo_accumulated; + int recalc_up_to_undo_push; + int recalc_after_undo_push; /** * A session-wide unique identifier for a given ID, that remain the same across potential @@ -258,8 +263,6 @@ typedef struct ID { */ unsigned int session_uuid; - char _pad[4]; - IDProperty *properties; /** Reference linked ID which this one overrides. */ -- cgit v1.2.3