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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-07-22 18:07:46 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-07-26 15:33:51 +0300
commit523de7ae9ba737faba76f46ee08d59a5507dc421 (patch)
tree2e9dc2a6905da2a39e4df9d85a49c4ef3d5a8d12 /source/blender/blenloader
parentba94aaedba26acc4a43b78ad7fd3552f1dbafc36 (diff)
Fix T66325: Animation Keyframe Undo/Redo Bug
The issue was caused by dependency graph always ignoring animation update when it is first time constructed. This was a way to make it preserve unkeyed changes on undo/redo. This, however, made it so changes of animation data itself (such as deleting/moving keyframes) did not trigger animation update by the dependency graph. This worked prior to copy-on-write because animation recalc flags were stored in the DNA and never re-set on file/undo load. This was giving dependency graph a clue that animation is to be re-evaluated when operator explicitly asked to (more precisely, when such operator was undone/redone). This change makes it so original ID's recalc flags are storing recalc flags when ID is tagged for update as an response to user input. This way re-building dependency graph can force animation to be updated on redo. Tricky part here is that ID's recalc flag is no longer to be zeroed when loading undo step (which is the same as reading .blend file). This is something what works differently comparing to legacy dependency graph, which was zeroing object's recalc flags there but not animation data's recalc flags. Shouldn't be causing issues, since unkeyed changes are not preserved upon opening a file anyway, at least to my knowledge. Related reports which are to be taken into account and verified they are not re-introduced when making changes in the area: - T63111: Auto-Bake stuck at constant re-rendering - T54296: Cycles viewport render stuck on constant re-render Reviewers: campbellbarton, brecht Reviewed By: campbellbarton, brecht Maniphest Tasks: T66325 Differential Revision: https://developer.blender.org/D5316
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 44039ad59ee..acca42b6562 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9137,7 +9137,18 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const int ta
id->icon_id = 0;
id->newid = NULL; /* Needed because .blend may have been saved with crap value here... */
id->orig_id = NULL;
- id->recalc = 0;
+
+ /* NOTE: It is important to not clear the recalc flags for undo/redo.
+ * Preserving recalc flags on redo/undo is the only way to make dependency graph detect
+ * that animation is to be evaluated on undo/redo. If this is not enforced by the recalc
+ * flags dependency graph does not do animation update to avoid loss of unkeyed changes.,
+ * which conflicts with undo/redo of changes to animation data itself.
+ *
+ * But for regular file load we clear the flag, since the flags might have been changed sinde
+ * the version the file has been saved with. */
+ if (!fd->memfile) {
+ id->recalc = 0;
+ }
/* this case cannot be direct_linked: it's just the ID part */
if (bhead->code == ID_LINK_PLACEHOLDER) {