Page MenuHome
Paste P1140

T70845 snippet a
ActivePublic

Authored by Philipp Oeser (lichtwerk) on Oct 15 2019, 10:03 PM.
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index c42cf91944e..94f7d3316d3 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -129,6 +129,24 @@ static void rna_Sequence_invalidate_raw_update(Main *UNUSED(bmain),
}
}
+static void rna_Sequence_scene_switch(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
+
+ /* this avoids the assert */
+ DEG_relations_tag_update(bmain);
+
+ /* ignore all the following, this is just stabbing in the dark... */
+ Editing *ed = BKE_sequencer_editing_get(scene, false);
+ if (ed) {
+ Sequence *seq = (Sequence *)ptr->data;
+ if (seq->scene != NULL) {
+ DEG_id_tag_update(&seq->scene->id, ID_RECALC_COPY_ON_WRITE | ID_RECALC_AUDIO);
+ }
+ }
+ DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS | ID_RECALC_AUDIO);
+}
+
static void rna_Sequence_invalidate_preprocessed_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *ptr)
@@ -2227,7 +2245,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);
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");
prop = RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);