diff options
author | FĂ©lix <Miadim> | 2021-08-24 02:16:22 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-08-24 02:21:08 +0300 |
commit | eec1ea0ccf2a47cbfa67e2cde250e44533c0d573 (patch) | |
tree | 859fbe4efd6243e56765df50b16027b2c8707746 /source/blender/makesrna/intern/rna_sequencer_api.c | |
parent | 929d7597b345027b848c2997720e52b89c46a0ff (diff) |
VSE: Add Sequence.parent_meta() python API function
This function can be used to find metastrip parent of nested strip.
Reviewed By: ISS
Differential Revision: https://developer.blender.org/D11985
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer_api.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index d98e03785d1..7ddbf450e6a 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -124,6 +124,14 @@ static Sequence *rna_Sequence_split( return r_seq; } +static Sequence *rna_Sequence_parent_meta(ID *id, Sequence *seq_self) +{ + Scene *scene = (Scene *)id; + Editing *ed = SEQ_editing_get(scene, false); + + return SEQ_find_metastrip_by_sequence(&ed->seqbase, NULL, seq_self); +} + static Sequence *rna_Sequences_new_clip(ID *id, ListBase *seqbase, Main *bmain, @@ -702,6 +710,13 @@ void RNA_api_sequence_strip(StructRNA *srna) "Meta to move the strip into"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); + func = RNA_def_function(srna, "parent_meta", "rna_Sequence_parent_meta"); + RNA_def_function_flag(func, FUNC_USE_SELF_ID); + RNA_def_function_ui_description(func, "Parent meta"); + /* return type */ + parm = RNA_def_pointer(func, "sequence", "Sequence", "", "Parent Meta"); + RNA_def_function_return(func, parm); + 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, |