Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/strip_edit.c
| Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | int SEQ_edit_sequence_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str) | ||||
| SWAP(int, seq_a->blend_mode, seq_b->blend_mode); | SWAP(int, seq_a->blend_mode, seq_b->blend_mode); | ||||
| SWAP(float, seq_a->blend_opacity, seq_b->blend_opacity); | SWAP(float, seq_a->blend_opacity, seq_b->blend_opacity); | ||||
| SWAP(Sequence *, seq_a->prev, seq_b->prev); | SWAP(Sequence *, seq_a->prev, seq_b->prev); | ||||
| SWAP(Sequence *, seq_a->next, seq_b->next); | SWAP(Sequence *, seq_a->next, seq_b->next); | ||||
| SWAP(int, seq_a->start, seq_b->start); | SWAP(int, seq_a->start, seq_b->start); | ||||
| SWAP(int, seq_a->startofs, seq_b->startofs); | SWAP(int, seq_a->startofs, seq_b->startofs); | ||||
| SWAP(int, seq_a->endofs, seq_b->endofs); | SWAP(int, seq_a->endofs, seq_b->endofs); | ||||
| SWAP(int, seq_a->startstill, seq_b->startstill); | |||||
| SWAP(int, seq_a->endstill, seq_b->endstill); | |||||
| SWAP(int, seq_a->machine, seq_b->machine); | SWAP(int, seq_a->machine, seq_b->machine); | ||||
| SWAP(int, seq_a->startdisp, seq_b->startdisp); | SWAP(int, seq_a->startdisp, seq_b->startdisp); | ||||
| SWAP(int, seq_a->enddisp, seq_b->enddisp); | SWAP(int, seq_a->enddisp, seq_b->enddisp); | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| static void seq_update_muting_recursive(ListBase *channels, | static void seq_update_muting_recursive(ListBase *channels, | ||||
| ▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | bool SEQ_edit_move_strip_to_meta(Scene *scene, | ||||
| return true; | return true; | ||||
| } | } | ||||
| static void seq_split_set_left_hold_offset(Sequence *seq, int timeline_frame) | static void seq_split_set_left_hold_offset(Sequence *seq, int timeline_frame) | ||||
| { | { | ||||
| /* Adjust within range of extended stillframes before strip. */ | /* Adjust within range of extended stillframes before strip. */ | ||||
| if (timeline_frame < seq->start) { | if (timeline_frame < seq->start) { | ||||
| seq->start = timeline_frame - 1; | SEQ_transform_set_left_handle_frame(seq, timeline_frame); | ||||
| seq->anim_endofs += seq->len - 1; | |||||
| seq->startstill = timeline_frame - seq->startdisp - 1; | |||||
| seq->endstill = 0; | |||||
| } | } | ||||
| /* Adjust within range of strip contents. */ | /* Adjust within range of strip contents. */ | ||||
| else if ((timeline_frame >= seq->start) && (timeline_frame <= (seq->start + seq->len))) { | else if ((timeline_frame >= seq->start) && (timeline_frame <= (seq->start + seq->len))) { | ||||
| seq->endofs = 0; | seq->anim_startofs += timeline_frame - seq->start; | ||||
| seq->endstill = 0; | seq->start = timeline_frame; | ||||
| seq->anim_endofs += (seq->start + seq->len) - timeline_frame; | seq->startofs = 0; | ||||
| } | } | ||||
| /* Adjust within range of extended stillframes after strip. */ | /* Adjust within range of extended stillframes after strip. */ | ||||
| else if ((seq->start + seq->len) < timeline_frame) { | else if ((seq->start + seq->len) < timeline_frame) { | ||||
| seq->endstill = timeline_frame - seq->start - seq->len; | const int right_handle_backup = SEQ_transform_get_right_handle_frame(seq); | ||||
| seq->start += timeline_frame - seq->start; | |||||
| seq->anim_startofs += seq->len - 1; | |||||
| seq->len = 1; | |||||
| SEQ_transform_set_left_handle_frame(seq, timeline_frame); | |||||
| SEQ_transform_set_right_handle_frame(seq, right_handle_backup); | |||||
| } | } | ||||
| } | } | ||||
| static void seq_split_set_right_hold_offset(Sequence *seq, int timeline_frame) | static void seq_split_set_right_hold_offset(Sequence *seq, int timeline_frame) | ||||
| { | { | ||||
| /* Adjust within range of extended stillframes before strip. */ | /* Adjust within range of extended stillframes before strip. */ | ||||
| if (timeline_frame < seq->start) { | if (timeline_frame < seq->start) { | ||||
| seq->startstill = seq->start - timeline_frame; | const int left_handle_backup = SEQ_transform_get_left_handle_frame(seq); | ||||
| seq->start = timeline_frame - 1; | |||||
| SEQ_transform_set_left_handle_frame(seq, left_handle_backup); | |||||
| SEQ_transform_set_right_handle_frame(seq, timeline_frame); | |||||
| } | } | ||||
| /* Adjust within range of strip contents. */ | /* Adjust within range of strip contents. */ | ||||
| else if ((timeline_frame >= seq->start) && (timeline_frame <= (seq->start + seq->len))) { | else if ((timeline_frame >= seq->start) && (timeline_frame <= (seq->start + seq->len))) { | ||||
| seq->anim_startofs += timeline_frame - seq->start; | seq->anim_endofs += seq->start + seq->len - timeline_frame; | ||||
| seq->start = timeline_frame; | seq->endofs = 0; | ||||
| seq->startstill = 0; | |||||
| seq->startofs = 0; | |||||
| } | } | ||||
| /* Adjust within range of extended stillframes after strip. */ | /* Adjust within range of extended stillframes after strip. */ | ||||
| else if ((seq->start + seq->len) < timeline_frame) { | else if ((seq->start + seq->len) < timeline_frame) { | ||||
| seq->start = timeline_frame; | SEQ_transform_set_right_handle_frame(seq, timeline_frame); | ||||
| seq->startofs = 0; | |||||
| seq->anim_startofs += seq->len - 1; | |||||
| seq->endstill = seq->enddisp - timeline_frame - 1; | |||||
| seq->startstill = 0; | |||||
| } | } | ||||
| } | } | ||||
| static void seq_split_set_right_offset(Sequence *seq, int timeline_frame) | static void seq_split_set_right_offset(Sequence *seq, int timeline_frame) | ||||
| { | { | ||||
| /* Adjust within range of extended stillframes before strip. */ | /* Adjust within range of extended stillframes before strip. */ | ||||
| if (timeline_frame < seq->start) { | if (timeline_frame < seq->start) { | ||||
| const int content_offset = seq->start - timeline_frame + 1; | |||||
| seq->start = timeline_frame - 1; | seq->start = timeline_frame - 1; | ||||
| seq->startstill = timeline_frame - seq->startdisp - 1; | seq->startofs += content_offset; | ||||
| seq->endofs = seq->len - 1; | |||||
| } | |||||
| /* Adjust within range of extended stillframes after strip. */ | |||||
| else if ((seq->start + seq->len) < timeline_frame) { | |||||
| seq->endstill -= seq->enddisp - timeline_frame; | |||||
| } | } | ||||
| SEQ_transform_set_right_handle_frame(seq, timeline_frame); | SEQ_transform_set_right_handle_frame(seq, timeline_frame); | ||||
| } | } | ||||
| static void seq_split_set_left_offset(Sequence *seq, int timeline_frame) | static void seq_split_set_left_offset(Sequence *seq, int timeline_frame) | ||||
| { | { | ||||
| /* Adjust within range of extended stillframes before strip. */ | |||||
| if (timeline_frame < seq->start) { | |||||
| seq->startstill = seq->start - timeline_frame; | |||||
| } | |||||
| /* Adjust within range of extended stillframes after strip. */ | /* Adjust within range of extended stillframes after strip. */ | ||||
| if ((seq->start + seq->len) < timeline_frame) { | if (timeline_frame > seq->start + seq->len) { | ||||
| seq->start = timeline_frame - seq->len + 1; | const int content_offset = timeline_frame - (seq->start + seq->len) + 1; | ||||
| seq->endstill = seq->enddisp - timeline_frame - 1; | seq->start += content_offset; | ||||
| seq->endofs += content_offset; | |||||
| } | } | ||||
| SEQ_transform_set_left_handle_frame(seq, timeline_frame); | SEQ_transform_set_left_handle_frame(seq, timeline_frame); | ||||
| } | } | ||||
| static bool seq_edit_split_effect_intersect_check(const Sequence *seq, const int timeline_frame) | static bool seq_edit_split_effect_intersect_check(const Sequence *seq, const int timeline_frame) | ||||
| { | { | ||||
| return timeline_frame > seq->startdisp && timeline_frame < seq->enddisp; | return timeline_frame > seq->startdisp && timeline_frame < seq->enddisp; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines | |||||