diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-03-23 12:49:48 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-03-23 13:23:20 +0300 |
commit | 4e0fd7fff11b76e52a5f11ba8704028c9b3c3ab0 (patch) | |
tree | 6a6da2434db1c7f2c854b001074d8b1b9351a91c /source/blender/makesrna/intern/rna_sequencer_api.c | |
parent | d3758892987d76749fdf1211ed27ff77f39b5b3b (diff) |
VSE: Sanitize move_to_meta usage
There were multiple cases that could lead to problems like moving meta
strip into itself or into it's children meta strips.
Print error string to console when invalid action is requested.
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer_api.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index 1fb0e502ec6..a49a404fe6c 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -81,15 +81,16 @@ 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) +static void rna_Sequences_move_strip_to_meta( + ID *id, Sequence *seq_self, Main *bmain, ReportList *reports, Sequence *meta_dst) { Scene *scene = (Scene *)id; + const char *error_msg; /* Move strip to meta. */ - SEQ_edit_move_strip_to_meta(scene, seq_self, meta_dst); + if (!SEQ_edit_move_strip_to_meta(scene, seq_self, meta_dst, &error_msg)) { + BKE_report(reports, RPT_ERROR, error_msg); + } /* Update depsgraph. */ DEG_relations_tag_update(bmain); @@ -651,7 +652,7 @@ void RNA_api_sequence_strip(StructRNA *srna) 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); + RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID | FUNC_USE_MAIN); parm = RNA_def_pointer(func, "meta_sequence", "Sequence", |