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-09-10 12:13:19 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-09-11 11:43:27 +0300
commitf7fce002976998531849f32180d44dcbaa878f61 (patch)
tree7dbd03224a9ac7e093c77e2a5ebe5220111a430b /source/blender/blenkernel/intern
parentea513a97f5339e10d0e1abf4bf301a7b38a40330 (diff)
Depsgraph: Allow non-keyed changes from frame_change_post handler
Makes it possible to do custom edits to animated properties from a python handler. Reviewers: brecht Differential Revision: https://developer.blender.org/D5738
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/scene.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index cd10713897a..3ea009b0014 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1377,9 +1377,17 @@ void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph, Main *bmain)
#endif
/* Update all objects: drivers, matrices, displists, etc. flags set
* by depgraph or manual, no layer check here, gets correct flushed.
- */
- const float ctime = BKE_scene_frame_get(scene);
- DEG_evaluate_on_framechange(bmain, depsgraph, ctime);
+ *
+ * NOTE: Only update for new frame on first iteration. Second iteration is for ensuring user
+ * edits from callback are properly taken into account. Doing a time update on those would
+ * loose any possible unkeyed changes made by the handler. */
+ if (pass == 0) {
+ const float ctime = BKE_scene_frame_get(scene);
+ DEG_evaluate_on_framechange(bmain, depsgraph, ctime);
+ }
+ else {
+ DEG_evaluate_on_refresh(bmain, depsgraph);
+ }
/* Update sound system animation. */
BKE_scene_update_sound(depsgraph, bmain);