diff options
Diffstat (limited to 'source/blender/editors/transform/transform_convert_sequencer.c')
-rw-r--r-- | source/blender/editors/transform/transform_convert_sequencer.c | 80 |
1 files changed, 42 insertions, 38 deletions
diff --git a/source/blender/editors/transform/transform_convert_sequencer.c b/source/blender/editors/transform/transform_convert_sequencer.c index 3f86ef3e81b..ebb0b6823a3 100644 --- a/source/blender/editors/transform/transform_convert_sequencer.c +++ b/source/blender/editors/transform/transform_convert_sequencer.c @@ -32,7 +32,11 @@ #include "ED_markers.h" +#include "SEQ_relations.h" #include "SEQ_sequencer.h" +#include "SEQ_time.h" +#include "SEQ_transform.h" +#include "SEQ_utils.h" #include "UI_view2d.h" @@ -84,8 +88,8 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *r_recursive, int *r_c Scene *scene = t->scene; int cfra = CFRA; - int left = BKE_sequence_tx_get_final_left(seq, true); - int right = BKE_sequence_tx_get_final_right(seq, true); + int left = SEQ_transform_get_left_handle_frame(seq, true); + int right = SEQ_transform_get_right_handle_frame(seq, true); if (seq->depth == 0 && ((seq->flag & SELECT) == 0 || (seq->flag & SEQ_LOCK))) { *r_recursive = false; @@ -186,7 +190,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *r_recursive, int *r_c /* Meta's can only directly be moved between channels since they * don't have their start and length set directly (children affect that) * since this Meta is nested we don't need any of its data in fact. - * BKE_sequence_calc() will update its settings when run on the top-level meta. */ + * SEQ_time_update_sequence() will update its settings when run on the top-level meta. */ *r_flag = 0; *r_count = 0; *r_recursive = true; @@ -235,16 +239,16 @@ static TransData *SeqToTransData( /* Use seq_tx_get_final_left() and an offset here * so transform has the left hand location of the strip. * tdsq->start_offset is used when flushing the tx data back */ - start_left = BKE_sequence_tx_get_final_left(seq, false); + start_left = SEQ_transform_get_left_handle_frame(seq, false); td2d->loc[0] = start_left; tdsq->start_offset = start_left - seq->start; /* use to apply the original location */ break; case SEQ_LEFTSEL: - start_left = BKE_sequence_tx_get_final_left(seq, false); + start_left = SEQ_transform_get_left_handle_frame(seq, false); td2d->loc[0] = start_left; break; case SEQ_RIGHTSEL: - td2d->loc[0] = BKE_sequence_tx_get_final_right(seq, false); + td2d->loc[0] = SEQ_transform_get_right_handle_frame(seq, false); break; } @@ -366,7 +370,7 @@ static void SeqTransDataBounds(TransInfo *t, ListBase *seqbase, TransSeq *ts) static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data) { - Editing *ed = BKE_sequencer_editing_get(t->scene, false); + Editing *ed = SEQ_editing_get(t->scene, false); if (ed != NULL) { @@ -388,7 +392,7 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c for (a = 0; a < t->total; a++, td++) { if ((seq != seq_prev) && (seq->depth == 0) && (seq->flag & SEQ_OVERLAP)) { seq = ((TransDataSeq *)td->extra)->seq; - BKE_sequence_base_shuffle(seqbasep, seq, t->scene); + SEQ_transform_seqbase_shuffle(seqbasep, seq, t->scene); } seq_prev = seq; @@ -429,7 +433,7 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c } else { /* Tag seq with a non zero value, used by - * BKE_sequence_base_shuffle_time to identify the ones to shuffle */ + * SEQ_transform_seqbase_shuffle_time to identify the ones to shuffle */ if (seq->depth == 0) { seq->tmp = (void *)1; } @@ -455,7 +459,7 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c } } - BKE_sequence_base_shuffle_time(seqbasep, t->scene, markers, use_sync_markers); + SEQ_transform_seqbase_shuffle_time(seqbasep, t->scene, markers, use_sync_markers); for (seq = seqbasep->first; seq; seq = seq->next) { if (seq->machine >= MAXSEQ * 2) { @@ -467,10 +471,10 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c } } - BKE_sequence_base_shuffle_time(seqbasep, t->scene, markers, use_sync_markers); + SEQ_transform_seqbase_shuffle_time(seqbasep, t->scene, markers, use_sync_markers); } else { - BKE_sequence_base_shuffle_time(seqbasep, t->scene, markers, use_sync_markers); + SEQ_transform_seqbase_shuffle_time(seqbasep, t->scene, markers, use_sync_markers); } if (has_effect_any) { @@ -480,7 +484,7 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c seq = ((TransDataSeq *)td->extra)->seq; if ((seq != seq_prev)) { if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) { - BKE_sequence_calc(t->scene, seq); + SEQ_time_update_sequence(t->scene, seq); } } } @@ -493,8 +497,8 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c seq = ((TransDataSeq *)td->extra)->seq; if ((seq != seq_prev) && (seq->depth == 0)) { if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) { - if (BKE_sequence_test_overlap(seqbasep, seq)) { - BKE_sequence_base_shuffle(seqbasep, seq, t->scene); + if (SEQ_transform_test_overlap(seqbasep, seq)) { + SEQ_transform_seqbase_shuffle(seqbasep, seq, t->scene); } } } @@ -509,18 +513,18 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c /* We might want to build a list of effects that need to be updated during transform */ if (seq->type & SEQ_TYPE_EFFECT) { if (seq->seq1 && seq->seq1->flag & SELECT) { - BKE_sequence_calc(t->scene, seq); + SEQ_time_update_sequence(t->scene, seq); } else if (seq->seq2 && seq->seq2->flag & SELECT) { - BKE_sequence_calc(t->scene, seq); + SEQ_time_update_sequence(t->scene, seq); } else if (seq->seq3 && seq->seq3->flag & SELECT) { - BKE_sequence_calc(t->scene, seq); + SEQ_time_update_sequence(t->scene, seq); } } } - BKE_sequencer_sort(t->scene); + SEQ_sort(t->scene); } else { /* Canceled, need to update the strips display */ @@ -528,10 +532,10 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c seq = ((TransDataSeq *)td->extra)->seq; if ((seq != seq_prev) && (seq->depth == 0)) { if (seq->flag & SEQ_OVERLAP) { - BKE_sequence_base_shuffle(seqbasep, seq, t->scene); + SEQ_transform_seqbase_shuffle(seqbasep, seq, t->scene); } - BKE_sequence_calc_disp(t->scene, seq); + SEQ_time_update_sequence_bounds(t->scene, seq); } seq_prev = seq; } @@ -553,7 +557,7 @@ void createTransSeqData(TransInfo *t) #define XXX_DURIAN_ANIM_TX_HACK Scene *scene = t->scene; - Editing *ed = BKE_sequencer_editing_get(t->scene, false); + Editing *ed = SEQ_editing_get(t->scene, false); TransData *td = NULL; TransData2D *td2d = NULL; TransDataSeq *tdsq = NULL; @@ -640,21 +644,21 @@ BLI_INLINE void trans_update_seq(Scene *sce, Sequence *seq, int old_start, int s /* Calculate this strip and all nested strips. * Children are ALWAYS transformed first so we don't need to do this in another loop. */ - BKE_sequence_calc(sce, seq); + SEQ_time_update_sequence(sce, seq); } else { - BKE_sequence_calc_disp(sce, seq); + SEQ_time_update_sequence_bounds(sce, seq); } if (sel_flag == SELECT) { - BKE_sequencer_offset_animdata(sce, seq, seq->start - old_start); + SEQ_offset_animdata(sce, seq, seq->start - old_start); } } static void flushTransSeq(TransInfo *t) { /* Editing null check already done */ - ListBase *seqbasep = BKE_sequencer_editing_get(t->scene, false)->seqbasep; + ListBase *seqbasep = SEQ_editing_get(t->scene, false)->seqbasep; int a, new_frame; TransData *td = NULL; @@ -681,7 +685,7 @@ static void flushTransSeq(TransInfo *t) switch (tdsq->sel_flag) { case SELECT: #ifdef SEQ_TX_NESTED_METAS - if ((seq->depth != 0 || BKE_sequence_tx_test(seq))) { + if ((seq->depth != 0 || SEQ_transform_sequence_can_be_translated(seq))) { /* for meta's, their children move */ seq->start = new_frame - tdsq->start_offset; } @@ -697,18 +701,18 @@ static void flushTransSeq(TransInfo *t) } break; case SEQ_LEFTSEL: /* no vertical transform */ - BKE_sequence_tx_set_final_left(seq, new_frame); - BKE_sequence_tx_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); + SEQ_transform_set_left_handle_frame(seq, new_frame); + SEQ_transform_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); /* todo - move this into aftertrans update? - old seq tx needed it anyway */ - BKE_sequence_single_fix(seq); + SEQ_transform_fix_single_image_seq_offsets(seq); break; case SEQ_RIGHTSEL: /* no vertical transform */ - BKE_sequence_tx_set_final_right(seq, new_frame); - BKE_sequence_tx_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); + SEQ_transform_set_right_handle_frame(seq, new_frame); + SEQ_transform_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); /* todo - move this into aftertrans update? - old seq tx needed it anyway */ - BKE_sequence_single_fix(seq); + SEQ_transform_fix_single_image_seq_offsets(seq); break; } @@ -743,12 +747,12 @@ static void flushTransSeq(TransInfo *t) /* calc all meta's then effects T27953. */ for (seq = seqbasep->first; seq; seq = seq->next) { if (seq->type == SEQ_TYPE_META && seq->flag & SELECT) { - BKE_sequence_calc(t->scene, seq); + SEQ_time_update_sequence(t->scene, seq); } } for (seq = seqbasep->first; seq; seq = seq->next) { if (seq->seq1 || seq->seq2 || seq->seq3) { - BKE_sequence_calc(t->scene, seq); + SEQ_time_update_sequence(t->scene, seq); } } @@ -759,7 +763,7 @@ static void flushTransSeq(TransInfo *t) seq = tdsq->seq; if ((seq != seq_prev) && (seq->depth != 0)) { if (seq->seq1 || seq->seq2 || seq->seq3) { - BKE_sequence_calc(t->scene, seq); + SEQ_time_update_sequence(t->scene, seq); } } } @@ -777,7 +781,7 @@ static void flushTransSeq(TransInfo *t) if (seq->depth == 0) { /* test overlap, displays red outline */ seq->flag &= ~SEQ_OVERLAP; - if (BKE_sequence_test_overlap(seqbasep, seq)) { + if (SEQ_transform_test_overlap(seqbasep, seq)) { seq->flag |= SEQ_OVERLAP; } } @@ -800,7 +804,7 @@ void recalcData_sequencer(TransInfo *t) Sequence *seq = tdsq->seq; if (seq != seq_prev) { - BKE_sequence_invalidate_cache_composite(t->scene, seq); + SEQ_relations_invalidate_cache_composite(t->scene, seq); } seq_prev = seq; |