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:
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
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue