Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expression Help with moving a null layer to the left 120 pixels every 3 seconds

  • Expression Help with moving a null layer to the left 120 pixels every 3 seconds

    Posted by Matt Sonberg on October 18, 2006 at 6:22 pm

    Every 3 seconds I’d like to move my null layer to the left by 120 pixels. I have to do this many times over. How can I write an expression to do this? I figure it’s pretty simple, but I have very little experience with expressions.

    Thanks as always!

    Mike Clasby replied 19 years, 7 months ago 4 Members · 5 Replies
  • 5 Replies
  • Julian Sixx

    October 18, 2006 at 6:45 pm

    Hi
    yikesmikes it’s my turn this time 😉

    hold_time=3;
    l=Math.floor(time/hold_time)
    value+[l*-120]

  • Mike Clasby

    October 18, 2006 at 6:57 pm

    Drats! Foiled again.

  • Matt Sonberg

    October 18, 2006 at 8:50 pm

    This is perfect… almost. I guess I should have asked this in the first place. How can I ease in and out of each of these movements? I want the null to slide to the left, starting and stop in a smooth motion.

    yikesmikes… I’m giving you another shot!

  • Dan Ebberts

    October 18, 2006 at 9:11 pm

    Something like this maybe:

    period = 3;
    deltaX = -120;
    easeTime = .5;

    t = time % period;
    prevX = Math.floor(time/3)*deltaX;
    nextX = prevX + deltaX;
    currX = ease(t,0,easeTime,prevX, nextX);
    value + [currX,0];

    Decrease “easeTime” to reduce travel time between positions.

    Dan

  • Mike Clasby

    October 18, 2006 at 9:52 pm

    Or you could keyframe one cycle of the movment the way you like, ease keyframe for 3rd keyframe (and tweak its bezier if you want), then add this loop expression.

    loop_out(“offset”,0)

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