Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Simple continuous movement

  • Simple continuous movement

    Posted by Anwar Hoogland on October 21, 2010 at 7:02 pm

    I’m working on an animation where the various video’s keep moving past the camera in a steady motion. But at some points the movement needs to stop. I figured this would be pretty doable with an expression in combination with a slider control to control the speed.

    The code I initially got (below) didn’t have the slider control but it turns out this is a problem.
    When I animate the slider from 0 to 150 it speeds up dramatically to a speed that looks more like 2000 and then when it passes the 150 keyframe it continues on at the intended 150 speed

    anyone have an idea of what’s causing this?

    t=time*effect("Slider Control")("Slider");
    x=value[0]-t;
    y=288;
    z=0;
    [x,y,z];

    Anwar Hoogland replied 15 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Michael Szalapski

    October 21, 2010 at 7:56 pm

    Here’s one idea: Parent all the layers to a null object, then parent that null to another null. Make one of the nulls the continuous slow movement that you want, then keyframe the other one for when you want fast motion.

    – The Great Szalam
    (The ‘Great’ stands for ‘Not So Great, in fact, Extremely Humble’)

    No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.

  • Anwar Hoogland

    October 22, 2010 at 6:04 pm

    Thanks for the reply Michael, that’s also a good way to look at it and I’ll surely keep that in mind 🙂

    But after a long search last night I finally found what I was looking for. I’m not sure what it all means but it does exactly what I wanted.
    I can completely control the speed of the animation by setting the Slider control to the speed I want. 🙂

    Td = framesToTime(1, 1.0 / thisComp.frameDuration);
    x = 0;
    v = effect("Slider Control")("Slider");
    n = timeToFrames(time + thisComp.displayStartTime, 1.0 / thisComp.frameDuration);
    for (k=0; k<=n; k++)
    x = x - v.valueAtTime(k*Td);

    x = x + position[0];
    y = position[1];
    [x,y]

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