From 4158405c0b9d32dd0c6cc1844bc06561b8513766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix?= Date: Fri, 19 Mar 2021 23:36:28 +0100 Subject: VSE: Add move_to_meta RNA API function This function can be used to move strips into meta strips with no side effects like change of selection state. Reviewed By: ISS Differential Revision: https://developer.blender.org/D10759 --- source/blender/makesrna/intern/rna_sequencer_api.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index 00d8c43a111..04ca3cfdb32 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -81,6 +81,23 @@ static void rna_Sequence_swap_internal(Sequence *seq_self, } } +static void rna_Sequences_move_strip_to_meta(ID *id, + Sequence *seq_self, + Main *bmain, + Sequence *meta_dst) +{ + Scene *scene = (Scene *)id; + + /* Move strip to meta */ + SEQ_edit_move_strip_to_meta(scene, seq_self, meta_dst); + + /* Udate depsgraph */ + DEG_relations_tag_update(bmain); + DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); + + WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); +} + static Sequence *rna_Sequences_new_clip(ID *id, ListBase *seqbase, Main *bmain, @@ -607,6 +624,11 @@ void RNA_api_sequence_strip(StructRNA *srna) parm = RNA_def_pointer(func, "other", "Sequence", "Other", ""); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); + func = RNA_def_function(srna, "move_to_meta", "rna_Sequences_move_strip_to_meta"); + RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); + parm = RNA_def_pointer(func, "meta_sequence", "Sequence", "Destination Meta Sequence", "Meta to move the strip into"); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); + func = RNA_def_function(srna, "invalidate_cache", "rna_Sequence_invalidate_cache_rnafunc"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); RNA_def_function_ui_description(func, -- cgit v1.2.3