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:
authorBrecht Van Lommel <brecht>2020-04-13 18:38:34 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-04-14 12:07:56 +0300
commit47084bac9f3c4c95b6fa3e3c3d5b1e661b2bec47 (patch)
tree9135ce56389ba7a24b3decf3cd13cf1c69179ab6 /source/blender/makesdna/DNA_ID.h
parente6d9d5dcc18f3ab55c31abc6bfb2010081538422 (diff)
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
Diffstat (limited to 'source/blender/makesdna/DNA_ID.h')
-rw-r--r--source/blender/makesdna/DNA_ID.h15
1 files changed, 9 insertions, 6 deletions
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. */