Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_sequencer.c
| Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| /* for extend we need to do some tricks */ | /* for extend we need to do some tricks */ | ||||
| if (t->mode == TFM_TIME_EXTEND) { | if (t->mode == TFM_TIME_EXTEND) { | ||||
| /* *** Extend Transform *** */ | /* *** Extend Transform *** */ | ||||
| Scene *scene = t->scene; | Scene *scene = t->scene; | ||||
| int cfra = CFRA; | int cfra = CFRA; | ||||
| int left = SEQ_transform_get_left_handle_frame(seq, false); | int left = SEQ_transform_get_left_handle_frame(seq); | ||||
| int right = SEQ_transform_get_right_handle_frame(seq, false); | int right = SEQ_transform_get_right_handle_frame(seq); | ||||
| if (seq->depth == 0 && ((seq->flag & SELECT) == 0 || (seq->flag & SEQ_LOCK))) { | if (seq->depth == 0 && ((seq->flag & SELECT) == 0 || (seq->flag & SEQ_LOCK))) { | ||||
| *r_recursive = false; | *r_recursive = false; | ||||
| *r_count = 0; | *r_count = 0; | ||||
| *r_flag = 0; | *r_flag = 0; | ||||
| } | } | ||||
| else { | else { | ||||
| *r_recursive = false; | *r_recursive = false; | ||||
| ▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
| static int SeqTransCount(TransInfo *t, Sequence *parent, ListBase *seqbase, int depth) | static int SeqTransCount(TransInfo *t, Sequence *parent, ListBase *seqbase, int depth) | ||||
| { | { | ||||
| Sequence *seq; | Sequence *seq; | ||||
| int tot = 0, recursive, count, flag; | int tot = 0, recursive, count, flag; | ||||
| for (seq = seqbase->first; seq; seq = seq->next) { | for (seq = seqbase->first; seq; seq = seq->next) { | ||||
| seq->depth = depth; | seq->depth = depth; | ||||
| /* 'seq->tmp' is used by seq_tx_get_final_{left, right} | |||||
| * to check sequence's range and clamp to it if needed. | |||||
| * It's first place where digging into sequences tree, so store link to parent here. */ | |||||
| seq->tmp = parent; | |||||
| SeqTransInfo(t, seq, &recursive, &count, &flag); /* ignore the flag */ | SeqTransInfo(t, seq, &recursive, &count, &flag); /* ignore the flag */ | ||||
| tot += count; | tot += count; | ||||
| 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 TransData *SeqToTransData( | ||||
| TransData *td, TransData2D *td2d, TransDataSeq *tdsq, Sequence *seq, int flag, int sel_flag) | TransData *td, TransData2D *td2d, TransDataSeq *tdsq, Sequence *seq, int flag, int sel_flag) | ||||
| { | { | ||||
| 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 = SEQ_transform_get_left_handle_frame(seq, false); | start_left = SEQ_transform_get_left_handle_frame(seq); | ||||
| td2d->loc[0] = start_left; | td2d->loc[0] = start_left; | ||||
| tdsq->start_offset = start_left - seq->start; /* use to apply the original location */ | tdsq->start_offset = start_left - seq->start; /* use to apply the original location */ | ||||
| break; | break; | ||||
| case SEQ_LEFTSEL: | case SEQ_LEFTSEL: | ||||
| start_left = SEQ_transform_get_left_handle_frame(seq, false); | start_left = SEQ_transform_get_left_handle_frame(seq); | ||||
| td2d->loc[0] = start_left; | td2d->loc[0] = start_left; | ||||
| break; | break; | ||||
| case SEQ_RIGHTSEL: | case SEQ_RIGHTSEL: | ||||
| td2d->loc[0] = SEQ_transform_get_right_handle_frame(seq, false); | td2d->loc[0] = SEQ_transform_get_right_handle_frame(seq); | ||||
| break; | break; | ||||
| } | } | ||||
| td2d->loc[1] = seq->machine; /* channel - Y location */ | td2d->loc[1] = seq->machine; /* channel - Y location */ | ||||
| td2d->loc[2] = 0.0f; | td2d->loc[2] = 0.0f; | ||||
| td2d->loc2d = NULL; | td2d->loc2d = NULL; | ||||
| tdsq->seq = seq; | tdsq->seq = seq; | ||||
| ▲ Show 20 Lines • Show All 613 Lines • Show Last 20 Lines | |||||