Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_sequencer.c
| Show First 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | static void seq_transform_cancel(TransInfo *t, SeqCollection *transformed_strips) | ||||
| Sequence *seq; | Sequence *seq; | ||||
| SEQ_ITERATOR_FOREACH (seq, transformed_strips) { | SEQ_ITERATOR_FOREACH (seq, transformed_strips) { | ||||
| /* Handle pre-existing overlapping strips even when operator is canceled. | /* Handle pre-existing overlapping strips even when operator is canceled. | ||||
| * This is necessary for SEQUENCER_OT_duplicate_move macro for example. */ | * This is necessary for SEQUENCER_OT_duplicate_move macro for example. */ | ||||
| if (SEQ_transform_test_overlap(seqbase, seq)) { | if (SEQ_transform_test_overlap(seqbase, seq)) { | ||||
| SEQ_transform_seqbase_shuffle(seqbase, seq, t->scene); | SEQ_transform_seqbase_shuffle(seqbase, seq, t->scene); | ||||
| } | } | ||||
| SEQ_time_update_sequence_bounds(t->scene, seq); | SEQ_time_update_sequence(t->scene, seqbase, seq); | ||||
| } | } | ||||
| } | } | ||||
| static bool seq_transform_check_overlap(SeqCollection *transformed_strips) | static bool seq_transform_check_overlap(SeqCollection *transformed_strips) | ||||
| { | { | ||||
| Sequence *seq; | Sequence *seq; | ||||
| SEQ_ITERATOR_FOREACH (seq, transformed_strips) { | SEQ_ITERATOR_FOREACH (seq, transformed_strips) { | ||||
| if (seq->flag & SEQ_OVERLAP) { | if (seq->flag & SEQ_OVERLAP) { | ||||
| Show All 35 Lines | static SeqCollection *query_right_side_strips(ListBase *seqbase, SeqCollection *transformed_strips) | ||||
| return collection; | return collection; | ||||
| } | } | ||||
| static void seq_transform_update_effects(TransInfo *t, SeqCollection *collection) | static void seq_transform_update_effects(TransInfo *t, SeqCollection *collection) | ||||
| { | { | ||||
| Sequence *seq; | Sequence *seq; | ||||
| SEQ_ITERATOR_FOREACH (seq, collection) { | SEQ_ITERATOR_FOREACH (seq, collection) { | ||||
| if ((seq->type & SEQ_TYPE_EFFECT) && (seq->seq1 || seq->seq2 || seq->seq3)) { | if ((seq->type & SEQ_TYPE_EFFECT) && (seq->seq1 || seq->seq2 || seq->seq3)) { | ||||
| SEQ_time_update_sequence(t->scene, seq); | ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(t->scene)); | ||||
| SEQ_time_update_sequence(t->scene, seqbase, seq); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Check if effect strips with input are transformed. */ | /* Check if effect strips with input are transformed. */ | ||||
| static bool seq_transform_check_strip_effects(SeqCollection *transformed_strips) | static bool seq_transform_check_strip_effects(SeqCollection *transformed_strips) | ||||
| { | { | ||||
| Sequence *seq; | Sequence *seq; | ||||
| ▲ Show 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | SEQ_ITERATOR_FOREACH (seq, targets) { | ||||
| } | } | ||||
| if (overlap == STRIP_OVERLAP_LEFT_SIDE) { | if (overlap == STRIP_OVERLAP_LEFT_SIDE) { | ||||
| SEQ_transform_set_left_handle_frame(seq, transformed->enddisp); | SEQ_transform_set_left_handle_frame(seq, transformed->enddisp); | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_assert(overlap == STRIP_OVERLAP_RIGHT_SIDE); | BLI_assert(overlap == STRIP_OVERLAP_RIGHT_SIDE); | ||||
| SEQ_transform_set_right_handle_frame(seq, transformed->startdisp); | SEQ_transform_set_right_handle_frame(seq, transformed->startdisp); | ||||
| } | } | ||||
| SEQ_time_update_sequence(t->scene, seq); | |||||
| ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(t->scene)); | |||||
| SEQ_time_update_sequence(t->scene, seqbase, seq); | |||||
| } | } | ||||
| SEQ_collection_free(targets); | SEQ_collection_free(targets); | ||||
| } | } | ||||
| static void seq_transform_handle_overwrite(const TransInfo *t, SeqCollection *transformed_strips) | static void seq_transform_handle_overwrite(const TransInfo *t, SeqCollection *transformed_strips) | ||||
| { | { | ||||
| SeqCollection *targets = query_overwrite_targets(t, transformed_strips); | SeqCollection *targets = query_overwrite_targets(t, transformed_strips); | ||||
| ▲ Show 20 Lines • Show All 200 Lines • ▼ Show 20 Lines | |||||
| /* commented _only_ because the meta may have animation data which | /* commented _only_ because the meta may have animation data which | ||||
| * needs moving too T28158. */ | * needs moving too T28158. */ | ||||
| BLI_INLINE void trans_update_seq(Scene *sce, Sequence *seq, int old_start, int sel_flag) | BLI_INLINE void trans_update_seq(Scene *sce, Sequence *seq, int old_start, int sel_flag) | ||||
| { | { | ||||
| /* Calculate this strip and all nested strips. | /* Calculate this strip and all nested strips. | ||||
| * Children are ALWAYS transformed first so we don't need to do this in another loop. | * Children are ALWAYS transformed first so we don't need to do this in another loop. | ||||
| */ | */ | ||||
| SEQ_time_update_sequence(sce, seq); | |||||
| ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(sce)); | |||||
| SEQ_time_update_sequence(sce, seqbase, seq); | |||||
| if (sel_flag == SELECT) { | if (sel_flag == SELECT) { | ||||
| SEQ_offset_animdata(sce, seq, seq->start - old_start); | SEQ_offset_animdata(sce, seq, seq->start - old_start); | ||||
| } | } | ||||
| } | } | ||||
| static void flushTransSeq(TransInfo *t) | static void flushTransSeq(TransInfo *t) | ||||
| { | { | ||||
| Show All 23 Lines | switch (tdsq->sel_flag) { | ||||
| 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(seq, new_frame); | ||||
| SEQ_transform_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); | SEQ_transform_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); | ||||
| SEQ_transform_fix_single_image_seq_offsets(seq); | SEQ_transform_fix_single_image_seq_offsets(seq); | ||||
| SEQ_time_update_sequence(t->scene, seq); | SEQ_time_update_sequence(t->scene, seqbasep, 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(seq, new_frame); | ||||
| SEQ_transform_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); | SEQ_transform_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL); | ||||
| SEQ_transform_fix_single_image_seq_offsets(seq); | SEQ_transform_fix_single_image_seq_offsets(seq); | ||||
| SEQ_time_update_sequence(t->scene, seq); | SEQ_time_update_sequence(t->scene, seqbasep, seq); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| /* Update all effects. */ | /* Update all effects. */ | ||||
| if (ELEM(t->mode, TFM_SEQ_SLIDE, TFM_TIME_TRANSLATE)) { | 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) { | ||||
| SEQ_time_update_sequence(t->scene, seq); | SEQ_time_update_sequence(t->scene, seqbasep, 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 */ | ||||
| SeqCollection *transformed_strips = seq_transform_collection_from_transdata(tc); | SeqCollection *transformed_strips = seq_transform_collection_from_transdata(tc); | ||||
| SEQ_collection_expand(seqbase_active_get(t), transformed_strips, SEQ_query_strip_effect_chain); | SEQ_collection_expand(seqbase_active_get(t), transformed_strips, SEQ_query_strip_effect_chain); | ||||
| ▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines | |||||