Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
3

I want rotation loop to slowly stop after looping a while then continue backwards

Community Beginner ,
Mar 22, 2024 Mar 22, 2024

I'm using loop out expretion for a fan to continously loop.

But I want it to stop with ease after looping for maybe 2 seconds,

start continuing backwards with ease then regain speed.

TOPICS
Expressions , Freeze or hang
503
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 22, 2024 Mar 22, 2024

This explains the issues with speed control:

https://www.motionscript.com/articles/speed-control.html

What you'd want to do is use the linear keyframe integrator expression and key frame your slider to go forward, slow to a stop, then back up. Here's the expression, for reference:

spd = effect("Slider Control")("Slider");
n = spd.numKeys;
if (n > 0 && spd.key(1).time < time){
  accum = spd.key(1).value*(spd.key(1).time - inPoint);
  for (i = 2; i <= n; i++){
    if (spd.key(i).time > time) break
...
Translate
Community Expert ,
Mar 22, 2024 Mar 22, 2024

This explains the issues with speed control:

https://www.motionscript.com/articles/speed-control.html

What you'd want to do is use the linear keyframe integrator expression and key frame your slider to go forward, slow to a stop, then back up. Here's the expression, for reference:

spd = effect("Slider Control")("Slider");
n = spd.numKeys;
if (n > 0 && spd.key(1).time < time){
  accum = spd.key(1).value*(spd.key(1).time - inPoint);
  for (i = 2; i <= n; i++){
    if (spd.key(i).time > time) break;
    k1 = spd.key(i-1);
    k2 = spd.key(i);
    accum += (k1.value + k2.value)*(k2.time - k1.time)/2;
  }
  accum += (spd.value + spd.key(i-1).value)*(time - spd.key(i-1).time)/2;
}else{
  accum = spd.value*(time - inPoint);
}
value + accum

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 22, 2024 Mar 22, 2024

I'm very new to coding and this is a bit difficult for me to digest.

But I love challenge and this made my day !

Thank you ! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2024 Mar 22, 2024

If you get stuck, just ask.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 03, 2024 Jun 03, 2024
LATEST

Thank you 🙏

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines