diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-04-14 20:22:18 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-04-17 17:33:05 +0300 |
commit | 6adb254bb046ab337cfd4225ca55e17f196db312 (patch) | |
tree | 6a568097a02fdd700123ec1411f6b1169a99c6df /source/blender/blenkernel | |
parent | 27941b027b245e4814074698a9bdc193a8d0a0d3 (diff) |
Fix T75686: Animating scene audio volume doesn't work
Scene audio volume changes require the scene to be tagged with
`ID_RECALC_AUDIO_VOLUME` (see `BKE_scene_update_sound()`). Tagging
happens in the RNA update function `rna_Scene_volume_update()`, but that
function is not called by the animation system. As a result, animated
volume changes are not sent to the audio system.
This commit adds a new depsgraph operation node that sets this tag when
necessary, so that the animated values are used in the rest of the
depsgraph evaluation.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D7429
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index c10f8d39bb2..dca6f569e25 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -141,6 +141,7 @@ int BKE_scene_orientation_slot_get_index(const struct TransformOrientationSlot * /* ** Scene evaluation ** */ void BKE_scene_update_sound(struct Depsgraph *depsgraph, struct Main *bmain); +void BKE_scene_update_tag_audio_volume(struct Depsgraph *, struct Scene *scene); void BKE_scene_graph_update_tagged(struct Depsgraph *depsgraph, struct Main *bmain); void BKE_scene_graph_evaluated_ensure(struct Depsgraph *depsgraph, struct Main *bmain); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index c4b6f5dafe5..f7c018edbd8 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1278,6 +1278,14 @@ void BKE_scene_update_sound(Depsgraph *depsgraph, Main *bmain) BKE_sound_update_scene(depsgraph, scene); } +void BKE_scene_update_tag_audio_volume(Depsgraph *UNUSED(depsgraph), Scene *scene) +{ + BLI_assert(DEG_is_evaluated_id(&scene->id)); + /* The volume is actually updated in BKE_scene_update_sound(), from either + * scene_graph_update_tagged() or from BKE_scene_graph_update_for_newframe(). */ + scene->id.recalc |= ID_RECALC_AUDIO_VOLUME; +} + /* TODO(sergey): This actually should become view_layer_graph or so. * Same applies to update_for_newframe. * |