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
This commit is contained in:
Sergey Sharybin 2019-09-10 11:13:19 +02:00
parent ea513a97f5
commit f7fce00297
Notes: blender-bot 2023-02-14 06:23:08 +01:00
Referenced by issue #75626, Changing properties of an object from a frame_change_post handler blocks animation
Referenced by issue #73686, Motion Paths not working with BlenRig armatures
1 changed files with 11 additions and 3 deletions

View File

@ -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);