Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Wave Delay in Y Position Only

  • Wave Delay in Y Position Only

    Posted by Robert Elliott on May 4, 2010 at 10:30 pm

    Hi all,

    I’ve got a series of objects I’d like to animate like a wave across the screen. I want them to move up and down in their y position only. I’m thinking this can be done with a delay, but how can I constrain it to be only along the Y position for each layer?

    Thanks,
    Rob

    Dan Ebberts replied 16 years, 3 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    May 4, 2010 at 11:26 pm

    I’m not sure what you’re doing, but this might help. This expression should cause a layer to oscillate up and down only, based on its x position in the comp. So it should generate a wave if you have a bunch of layers (with the same pre-expression y value) arranged in a horizontal line.

    freq = 1; // one oscillation per second
    amplitude = 50; // up and down 50 pixels

    P = toWorld(anchorPoint);
    phase = (P[0]/thisComp.width)*Math.PI*2;
    y = amplitude*Math.sin(time*freq*Math.PI*2 + phase);
    value + [0,y]

    Dan

  • Robert Elliott

    May 5, 2010 at 12:08 am

    Thanks Dan. That’s a nice effect and might help with another task I need to deal with next. I was looking for more of a follow the leader kind of look where I could keyframe one object and have the others follow. I was able to get closer by searching deeper through the posts and modifying one to get this:

    delay = 10; //number of frames to delay

    d = delay*thisComp.frameDuration*(index – 1);
    [position[0], thisComp.layer(“1”).transform.position.valueAtTime(time – d) [1]]

    I’ve got 18 objects. Is there a way to lesson the Y value of each layer so it doesn’t rise above the Y position of its previous layer? Does that make sense?

    Thanks,
    Rob

  • Dan Ebberts

    May 5, 2010 at 2:11 am

    Probably, but it’s hard to pin down without more information about how you want it to work. Maybe some numeric examples would help.

    Dan

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