Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions x position increase over time with hold keyframes

  • x position increase over time with hold keyframes

    Posted by Olly Bea on March 20, 2009 at 12:13 pm

    Hi

    I am well and truly stuck!

    I want to move a layer on the x axis a controllable amount over an controllable period of time for a controllable number of times, but at each x position reached it hold keyframes on that position for a controllable amount of time.

    See why i’m stuck?

    Simply put… I have a small image I want to move across the screen on the x axis. However I would like to be able to specify how far it jumps (say for example 100 pixels in over frame) then when it gets to its destination it holds there for say 5 frames, then jumps another 100 pixels over 1 frame then holds for 5 frames.

    Can anyone help me out with a nifty expression? A bit of an explanation would help if you have the time, I like learning from you all, but no worries if not.

    Thanks in advance

    Olly

    Dan Ebberts replied 17 years, 1 month ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    March 20, 2009 at 7:04 pm

    It might be as simple as some variation of this:

    jump = 100;
    numHoldFrames = 5;
    frame = timeToFrames(time);
    value + [jump*Math.floor(frame/numHoldFrames),0]

    Dan

  • Olly Bea

    March 24, 2009 at 3:32 pm

    works a treat thanks

    what does math.floor mean?

  • Dan Ebberts

    March 24, 2009 at 4:17 pm

    Math.floor() rounds down to the nearest integer.

    Dan

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