Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Controlling Rotation Speed

  • Controlling Rotation Speed

    Posted by Bhavesh Jadav on June 19, 2014 at 5:33 am

    Hi,

    I created fan in after effects & i want to rotate it with initial speed of zero.
    Then it will increase upto certain constant speed. It will Rotate for some time at that constant speed.
    After some time it will decrease value until it’s value become zero. Like in real world, when u start the fan it will gradually increases it rotation speed & then rotate at constant rotation speed after some time.
    When you switch off the fan, the procedure will be reversed.
    Is there any way to do it in after effects?

    Ernestas Cepulionis replied 9 years, 2 months ago 3 Members · 13 Replies
  • 13 Replies
  • Dan Ebberts

    June 19, 2014 at 6:14 am

    This is one way. It’s not simple, but it works:

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

    Dan

  • Bhavesh Jadav

    June 19, 2014 at 9:07 am

    Thank you for your answer
    but i already checked that & i am not getting my results.
    I want to do it without keyframes & speed should be controlled by slider control

  • Dan Ebberts

    June 19, 2014 at 2:50 pm

    You would use that technique to integrate/accumulate the value of your slider control.

    Dan

  • Bhavesh Jadav

    June 20, 2014 at 6:26 am

    Thank you for answering Dan

    Here’s the scenario.
    I have adjustment layer which has slider control, which controls the
    speed of the fan. There is another layer ‘Fan’. I want to control
    rotation of fan layer by speed provided in slider control.
    There is no keyframe in any layers. On motionscript, it calculates the area of the graph, but in my case there is no graph.so is there any modification i need to do in that code?
    If there is way please tell me.

  • Dan Ebberts

    June 20, 2014 at 6:37 am

    So how are you controlling the value of the slider? You initially indicated that you wanted to animate the speed of the fan, which I assume implies that you’ll be animating the slider value, correct?

    Dan

  • Bhavesh Jadav

    June 20, 2014 at 7:10 am

    slider value is constant.
    for example i enter 200 in slider value, the fan will rotate about speed of 200 rps(but not necessary 200 rps, around that value) with slowly increase its speed, 200 rps for some time & slowly decrease the speed & then stop. I am not animating slider value.

  • Dan Ebberts

    June 20, 2014 at 5:45 pm

    How does the expression know how long the ramps are and when they start? If you define the ramp start and finish times in the code, I guess it would look something like this:


    spd = effect("Slider Control")("Slider");
    t1 = 0; // on-ramp start
    t2 = 1; // on-ramp finish
    t3 = 5; // off-ramp start
    t4 = 6; // off-ramp finish

    if (time > t4){
    accum = (t2 - t1)*spd/2 + (t3 - t2)*spd + (t4 - t3)*spd/2;
    }else if (time > t3){
    v = linear(time,t3,t4,spd,0);
    accum = (t2 - t1)*spd/2 + (t3 - t2)*spd + (time - t3)*(v+spd)/2;
    }else if (time > t2){
    accum = (t2 - t1)*spd/2 + (time - t2)*spd;
    }else if (time > t1){
    v = linear(time,t1,t2,0,spd);
    accum = (time - t1)*v/2;
    }else{
    accum = 0;
    }

    value + accum

    Dan

  • Bhavesh Jadav

    June 20, 2014 at 5:58 pm

    Thank you for answering Dan.

    According to your code the speed will increase from 0 to 1 sec & from 1 to 5 sec it wil be constant , then from 5 to 6 second it will decrease & finally it will stop. Right?
    1 second ramp i want. I forgot to mention that.

  • Dan Ebberts

    June 20, 2014 at 6:07 pm

    That’s correct.

  • Bhavesh Jadav

    June 20, 2014 at 6:10 pm

    Oh Great.
    Thank you Dan.
    I will let u know if it works.
    Thank you.

Page 1 of 2

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy