[Bf-blender-cvs] [295eb04ba3b] blender-v3.3-release: Fix T101447: Hold split not working correctly
Richard Antalik
noreply at git.blender.org
Mon Oct 17 15:01:06 CEST 2022
Commit: 295eb04ba3b750ba836ccbd6df112ca89909011a
Author: Richard Antalik
Date: Tue Oct 4 16:05:48 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB295eb04ba3b750ba836ccbd6df112ca89909011a
Fix T101447: Hold split not working correctly
Caused by incorrect conflict resolution in commit 302b04a5a3fc0e76.
===================================================================
M source/blender/sequencer/intern/strip_edit.c
===================================================================
diff --git a/source/blender/sequencer/intern/strip_edit.c b/source/blender/sequencer/intern/strip_edit.c
index 15c472dd5a7..a302a570eeb 100644
--- a/source/blender/sequencer/intern/strip_edit.c
+++ b/source/blender/sequencer/intern/strip_edit.c
@@ -259,49 +259,50 @@ bool SEQ_edit_move_strip_to_meta(Scene *scene,
return true;
}
-static void seq_split_set_left_hold_offset(Scene *scene, Sequence *seq, int timeline_frame)
+static void seq_split_set_right_hold_offset(Scene *scene, Sequence *seq, int timeline_frame)
{
- /* Adjust within range of extended stillframes before strip. */
- if (timeline_frame < seq->start) {
- seq->start = timeline_frame - 1;
- seq->anim_endofs += SEQ_time_strip_length_get(scene, seq) - 1;
- seq->startstill = timeline_frame - seq->startdisp - 1;
- seq->endstill = 0;
+ const float content_start = seq->start;
+ const float content_end = seq->start + SEQ_time_strip_length_get(scene, seq);
+
+ /* Adjust within range of extended still-frames before strip. */
+ if (timeline_frame < content_start) {
+ const float offset = content_start + 1 - timeline_frame;
+ seq->start -= offset;
+ seq->startofs += offset;
+ SEQ_time_right_handle_frame_set(scene, seq, timeline_frame);
}
/* Adjust within range of strip contents. */
- else if ((timeline_frame >= seq->start) &&
- (timeline_frame <= (seq->start + SEQ_time_strip_length_get(scene, seq)))) {
+ else if ((timeline_frame >= content_start) && (timeline_frame <= content_end)) {
seq->endofs = 0;
- seq->endstill = 0;
- seq->anim_endofs += (seq->start + SEQ_time_strip_length_get(scene, seq)) - timeline_frame;
+ seq->anim_endofs += (content_end - timeline_frame) * seq->speed_factor;
}
- /* Adjust within range of extended stillframes after strip. */
- else if ((seq->start + SEQ_time_strip_length_get(scene, seq)) < timeline_frame) {
- seq->endstill = timeline_frame - seq->start - SEQ_time_strip_length_get(scene, seq);
+ /* Adjust within range of extended still-frames after strip. */
+ else if (timeline_frame > content_end) {
+ SEQ_time_right_handle_frame_set(scene, seq, timeline_frame);
}
}
-static void seq_split_set_right_hold_offset(Scene *scene, Sequence *seq, int timeline_frame)
+static void seq_split_set_left_hold_offset(Scene *scene, Sequence *seq, int timeline_frame)
{
- /* Adjust within range of extended stillframes before strip. */
- if (timeline_frame < seq->start) {
- seq->startstill = seq->start - timeline_frame;
+ const float content_start = seq->start;
+ const float content_end = seq->start + SEQ_time_strip_length_get(scene, seq);
+
+ /* Adjust within range of extended still-frames before strip. */
+ if (timeline_frame < content_start) {
+ SEQ_time_left_handle_frame_set(scene, seq, timeline_frame);
}
/* Adjust within range of strip contents. */
- else if ((timeline_frame >= seq->start) &&
- (timeline_frame <= (seq->start + SEQ_time_strip_length_get(scene, seq)))) {
- seq->anim_startofs += timeline_frame - seq->start;
+ else if ((timeline_frame >= content_start) && (timeline_frame <= content_end)) {
+ seq->anim_startofs += (timeline_frame - content_start) * seq->speed_factor;
seq->start = timeline_frame;
- seq->startstill = 0;
seq->startofs = 0;
}
- /* Adjust within range of extended stillframes after strip. */
- else if ((seq->start + SEQ_time_strip_length_get(scene, seq)) < timeline_frame) {
- seq->start = timeline_frame;
- seq->startofs = 0;
- seq->anim_startofs += SEQ_time_strip_length_get(scene, seq) - 1;
- seq->endstill = seq->enddisp - timeline_frame - 1;
- seq->startstill = 0;
+ /* Adjust within range of extended still-frames after strip. */
+ else if (timeline_frame > content_end) {
+ const float offset = timeline_frame - content_end + 1;
+ seq->start += offset;
+ seq->endofs += offset;
+ SEQ_time_left_handle_frame_set(scene, seq, timeline_frame);
}
}
More information about the Bf-blender-cvs
mailing list