Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Delay expression with Y property only

  • Delay expression with Y property only

    Posted by Emily Dekovich on December 17, 2013 at 10:54 pm

    Hello all,
    I’m a bit newer when it comes to expressions & have a (probably) easy one:
    I’ve got a couple things I want to animate & cause a “ripple” effect, where the first object moves up in Y position & the others follow suit in the same Y value.

    For example, if object A moves up 5 pixels from its original position, then 3 frames later object B moves up 5 pixels from its original position. *They are not starting out or ending in the same position, just moving the same value*

    They are also 2D layers. Any helpers? Thank you in advance. I tried following some of Motion Script’s posts but I don;t want them to have the exact same position ending.

    Dan Ebberts replied 12 years, 8 months ago 2 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    December 17, 2013 at 11:22 pm

    Hard to know exactly what you’re looking for, but try this:

    p = thisComp.layer(“A”).transform.position;
    delayFrames = 3;

    d = framesToTime(delayFrames);
    value + p.valueAtTime(time-d) – p.valueAtTime(0);

    It won’t do anything until you animate the position of layer A.

    Dan

  • Emily Dekovich

    December 17, 2013 at 11:53 pm

    It kind of works, but then it adjusts the starting point of the layer B want to effect.

    The other thing is, I want it to have a sort of domino effect, instead of all coming after Layer A moves.

    Thank you for your help in advance!!

  • Dan Ebberts

    December 18, 2013 at 12:33 am

    Maybe more like this:

    p = thisComp.layer(“A”).transform.position;
    delayFrames = 3;

    d = (index-1)*framesToTime(delayFrames);
    value + p.valueAtTime(time-d) – p.valueAtTime(0);

    I just noticed that your topic title mentions Y only, so that would be like this:

    p = thisComp.layer(“A”).transform.position;
    delayFrames = 3;

    d = (index-1)*framesToTime(delayFrames);
    value +[0, p.valueAtTime(time-d)[1] – p.valueAtTime(0)[1]];

    Dan

  • Emily Dekovich

    December 18, 2013 at 5:32 am

    Getting closer! it’s more like the domino effect I mentioned; Layer B follows A’s movement with delay, then Layer C follows Layer B’s movement with delay, etc. etc.

    So the group of objects is not collectively moving with a delay following layer A, but rather they are all moving one after the other after the other, one by one in succession.
    Again, I *really* appreciate your help Dan!

  • Emily Dekovich

    December 18, 2013 at 6:09 am

    I’ve created a “Leader” object which moves in Y position, and attached a slider effect renamed “post” to it.

    Then, in the layer above it I wrote this expression under the position property:
    (see below)

    The problem is, it copies the X & Y properties exactly. What I want to do is mimic the change in value of Y of the Control layer while retaining its own separate Y value. Does that make sense?

    Thank you so much for your help!

    post=thisComp.layer("CONTROL").effect("post")("Slider")
    thisComp.layer(index+1).transform.position.valueAtTime (time-thisComp.layer("CONTROL").effect("post")("Slider"))

  • Dan Ebberts

    December 18, 2013 at 6:38 am

    The key to this is in the last line of the last expressions I posted. You need to subtract the leader’s starting position from its position at the specified delay time to get how far it has traveled. You then add that same travel distance to the follower layer’s initial position.

    Dan

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