From b6cf4a715bf0031d429c81c1c9a7210dc1c9388a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 26 Jun 2019 12:58:54 +0200 Subject: Fix missing volume update via scene strip's settings This is a part of T66117. The entire sequencer+3d sound was never reliable, so this is as much as i can fix currently. --- source/blender/blenkernel/intern/scene.c | 9 ++++++++- source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 4 +++- source/blender/makesrna/intern/rna_scene.c | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 09e05a9d93a..d2d56569bff 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -2467,7 +2467,14 @@ void BKE_scene_eval_sequencer_sequences(Depsgraph *depsgraph, Scene *scene) } } } - if (seq->scene_sound) { + if (seq->scene_sound != NULL) { + /* Make sure changing volume via sequence's properties panel works correct. + * + * Ideally, the entire BKE_scene_update_sound() will happen from a dependency graph, so + * then it is no longer needed to do such manual forced updates. */ + if (seq->type == SEQ_TYPE_SCENE && seq->scene != NULL) { + BKE_sound_set_scene_volume(seq->scene, seq->scene->audio.volume); + } if (seq->sound != NULL) { if (scene->id.recalc & ID_RECALC_AUDIO || seq->sound->id.recalc & ID_RECALC_AUDIO) { BKE_sound_update_scene_sound(seq->scene_sound, seq->sound); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index c8ef50fa18e..60233ecd304 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -2370,7 +2370,9 @@ void DepsgraphRelationBuilder::build_scene_sequencer(Scene *scene) if (seq->flag & SEQ_SCENE_STRIPS) { build_scene_sequencer(seq->scene); ComponentKey sequence_scene_audio_key(&seq->scene->id, NodeType::AUDIO); - add_relation(sequence_scene_audio_key, scene_audio_key, "Sequence Audio -> Scene Audio"); + add_relation(sequence_scene_audio_key, sequencer_key, "Sequence Scene Audio -> Sequencer"); + ComponentKey sequence_scene_key(&seq->scene->id, NodeType::SEQUENCER); + add_relation(sequence_scene_key, sequencer_key, "Sequence Scene -> Sequencer"); } ViewLayer *sequence_view_layer = BKE_view_layer_default_render(seq->scene); build_scene_speakers(seq->scene, sequence_view_layer); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 3fe8e9ba382..b47454ecd84 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -831,9 +831,10 @@ static void rna_Scene_listener_update(Main *UNUSED(bmain), Scene *scene, Pointer DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_LISTENER); } -static void rna_Scene_volume_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) +static void rna_Scene_volume_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_VOLUME); + Scene *scene = (Scene *)ptr->id.data; + DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_VOLUME | ID_RECALC_SEQUENCER_STRIPS); } static const char *rna_Scene_statistics_string_get(Scene *scene, -- cgit v1.2.3