Fix T70845: Crash when switching scene of scene strip.
authorRichard Antalik <ISS>
Wed, 23 Oct 2019 00:30:43 +0000 (17:30 -0700)
committerRichard Antalik <richardantalik@gmail.com>
Wed, 23 Oct 2019 00:34:14 +0000 (17:34 -0700)
Crash on assert in `sound_verify_evaluated_id()`

Reviewed By: sergey

Maniphest Tasks: T70845

Differential Revision: https://developer.blender.org/D6104

release/scripts/addons_contrib
source/blender/blenkernel/intern/sound.c
source/blender/makesrna/intern/rna_sequencer.c

index 69bcc72f1ec4df73265ce35851658ef184b9d0f9..d9ed9d4d064c74c86e2767cd4be32d602a0ee317 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 69bcc72f1ec4df73265ce35851658ef184b9d0f9
+Subproject commit d9ed9d4d064c74c86e2767cd4be32d602a0ee317
index 6cbb01861e22d493891a1c1d2bfb70c6b5fee38c..d42436ecb40ff1b3c99bf0627ac55c8f1e8c45f6 100644 (file)
@@ -677,6 +677,9 @@ void BKE_sound_set_cfra(int cfra)
 void BKE_sound_set_scene_volume(Scene *scene, float volume)
 {
   sound_verify_evaluated_id(&scene->id);
+  if (scene->sound_scene == NULL) {
+    return;
+  }
   AUD_Sequence_setAnimationData(scene->sound_scene,
                                 AUD_AP_VOLUME,
                                 CFRA,
index 31ead989f2561323104e7d7aef5fb4e009fee67e..18985d415514fb431a49b342d4e1947640560214 100644 (file)
@@ -157,6 +157,13 @@ static void rna_Sequence_invalidate_composite_update(Main *UNUSED(bmain),
   }
 }
 
+static void rna_Sequence_scene_switch_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+  rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
+  DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO | ID_RECALC_SEQUENCER_STRIPS);
+  DEG_relations_tag_update(bmain);
+}
+
 static void rna_Sequence_use_sequence(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
   /* General update callback. */
@@ -2227,7 +2234,7 @@ static void rna_def_scene(BlenderRNA *brna)
   prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
   RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
   RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses");
-  RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
+  RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_scene_switch_update");
 
   prop = RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
   RNA_def_property_flag(prop, PROP_EDITABLE);