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(scene, seq, false); | ||||
| int right = SEQ_transform_get_right_handle_frame(seq, false); | int right = SEQ_transform_get_right_handle_frame(scene, seq, false); | ||||
| 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 88 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 TransData *SeqToTransData(TransData *td, | ||||
| TransData *td, TransData2D *td2d, TransDataSeq *tdsq, Sequence *seq, int flag, int sel_flag) | TransData2D *td2d, | ||||
| TransDataSeq *tdsq, | |||||
| Scene *scene, | |||||
| 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(scene, seq, false); | ||||
| 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(scene, seq, false); | ||||
| 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(scene, seq, false); | ||||
| 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 50 Lines • ▼ Show 20 Lines | if (recursive) { | ||||
| 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(td++, td2d++, tdsq++, t->scene, seq, flag, SEQ_LEFTSEL); | ||||
| tot++; | tot++; | ||||
| } | } | ||||
| if (flag & SEQ_RIGHTSEL) { | if (flag & SEQ_RIGHTSEL) { | ||||
| SeqToTransData(td++, td2d++, tdsq++, seq, flag, SEQ_RIGHTSEL); | SeqToTransData(td++, td2d++, tdsq++, t->scene, seq, flag, SEQ_RIGHTSEL); | ||||
| tot++; | tot++; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| SeqToTransData(td++, td2d++, tdsq++, seq, flag, SELECT); | SeqToTransData(td++, td2d++, tdsq++, t->scene, seq, flag, SELECT); | ||||
| 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 20 Lines • Show All 358 Lines • ▼ Show 20 Lines | switch (tdsq->sel_flag) { | ||||
| seq->start = new_frame - tdsq->start_offset; | seq->start = new_frame - tdsq->start_offset; | ||||
| } | } | ||||
| if (seq->depth == 0) { | if (seq->depth == 0) { | ||||
| seq->machine = round_fl_to_int(td2d->loc[1]); | seq->machine = round_fl_to_int(td2d->loc[1]); | ||||
| CLAMP(seq->machine, 1, MAXSEQ); | CLAMP(seq->machine, 1, MAXSEQ); | ||||
| } | } | ||||
| break; | break; | ||||
| case SEQ_LEFTSEL: /* no vertical transform */ | case SEQ_LEFTSEL: /* no vertical transform */ | ||||
| SEQ_transform_set_left_handle_frame(seq, new_frame); | SEQ_transform_set_left_handle_frame(t->scene, seq, new_frame); | ||||
| SEQ_transform_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); | SEQ_transform_handle_xlimits( | ||||
| t->scene, seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); | |||||
| /* todo - move this into aftertrans update? - old seq tx needed it anyway */ | /* todo - move this into aftertrans update? - old seq tx needed it anyway */ | ||||
| SEQ_transform_fix_single_image_seq_offsets(seq); | SEQ_transform_fix_single_image_seq_offsets(t->scene, seq); | ||||
| break; | break; | ||||
| case SEQ_RIGHTSEL: /* no vertical transform */ | case SEQ_RIGHTSEL: /* no vertical transform */ | ||||
| SEQ_transform_set_right_handle_frame(seq, new_frame); | SEQ_transform_set_right_handle_frame(t->scene, seq, new_frame); | ||||
| SEQ_transform_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); | SEQ_transform_handle_xlimits( | ||||
| t->scene, seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); | |||||
| /* todo - move this into aftertrans update? - old seq tx needed it anyway */ | /* todo - move this into aftertrans update? - old seq tx needed it anyway */ | ||||
| SEQ_transform_fix_single_image_seq_offsets(seq); | SEQ_transform_fix_single_image_seq_offsets(t->scene, seq); | ||||
| break; | break; | ||||
| } | } | ||||
| /* Update *previous* seq! Else, we would update a seq after its first transform, | /* Update *previous* seq! Else, we would update a seq after its first transform, | ||||
| * and if it has more than one (like e.g. SEQ_LEFTSEL and SEQ_RIGHTSEL), | * and if it has more than one (like e.g. SEQ_LEFTSEL and SEQ_RIGHTSEL), | ||||
| * the others are not updated! See T38469. | * the others are not updated! See T38469. | ||||
| */ | */ | ||||
| if (seq != seq_prev) { | if (seq != seq_prev) { | ||||
| ▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines | |||||