Commit: b08ab49cceaba9ad541ae5d50720bae6b5c96c40
Author: Richard Antalik
Date:   Tue Aug 31 03:12:00 2021 +0200
Branches: master
https://developer.blender.org/rBb08ab49cceaba9ad541ae5d50720bae6b5c96c40

Fix T90988: Incorrect speed effect strip math

Math implemented in 929d7597b345 was incorrect, but also inconsistent
with previous behavior.

`SEQ_SPEED_STRETCH` should change length only when right handle is
moved. This is now documented in code.

===================================================================

M       source/blender/sequencer/intern/effects.c

===================================================================

diff --git a/source/blender/sequencer/intern/effects.c 
b/source/blender/sequencer/intern/effects.c
index 37bac523645..80314d34360 100644
--- a/source/blender/sequencer/intern/effects.c
+++ b/source/blender/sequencer/intern/effects.c
@@ -3186,10 +3186,12 @@ float seq_speed_effect_target_frame_get(Scene *scene,
   float target_frame = 0.0f;
   switch (s->speed_control_type) {
     case SEQ_SPEED_STRETCH: {
-      const float target_content_length = 
seq_effect_speed_get_strip_content_length(source);
-      const float target_strip_length = source->enddisp - source->startdisp;
-      const float ratio = target_content_length / target_strip_length;
-      target_frame = frame_index * ratio;
+      /* Only right handle controls effect speed! */
+      const float target_content_length = 
seq_effect_speed_get_strip_content_length(source) -
+                                  source->startofs;
+      const float speed_effetct_length = seq_speed->enddisp - 
seq_speed->startdisp;
+      const float ratio = frame_index / speed_effetct_length;
+      target_frame = target_content_length * ratio;
       break;
     }
     case SEQ_SPEED_MULTIPLY: {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to