[Bf-blender-cvs] [b6cf4a715bf] master: Fix missing volume update via scene strip's settings

Sergey Sharybin noreply at git.blender.org
Wed Jun 26 13:00:21 CEST 2019


Commit: b6cf4a715bf0031d429c81c1c9a7210dc1c9388a
Author: Sergey Sharybin
Date:   Wed Jun 26 12:58:54 2019 +0200
Branches: master
https://developer.blender.org/rBb6cf4a715bf0031d429c81c1c9a7210dc1c9388a

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.

===================================================================

M	source/blender/blenkernel/intern/scene.c
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/makesrna/intern/rna_scene.c

===================================================================

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,



More information about the Bf-blender-cvs mailing list