FORUMS: list search recent posts

Delay expression with Y property only

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Emily Dekovich
Delay expression with Y property only
on Dec 17, 2013 at 10:54:18 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.


Return to posts index

Dan Ebberts
Re: Delay expression with Y property only
on Dec 17, 2013 at 11:22:15 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



Return to posts index

Emily Dekovich
Re: Delay expression with Y property only
on Dec 17, 2013 at 11:53:04 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!!


Return to posts index


Dan Ebberts
Re: Delay expression with Y property only
on Dec 18, 2013 at 12:33:43 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



Return to posts index

Emily Dekovich
Re: Delay expression with Y property only
on Dec 18, 2013 at 5:32:49 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!


Return to posts index

Emily Dekovich
Re: Delay expression with Y property only
on Dec 18, 2013 at 6:09:36 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"))


Return to posts index


Dan Ebberts
Re: Delay expression with Y property only
on Dec 18, 2013 at 6:38:55 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



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]