Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/strip_edit.c
| Show First 20 Lines • Show All 261 Lines • ▼ Show 20 Lines | bool SEQ_edit_move_strip_to_meta(Scene *scene, | ||||
| Sequence *seq; | Sequence *seq; | ||||
| SEQ_ITERATOR_FOREACH (seq, collection) { | SEQ_ITERATOR_FOREACH (seq, collection) { | ||||
| /* Move to meta. */ | /* Move to meta. */ | ||||
| BLI_remlink(seqbase, seq); | BLI_remlink(seqbase, seq); | ||||
| BLI_addtail(&dst_seqm->seqbase, seq); | BLI_addtail(&dst_seqm->seqbase, seq); | ||||
| SEQ_relations_invalidate_cache_preprocessed(scene, seq); | SEQ_relations_invalidate_cache_preprocessed(scene, seq); | ||||
| /* Update meta. */ | /* Update meta. */ | ||||
| ListBase *meta_seqbase = SEQ_get_seqbase_by_seq(&ed->seqbase, dst_seqm); | |||||
| SEQ_time_update_meta_strip_range(scene, dst_seqm); | SEQ_time_update_meta_strip_range(scene, dst_seqm); | ||||
| SEQ_time_update_sequence(scene, dst_seqm); | SEQ_time_update_sequence(scene, meta_seqbase, dst_seqm); | ||||
| if (SEQ_transform_test_overlap(&dst_seqm->seqbase, seq)) { | if (SEQ_transform_test_overlap(&dst_seqm->seqbase, seq)) { | ||||
| SEQ_transform_seqbase_shuffle(&dst_seqm->seqbase, seq, scene); | SEQ_transform_seqbase_shuffle(&dst_seqm->seqbase, seq, scene); | ||||
| } | } | ||||
| } | } | ||||
| SEQ_collection_free(collection); | SEQ_collection_free(collection); | ||||
| return true; | return true; | ||||
| ▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
| 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; | ||||
| } | } | ||||
| static void seq_edit_split_handle_strip_offsets(Main *bmain, | static void seq_edit_split_handle_strip_offsets(Main *bmain, | ||||
| Scene *scene, | Scene *scene, | ||||
| ListBase *seqbase, | |||||
| Sequence *left_seq, | Sequence *left_seq, | ||||
| Sequence *right_seq, | Sequence *right_seq, | ||||
| const int timeline_frame, | const int timeline_frame, | ||||
| const eSeqSplitMethod method) | const eSeqSplitMethod method) | ||||
| { | { | ||||
| if (seq_edit_split_effect_intersect_check(right_seq, timeline_frame)) { | if (seq_edit_split_effect_intersect_check(right_seq, timeline_frame)) { | ||||
| switch (method) { | switch (method) { | ||||
| case SEQ_SPLIT_SOFT: | case SEQ_SPLIT_SOFT: | ||||
| seq_split_set_left_offset(right_seq, timeline_frame); | seq_split_set_left_offset(right_seq, timeline_frame); | ||||
| break; | break; | ||||
| case SEQ_SPLIT_HARD: | case SEQ_SPLIT_HARD: | ||||
| seq_split_set_left_hold_offset(right_seq, timeline_frame); | seq_split_set_left_hold_offset(right_seq, timeline_frame); | ||||
| SEQ_add_reload_new_file(bmain, scene, right_seq, false); | SEQ_add_reload_new_file(bmain, scene, right_seq, false); | ||||
| break; | break; | ||||
| } | } | ||||
| SEQ_time_update_sequence(scene, right_seq); | SEQ_time_update_sequence(scene, seqbase, right_seq); | ||||
| } | } | ||||
| if (seq_edit_split_effect_intersect_check(left_seq, timeline_frame)) { | if (seq_edit_split_effect_intersect_check(left_seq, timeline_frame)) { | ||||
| switch (method) { | switch (method) { | ||||
| case SEQ_SPLIT_SOFT: | case SEQ_SPLIT_SOFT: | ||||
| seq_split_set_right_offset(left_seq, timeline_frame); | seq_split_set_right_offset(left_seq, timeline_frame); | ||||
| break; | break; | ||||
| case SEQ_SPLIT_HARD: | case SEQ_SPLIT_HARD: | ||||
| seq_split_set_right_hold_offset(left_seq, timeline_frame); | seq_split_set_right_hold_offset(left_seq, timeline_frame); | ||||
| SEQ_add_reload_new_file(bmain, scene, left_seq, false); | SEQ_add_reload_new_file(bmain, scene, left_seq, false); | ||||
| break; | break; | ||||
| } | } | ||||
| SEQ_time_update_sequence(scene, left_seq); | SEQ_time_update_sequence(scene, seqbase, left_seq); | ||||
| } | } | ||||
| } | } | ||||
| static bool seq_edit_split_effect_inputs_intersect(const Sequence *seq, const int timeline_frame) | static bool seq_edit_split_effect_inputs_intersect(const Sequence *seq, const int timeline_frame) | ||||
| { | { | ||||
| bool input_does_intersect = false; | bool input_does_intersect = false; | ||||
| if (seq->seq1) { | if (seq->seq1) { | ||||
| input_does_intersect |= seq_edit_split_effect_intersect_check(seq->seq1, timeline_frame); | input_does_intersect |= seq_edit_split_effect_intersect_check(seq->seq1, timeline_frame); | ||||
| ▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | Sequence *SEQ_edit_strip_split(Main *bmain, | ||||
| while (left_seq && right_seq) { | while (left_seq && right_seq) { | ||||
| if (left_seq->startdisp >= timeline_frame) { | if (left_seq->startdisp >= timeline_frame) { | ||||
| SEQ_collection_append_strip(left_seq, strips_to_delete); | SEQ_collection_append_strip(left_seq, strips_to_delete); | ||||
| } | } | ||||
| if (right_seq->enddisp <= timeline_frame) { | if (right_seq->enddisp <= timeline_frame) { | ||||
| SEQ_collection_append_strip(right_seq, strips_to_delete); | SEQ_collection_append_strip(right_seq, strips_to_delete); | ||||
| } | } | ||||
| seq_edit_split_handle_strip_offsets(bmain, scene, left_seq, right_seq, timeline_frame, method); | seq_edit_split_handle_strip_offsets( | ||||
| bmain, scene, seqbase, left_seq, right_seq, timeline_frame, method); | |||||
| left_seq = left_seq->next; | left_seq = left_seq->next; | ||||
| right_seq = right_seq->next; | right_seq = right_seq->next; | ||||
| } | } | ||||
| seq = right_strips.first; | seq = right_strips.first; | ||||
| BLI_movelisttolist(seqbase, &left_strips); | BLI_movelisttolist(seqbase, &left_strips); | ||||
| BLI_movelisttolist(seqbase, &right_strips); | BLI_movelisttolist(seqbase, &right_strips); | ||||
| ▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines | |||||