Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_sequencer.c
| Show All 29 Lines | |||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "BKE_sequencer.h" | #include "BKE_sequencer.h" | ||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| #include "transform.h" | #include "transform.h" | ||||
| #include "transform_convert.h" | #include "transform_convert.h" | ||||
| #include "transform_data.h" | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Sequencer Transform Creation | /** \name Sequencer Transform Creation | ||||
| * | * | ||||
| * \{ */ | * \{ */ | ||||
| /* This function applies the rules for transforming a strip so duplicate | /* This function applies the rules for transforming a strip so duplicate | ||||
| * checks don't need to be added in multiple places. | * checks don't need to be added in multiple places. | ||||
| ▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | for (seq = seqbase->first; seq; seq = seq->next) { | ||||
| if (recursive) { | if (recursive) { | ||||
| tot += SeqTransCount(t, seq, &seq->seqbase, depth + 1); | tot += SeqTransCount(t, seq, &seq->seqbase, depth + 1); | ||||
| } | } | ||||
| } | } | ||||
| return tot; | return tot; | ||||
| } | } | ||||
| static TransData *SeqToTransData( | static int SeqToTransData(TransData2D *td2d, | ||||
| TransData *td, TransData2D *td2d, TransDataSeq *tdsq, Sequence *seq, int flag, int sel_flag) | TransDataSeq *tdsq, | ||||
| Sequence *seq, | |||||
| int flag, | |||||
| int sel_flag, | |||||
| TransData *td, | |||||
| const int tdi) | |||||
| { | { | ||||
| const float axismtx[3][3] = {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f}}; | |||||
| const float mtx_unit[3][3] = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}}; | |||||
| int start_left; | int start_left; | ||||
| switch (sel_flag) { | switch (sel_flag) { | ||||
| case SELECT: | case SELECT: | ||||
| /* Use seq_tx_get_final_left() and an offset here | /* Use seq_tx_get_final_left() and an offset here | ||||
| * so transform has the left hand location of the strip. | * so transform has the left hand location of the strip. | ||||
| * tdsq->start_offset is used when flushing the tx data back */ | * tdsq->start_offset is used when flushing the tx data back */ | ||||
| start_left = BKE_sequence_tx_get_final_left(seq, false); | start_left = BKE_sequence_tx_get_final_left(seq, false); | ||||
| Show All 15 Lines | static int SeqToTransData(TransData2D *td2d, | ||||
| tdsq->seq = seq; | tdsq->seq = seq; | ||||
| /* Use instead of seq->flag for nested strips and other | /* Use instead of seq->flag for nested strips and other | ||||
| * cases where the selection may need to be modified */ | * cases where the selection may need to be modified */ | ||||
| tdsq->flag = flag; | tdsq->flag = flag; | ||||
| tdsq->sel_flag = sel_flag; | tdsq->sel_flag = sel_flag; | ||||
| td->extra = (void *)tdsq; /* allow us to update the strip from here */ | /* allow us to update the strip from here */ | ||||
| td->basic[tdi].extra = tdsq; | |||||
| td->flag = 0; | td->basic[tdi].loc = td2d->loc; | ||||
| td->loc = td2d->loc; | copy_v3_v3(td->basic[tdi].iloc, td2d->loc); | ||||
| copy_v3_v3(td->center, td->loc); | copy_v3_v3(td->center[tdi], td2d->loc); | ||||
| copy_v3_v3(td->iloc, td->loc); | copy_m3_m3(td->space[tdi].mtx, mtx_unit); | ||||
| copy_m3_m3(td->space[tdi].smtx, mtx_unit); | |||||
| memset(td->axismtx, 0, sizeof(td->axismtx)); | copy_m3_m3(td->space[tdi].axismtx, axismtx); | ||||
| td->axismtx[2][2] = 1.0f; | |||||
| td->ext = NULL; | |||||
| td->val = NULL; | |||||
| td->flag |= TD_SELECTED; | |||||
| td->dist = 0.0; | |||||
| unit_m3(td->mtx); | |||||
| unit_m3(td->smtx); | |||||
| /* Time Transform (extend) */ | /* Time Transform (extend) */ | ||||
| td->val = td2d->loc; | td->special[tdi].val = td2d->loc; | ||||
| td->ival = td2d->loc[0]; | td->special[tdi].ival = td2d->loc[0]; | ||||
| return td; | td->basic[tdi].flag |= TD_SELECTED; | ||||
| return tdi; | |||||
| } | } | ||||
| static int SeqToTransData_Recursive( | static int SeqToTransData_Recursive( | ||||
| TransInfo *t, ListBase *seqbase, TransData *td, TransData2D *td2d, TransDataSeq *tdsq) | TransInfo *t, ListBase *seqbase, TransData2D *td2d, TransDataSeq *tdsq, TransData *td, int tdi) | ||||
| { | { | ||||
| Sequence *seq; | Sequence *seq; | ||||
| int recursive, count, flag; | int recursive, count, flag; | ||||
| int tot = 0; | int tot = 0; | ||||
| for (seq = seqbase->first; seq; seq = seq->next) { | for (seq = seqbase->first; seq; seq = seq->next) { | ||||
| SeqTransInfo(t, seq, &recursive, &count, &flag); | SeqTransInfo(t, seq, &recursive, &count, &flag); | ||||
| /* add children first so recalculating metastrips does nested strips first */ | /* add children first so recalculating metastrips does nested strips first */ | ||||
| if (recursive) { | if (recursive) { | ||||
| int tot_children = SeqToTransData_Recursive(t, &seq->seqbase, td, td2d, tdsq); | int tot_children = SeqToTransData_Recursive(t, &seq->seqbase, td2d, tdsq, td, tdi); | ||||
| td = td + tot_children; | tdi += tot_children; | ||||
| td2d = td2d + tot_children; | td2d = td2d + tot_children; | ||||
| tdsq = tdsq + tot_children; | tdsq = tdsq + tot_children; | ||||
| tot += tot_children; | tot += tot_children; | ||||
| } | } | ||||
| /* use 'flag' which is derived from seq->flag but modified for special cases */ | /* use 'flag' which is derived from seq->flag but modified for special cases */ | ||||
| if (flag & SELECT) { | if (flag & SELECT) { | ||||
| if (flag & (SEQ_LEFTSEL | SEQ_RIGHTSEL)) { | if (flag & (SEQ_LEFTSEL | SEQ_RIGHTSEL)) { | ||||
| if (flag & SEQ_LEFTSEL) { | if (flag & SEQ_LEFTSEL) { | ||||
| SeqToTransData(td++, td2d++, tdsq++, seq, flag, SEQ_LEFTSEL); | SeqToTransData(td2d++, tdsq++, seq, flag, SEQ_LEFTSEL, td, tdi); | ||||
| tdi++; | |||||
| tot++; | tot++; | ||||
| } | } | ||||
| if (flag & SEQ_RIGHTSEL) { | if (flag & SEQ_RIGHTSEL) { | ||||
| SeqToTransData(td++, td2d++, tdsq++, seq, flag, SEQ_RIGHTSEL); | SeqToTransData(td2d++, tdsq++, seq, flag, SEQ_RIGHTSEL, td, tdi); | ||||
| tdi++; | |||||
| tot++; | tot++; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| SeqToTransData(td++, td2d++, tdsq++, seq, flag, SELECT); | SeqToTransData(td2d++, tdsq++, seq, flag, SELECT, td, tdi); | ||||
| tdi++; | |||||
| tot++; | tot++; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return tot; | return tot; | ||||
| } | } | ||||
| static void SeqTransDataBounds(TransInfo *t, ListBase *seqbase, TransSeq *ts) | static void SeqTransDataBounds(TransInfo *t, ListBase *seqbase, TransSeq *ts) | ||||
| Show All 35 Lines | |||||
| static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data) | static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data) | ||||
| { | { | ||||
| Editing *ed = BKE_sequencer_editing_get(t->scene, false); | Editing *ed = BKE_sequencer_editing_get(t->scene, false); | ||||
| if (ed != NULL) { | if (ed != NULL) { | ||||
| ListBase *seqbasep = ed->seqbasep; | ListBase *seqbasep = ed->seqbasep; | ||||
| TransData *td = tc->data; | TransData *td = tc->data; | ||||
| int a; | int tdi; | ||||
| /* prevent updating the same seq twice | /* prevent updating the same seq twice | ||||
| * if the transdata order is changed this will mess up | * if the transdata order is changed this will mess up | ||||
| * but so will TransDataSeq */ | * but so will TransDataSeq */ | ||||
| Sequence *seq_prev = NULL; | Sequence *seq_prev = NULL; | ||||
| Sequence *seq; | Sequence *seq; | ||||
| if (!(t->state == TRANS_CANCEL)) { | if (!(t->state == TRANS_CANCEL)) { | ||||
| #if 0 // default 2.4 behavior | #if 0 // default 2.4 behavior | ||||
| /* flush to 2d vector from internally used 3d vector */ | /* flush to 2d vector from internally used 3d vector */ | ||||
| for (a = 0; a < t->total; a++, td++) { | for (tdi = 0; tdi < t->total; tdi++) { | ||||
| if ((seq != seq_prev) && (seq->depth == 0) && (seq->flag & SEQ_OVERLAP)) { | if ((seq != seq_prev) && (seq->depth == 0) && (seq->flag & SEQ_OVERLAP)) { | ||||
| seq = ((TransDataSeq *)td->extra)->seq; | seq = ((TransDataSeq *)td->basic[tdi].extra)->seq; | ||||
| BKE_sequence_base_shuffle(seqbasep, seq, t->scene); | BKE_sequence_base_shuffle(seqbasep, seq, t->scene); | ||||
| } | } | ||||
| seq_prev = seq; | seq_prev = seq; | ||||
| } | } | ||||
| #else // durian hack | #else // durian hack | ||||
| { | { | ||||
| int overlap = 0; | int overlap = 0; | ||||
| for (a = 0, seq_prev = NULL; a < tc->data_len; a++, td++, seq_prev = seq) { | for (tdi = 0, seq_prev = NULL; tdi < tc->data_len; tdi++, seq_prev = seq) { | ||||
| seq = ((TransDataSeq *)td->extra)->seq; | seq = ((TransDataSeq *)td->basic[tdi].extra)->seq; | ||||
| if ((seq != seq_prev) && (seq->depth == 0) && (seq->flag & SEQ_OVERLAP)) { | if ((seq != seq_prev) && (seq->depth == 0) && (seq->flag & SEQ_OVERLAP)) { | ||||
| overlap = 1; | overlap = 1; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| if (overlap) { | if (overlap) { | ||||
| const bool use_sync_markers = (((SpaceSeq *)t->area->spacedata.first)->flag & | const bool use_sync_markers = (((SpaceSeq *)t->area->spacedata.first)->flag & | ||||
| SEQ_MARKER_TRANS) != 0; | SEQ_MARKER_TRANS) != 0; | ||||
| ListBase *markers = &t->scene->markers; | ListBase *markers = &t->scene->markers; | ||||
| bool has_effect_root = false, has_effect_any = false; | bool has_effect_root = false, has_effect_any = false; | ||||
| for (seq = seqbasep->first; seq; seq = seq->next) { | for (seq = seqbasep->first; seq; seq = seq->next) { | ||||
| seq->tmp = NULL; | seq->tmp = NULL; | ||||
| } | } | ||||
| td = tc->data; | for (tdi = 0, seq_prev = NULL; tdi < tc->data_len; tdi++, seq_prev = seq) { | ||||
| for (a = 0, seq_prev = NULL; a < tc->data_len; a++, td++, seq_prev = seq) { | seq = ((TransDataSeq *)td->basic[tdi].extra)->seq; | ||||
| seq = ((TransDataSeq *)td->extra)->seq; | |||||
| if ((seq != seq_prev)) { | if ((seq != seq_prev)) { | ||||
| /* check effects strips, we cant change their time */ | /* check effects strips, we cant change their time */ | ||||
| if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) { | if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) { | ||||
| has_effect_any = true; | has_effect_any = true; | ||||
| if (seq->depth == 0) { | if (seq->depth == 0) { | ||||
| has_effect_root = true; | has_effect_root = true; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* Tag seq with a non zero value, used by | /* Tag seq with a non zero value, used by | ||||
| * BKE_sequence_base_shuffle_time to identify the ones to shuffle */ | * BKE_sequence_base_shuffle_time to identify the ones to shuffle */ | ||||
| if (seq->depth == 0) { | if (seq->depth == 0) { | ||||
| seq->tmp = (void *)1; | seq->tmp = (void *)1; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (t->flag & T_ALT_TRANSFORM) { | if (t->flag & T_ALT_TRANSFORM) { | ||||
| int minframe = MAXFRAME; | int minframe = MAXFRAME; | ||||
| td = tc->data; | for (tdi = 0, seq_prev = NULL; tdi < tc->data_len; tdi++, seq_prev = seq) { | ||||
| for (a = 0, seq_prev = NULL; a < tc->data_len; a++, td++, seq_prev = seq) { | seq = ((TransDataSeq *)td->basic[tdi].extra)->seq; | ||||
| seq = ((TransDataSeq *)td->extra)->seq; | |||||
| if ((seq != seq_prev) && (seq->depth == 0)) { | if ((seq != seq_prev) && (seq->depth == 0)) { | ||||
| minframe = min_ii(minframe, seq->startdisp); | minframe = min_ii(minframe, seq->startdisp); | ||||
| } | } | ||||
| } | } | ||||
| for (seq = seqbasep->first; seq; seq = seq->next) { | for (seq = seqbasep->first; seq; seq = seq->next) { | ||||
| if (!(seq->flag & SELECT)) { | if (!(seq->flag & SELECT)) { | ||||
| if (seq->startdisp >= minframe) { | if (seq->startdisp >= minframe) { | ||||
| Show All 17 Lines | #else // durian hack | ||||
| BKE_sequence_base_shuffle_time(seqbasep, t->scene, markers, use_sync_markers); | BKE_sequence_base_shuffle_time(seqbasep, t->scene, markers, use_sync_markers); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_sequence_base_shuffle_time(seqbasep, t->scene, markers, use_sync_markers); | BKE_sequence_base_shuffle_time(seqbasep, t->scene, markers, use_sync_markers); | ||||
| } | } | ||||
| if (has_effect_any) { | if (has_effect_any) { | ||||
| /* update effects strips based on strips just moved in time */ | /* update effects strips based on strips just moved in time */ | ||||
| td = tc->data; | for (tdi = 0, seq_prev = NULL; tdi < tc->data_len; tdi++, seq_prev = seq) { | ||||
| for (a = 0, seq_prev = NULL; a < tc->data_len; a++, td++, seq_prev = seq) { | seq = ((TransDataSeq *)td->basic[tdi].extra)->seq; | ||||
| seq = ((TransDataSeq *)td->extra)->seq; | |||||
| if ((seq != seq_prev)) { | if ((seq != seq_prev)) { | ||||
| if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) { | if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) { | ||||
| BKE_sequence_calc(t->scene, seq); | BKE_sequence_calc(t->scene, seq); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (has_effect_root) { | if (has_effect_root) { | ||||
| /* now if any effects _still_ overlap, we need to move them up */ | /* now if any effects _still_ overlap, we need to move them up */ | ||||
| td = tc->data; | for (tdi = 0, seq_prev = NULL; tdi < tc->data_len; tdi++, seq_prev = seq) { | ||||
| for (a = 0, seq_prev = NULL; a < tc->data_len; a++, td++, seq_prev = seq) { | seq = ((TransDataSeq *)td->basic[tdi].extra)->seq; | ||||
| seq = ((TransDataSeq *)td->extra)->seq; | |||||
| if ((seq != seq_prev) && (seq->depth == 0)) { | if ((seq != seq_prev) && (seq->depth == 0)) { | ||||
| if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) { | if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) { | ||||
| if (BKE_sequence_test_overlap(seqbasep, seq)) { | if (BKE_sequence_test_overlap(seqbasep, seq)) { | ||||
| BKE_sequence_base_shuffle(seqbasep, seq, t->scene); | BKE_sequence_base_shuffle(seqbasep, seq, t->scene); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| Show All 17 Lines | #endif | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| BKE_sequencer_sort(t->scene); | BKE_sequencer_sort(t->scene); | ||||
| } | } | ||||
| else { | else { | ||||
| /* Canceled, need to update the strips display */ | /* Canceled, need to update the strips display */ | ||||
| for (a = 0; a < tc->data_len; a++, td++) { | for (tdi = 0; tdi < tc->data_len; tdi++) { | ||||
| seq = ((TransDataSeq *)td->extra)->seq; | seq = ((TransDataSeq *)td->basic[tdi].extra)->seq; | ||||
| if ((seq != seq_prev) && (seq->depth == 0)) { | if ((seq != seq_prev) && (seq->depth == 0)) { | ||||
| if (seq->flag & SEQ_OVERLAP) { | if (seq->flag & SEQ_OVERLAP) { | ||||
| BKE_sequence_base_shuffle(seqbasep, seq, t->scene); | BKE_sequence_base_shuffle(seqbasep, seq, t->scene); | ||||
| } | } | ||||
| BKE_sequence_calc_disp(t->scene, seq); | BKE_sequence_calc_disp(t->scene, seq); | ||||
| } | } | ||||
| seq_prev = seq; | seq_prev = seq; | ||||
| Show All 12 Lines | |||||
| } | } | ||||
| void createTransSeqData(TransInfo *t) | void createTransSeqData(TransInfo *t) | ||||
| { | { | ||||
| #define XXX_DURIAN_ANIM_TX_HACK | #define XXX_DURIAN_ANIM_TX_HACK | ||||
| Scene *scene = t->scene; | Scene *scene = t->scene; | ||||
| Editing *ed = BKE_sequencer_editing_get(t->scene, false); | Editing *ed = BKE_sequencer_editing_get(t->scene, false); | ||||
| TransData *td = NULL; | |||||
| TransData2D *td2d = NULL; | TransData2D *td2d = NULL; | ||||
| TransDataSeq *tdsq = NULL; | TransDataSeq *tdsq = NULL; | ||||
| TransSeq *ts = NULL; | TransSeq *ts = NULL; | ||||
| int count = 0; | int count = 0; | ||||
| TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | ||||
| Show All 32 Lines | #endif | ||||
| /* stop if trying to build list if nothing selected */ | /* stop if trying to build list if nothing selected */ | ||||
| if (count == 0) { | if (count == 0) { | ||||
| return; | return; | ||||
| } | } | ||||
| tc->custom.type.data = ts = MEM_callocN(sizeof(TransSeq), "transseq"); | tc->custom.type.data = ts = MEM_callocN(sizeof(TransSeq), "transseq"); | ||||
| tc->custom.type.use_free = true; | tc->custom.type.use_free = true; | ||||
| td = tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransSeq TransData"); | |||||
| TransData *td = tc->data = transform_data_alloc(tc->data_len, TD_BASIC_COMP); | |||||
| td2d = tc->data_2d = MEM_callocN(tc->data_len * sizeof(TransData2D), "TransSeq TransData2D"); | td2d = tc->data_2d = MEM_callocN(tc->data_len * sizeof(TransData2D), "TransSeq TransData2D"); | ||||
| ts->tdseq = tdsq = MEM_callocN(tc->data_len * sizeof(TransDataSeq), "TransSeq TransDataSeq"); | ts->tdseq = tdsq = MEM_callocN(tc->data_len * sizeof(TransDataSeq), "TransSeq TransDataSeq"); | ||||
| /* loop 2: build transdata array */ | /* loop 2: build transdata array */ | ||||
| SeqToTransData_Recursive(t, ed->seqbasep, td, td2d, tdsq); | const int tdi = 0; | ||||
| SeqToTransData_Recursive(t, ed->seqbasep, td2d, tdsq, td, tdi); | |||||
| SeqTransDataBounds(t, ed->seqbasep, ts); | SeqTransDataBounds(t, ed->seqbasep, ts); | ||||
| if (t->flag & T_MODAL) { | if (t->flag & T_MODAL) { | ||||
| /* set the snap mode based on how close the mouse is at the end/start points */ | /* set the snap mode based on how close the mouse is at the end/start points */ | ||||
| int xmouse = (int)UI_view2d_region_to_view_x((View2D *)t->view, t->mouse.imval[0]); | int xmouse = (int)UI_view2d_region_to_view_x((View2D *)t->view, t->mouse.imval[0]); | ||||
| if (abs(xmouse - ts->max) > abs(xmouse - ts->min)) { | if (abs(xmouse - ts->max) > abs(xmouse - ts->min)) { | ||||
| ts->snap_left = true; | ts->snap_left = true; | ||||
| } | } | ||||
| Show All 31 Lines | BLI_INLINE void trans_update_seq(Scene *sce, Sequence *seq, int old_start, int sel_flag) | ||||
| } | } | ||||
| } | } | ||||
| void flushTransSeq(TransInfo *t) | void flushTransSeq(TransInfo *t) | ||||
| { | { | ||||
| /* Editing null check already done */ | /* Editing null check already done */ | ||||
| ListBase *seqbasep = BKE_sequencer_editing_get(t->scene, false)->seqbasep; | ListBase *seqbasep = BKE_sequencer_editing_get(t->scene, false)->seqbasep; | ||||
| int a, new_frame; | int tdi, new_frame; | ||||
| TransData *td = NULL; | |||||
| TransData2D *td2d = NULL; | TransData2D *td2d = NULL; | ||||
| TransDataSeq *tdsq = NULL; | TransDataSeq *tdsq = NULL; | ||||
| Sequence *seq; | Sequence *seq; | ||||
| TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | ||||
| /* prevent updating the same seq twice | /* prevent updating the same seq twice | ||||
| * if the transdata order is changed this will mess up | * if the transdata order is changed this will mess up | ||||
| * but so will TransDataSeq */ | * but so will TransDataSeq */ | ||||
| Sequence *seq_prev = NULL; | Sequence *seq_prev = NULL; | ||||
| int old_start_prev = 0, sel_flag_prev = 0; | int old_start_prev = 0, sel_flag_prev = 0; | ||||
| /* flush to 2d vector from internally used 3d vector */ | /* flush to 2d vector from internally used 3d vector */ | ||||
| for (a = 0, td = tc->data, td2d = tc->data_2d; a < tc->data_len; a++, td++, td2d++) { | TransData *td = tc->data; | ||||
| for (tdi = 0, td2d = tc->data_2d; tdi < tc->data_len; td2d++, tdi++) { | |||||
| int old_start; | int old_start; | ||||
| tdsq = (TransDataSeq *)td->extra; | tdsq = (TransDataSeq *)td->basic[tdi].extra; | ||||
| seq = tdsq->seq; | seq = tdsq->seq; | ||||
| old_start = seq->start; | old_start = seq->start; | ||||
| new_frame = round_fl_to_int(td2d->loc[0]); | new_frame = round_fl_to_int(td2d->loc[0]); | ||||
| switch (tdsq->sel_flag) { | switch (tdsq->sel_flag) { | ||||
| case SELECT: | case SELECT: | ||||
| #ifdef SEQ_TX_NESTED_METAS | #ifdef SEQ_TX_NESTED_METAS | ||||
| if ((seq->depth != 0 || BKE_sequence_tx_test(seq))) { | if ((seq->depth != 0 || BKE_sequence_tx_test(seq))) { | ||||
| ▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | if (ELEM(t->mode, TFM_SEQ_SLIDE, TFM_TIME_TRANSLATE)) { | ||||
| } | } | ||||
| for (seq = seqbasep->first; seq; seq = seq->next) { | for (seq = seqbasep->first; seq; seq = seq->next) { | ||||
| if (seq->seq1 || seq->seq2 || seq->seq3) { | if (seq->seq1 || seq->seq2 || seq->seq3) { | ||||
| BKE_sequence_calc(t->scene, seq); | BKE_sequence_calc(t->scene, seq); | ||||
| } | } | ||||
| } | } | ||||
| /* update effects inside meta's */ | /* update effects inside meta's */ | ||||
| for (a = 0, seq_prev = NULL, td = tc->data, td2d = tc->data_2d; a < tc->data_len; | for (tdi = 0, seq_prev = NULL, td2d = tc->data_2d; tdi < tc->data_len; | ||||
| a++, td++, td2d++, seq_prev = seq) { | td2d++, tdi++, seq_prev = seq) { | ||||
| tdsq = (TransDataSeq *)td->extra; | tdsq = (TransDataSeq *)td->basic[tdi].extra; | ||||
| seq = tdsq->seq; | seq = tdsq->seq; | ||||
| if ((seq != seq_prev) && (seq->depth != 0)) { | if ((seq != seq_prev) && (seq->depth != 0)) { | ||||
| if (seq->seq1 || seq->seq2 || seq->seq3) { | if (seq->seq1 || seq->seq2 || seq->seq3) { | ||||
| BKE_sequence_calc(t->scene, seq); | BKE_sequence_calc(t->scene, seq); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* need to do the overlap check in a new loop otherwise adjacent strips | /* need to do the overlap check in a new loop otherwise adjacent strips | ||||
| * will not be updated and we'll get false positives */ | * will not be updated and we'll get false positives */ | ||||
| seq_prev = NULL; | seq_prev = NULL; | ||||
| for (a = 0, td = tc->data, td2d = tc->data_2d; a < tc->data_len; a++, td++, td2d++) { | for (tdi = 0, td2d = tc->data_2d; tdi < tc->data_len; td2d++, tdi++) { | ||||
| tdsq = (TransDataSeq *)td->basic[tdi].extra; | |||||
| tdsq = (TransDataSeq *)td->extra; | |||||
| seq = tdsq->seq; | seq = tdsq->seq; | ||||
| if (seq != seq_prev) { | if (seq != seq_prev) { | ||||
| if (seq->depth == 0) { | if (seq->depth == 0) { | ||||
| /* test overlap, displays red outline */ | /* test overlap, displays red outline */ | ||||
| seq->flag &= ~SEQ_OVERLAP; | seq->flag &= ~SEQ_OVERLAP; | ||||
| if (BKE_sequence_test_overlap(seqbasep, seq)) { | if (BKE_sequence_test_overlap(seqbasep, seq)) { | ||||
| seq->flag |= SEQ_OVERLAP; | seq->flag |= SEQ_OVERLAP; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| seq_prev = seq; | seq_prev = seq; | ||||
| } | } | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||