[Bf-blender-cvs] [89946834a17] master: Fix T66279: Strip sound keeps playing after toggling to Camera

Sergey Sharybin noreply at git.blender.org
Mon Jul 1 11:15:03 CEST 2019


Commit: 89946834a1708db91645aac4fb950b7588035d6d
Author: Sergey Sharybin
Date:   Mon Jul 1 11:12:18 2019 +0200
Branches: master
https://developer.blender.org/rB89946834a1708db91645aac4fb950b7588035d6d

Fix T66279: Strip sound keeps playing after toggling to Camera

Before this change using Sequencer input for the scene strip would
permanently enable sound playing back for that strip. Going back to
Camera would have been still playing sound from the strip, which is
rather misleading since rest of the nested sequencer is not used.

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

M	source/blender/blenkernel/intern/scene.c

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

diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index d2d56569bff..a447b828bb1 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -2445,6 +2445,21 @@ void BKE_scene_cursor_from_mat4(View3DCursor *cursor, const float mat[4][4], boo
 
 /* Dependency graph evaluation. */
 
+static void scene_sequencer_disable_sound_strips(Scene *scene)
+{
+  if (scene->sound_scene == NULL) {
+    return;
+  }
+  Sequence *seq;
+  SEQ_BEGIN (scene->ed, seq) {
+    if (seq->scene_sound != NULL) {
+      BKE_sound_remove_scene_sound(scene, seq->scene_sound);
+      seq->scene_sound = NULL;
+    }
+  }
+  SEQ_END;
+}
+
 void BKE_scene_eval_sequencer_sequences(Depsgraph *depsgraph, Scene *scene)
 {
   DEG_debug_print_eval(depsgraph, __func__, scene->id.name, scene);
@@ -2474,6 +2489,9 @@ void BKE_scene_eval_sequencer_sequences(Depsgraph *depsgraph, Scene *scene)
        * 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->flag & SEQ_SCENE_STRIPS) == 0) {
+          scene_sequencer_disable_sound_strips(seq->scene);
+        }
       }
       if (seq->sound != NULL) {
         if (scene->id.recalc & ID_RECALC_AUDIO || seq->sound->id.recalc & ID_RECALC_AUDIO) {



More information about the Bf-blender-cvs mailing list