diff options
author | FĂ©lix <Miadim> | 2021-03-20 01:36:28 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-03-20 03:40:53 +0300 |
commit | 4158405c0b9d32dd0c6cc1844bc06561b8513766 (patch) | |
tree | c6d600d0874d80b30914c4d593cea5d5d4f668c2 /source/blender/makesrna/intern/rna_sequencer_api.c | |
parent | 01f028a677e27cb68ea499c7899f7c7ba1bd9426 (diff) |
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
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer_api.c | 22 |
1 files changed, 22 insertions, 0 deletions
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, |