Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions controlling rate and stop time with slider

  • controlling rate and stop time with slider

    Posted by Bert Brown on May 18, 2009 at 7:25 pm

    posing my question again, hopefully simpler this time:

    what’s the best way to have an object always moving in one direction where it’s speed can modified by a slider that allows it to stop?

    right now i’ve got position X = time*rate, where rate is the slider, but it causes it to move backwards when i try to stop it.

    ———————————-

    peep my over-the-interweb band, red abbott.
    “we electro-rock over long distances…”

    Bert Brown replied 17 years ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    May 18, 2009 at 8:09 pm

    The only way I know of is to do a frame-by-frame integration of the rate multiplied by the frame duration. Something like this:

    rate = effect(“Slider Control”)(“Slider”);
    f = timeToFrames();
    accum = 0;
    for (i = 1; i <= f; i++){ accum += rate.valueAtTime(framesToTime(i))*thisComp.frameDuration; } value + [accum,0] Dan

  • Bert Brown

    May 19, 2009 at 7:33 pm

    thanks, dan. this works, but it appears to be giving me little flickers of movement (not smooth). i got similar results even in just doing a time*rate or timeToFrames(time)*rate situation. any thoughts?

    ———————————-

    peep my over-the-interweb band, red abbott.
    “we electro-rock over long distances…”

  • Bert Brown

    May 19, 2009 at 9:22 pm

    nevermind, that seemed to just be this computer being on for days.

    thanks again

    ———————————-

    peep my over-the-interweb band, red abbott.
    “we electro-rock over long distances…”

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