diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-08-24 01:52:24 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-08-24 01:52:24 +0300 |
commit | 709ce44617bf8c41b5bfe9a93aa58e9140323428 (patch) | |
tree | e1e4a55456a4cbd9bc147baa3d2dd74fac92d370 /source/blender/makesrna/intern/rna_sequencer_api.c | |
parent | 24a3446787d31f9b32e6759f91349b598c8e9774 (diff) |
Fix T90407: Split fails on transition strips
When splitting strips, first they are duplicated and then offsets
adjusted. This can fail on cross transitions, because some strips don't
overlap with split frame.
All strips, that relate to each other must be duplicated to ensure
correct relations after splitting, so solution is to delete non
overlapping strips from left or right side respectively.
Since cross transition don't have to overlap with source strips,
splitting such strips would lead to effect being deleted, which
could cause crash when iterating over strips in python. Therefore
splitting of such strips is now forbidden and will generate error.
Splitting of transition will also generate error solely because such
operation is illogical.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D12121
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer_api.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index 264ccccd350..d98e03785d1 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -102,13 +102,18 @@ static void rna_Sequences_move_strip_to_meta( } static Sequence *rna_Sequence_split( - ID *id, Sequence *seq, Main *bmain, int frame, int split_method) + ID *id, Sequence *seq, Main *bmain, ReportList *reports, int frame, int split_method) { Scene *scene = (Scene *)id; Editing *ed = SEQ_editing_get(scene, false); ListBase *seqbase = SEQ_get_seqbase_by_seq(&ed->seqbase, seq); - Sequence *r_seq = SEQ_edit_strip_split(bmain, scene, seqbase, seq, frame, split_method); + const char *error_msg = NULL; + Sequence *r_seq = SEQ_edit_strip_split( + bmain, scene, seqbase, seq, frame, split_method, &error_msg); + if (error_msg != NULL) { + BKE_report(reports, RPT_ERROR, error_msg); + } /* Update depsgraph. */ DEG_relations_tag_update(bmain); @@ -705,7 +710,7 @@ void RNA_api_sequence_strip(StructRNA *srna) RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); func = RNA_def_function(srna, "split", "rna_Sequence_split"); - 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); RNA_def_function_ui_description(func, "Split Sequence"); parm = RNA_def_int( func, "frame", 0, INT_MIN, INT_MAX, "", "Frame where to split the strip", INT_MIN, INT_MAX); |