ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Referencing another layers position only if size =0

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Markus Stone
Referencing another layers position only if size =0
on Aug 12, 2019 at 3:18:42 am

Hi all,

I'm trying to build a trail of dots that emerge from the end of a line that travels along a path (think mouse pointer trails) and slowly shrink down to notheing. The catch is that once they have appeared, the dots must stay locked to the background (ie; not following the movement of the line that 'gave birth to them').

I have an ellipse shape that shrinks down to nothing. It's keyframed with a loopout in cycle mode. The idea is that once the layer hits a size of "0" I can move it to become the new dot, so I don't have to have a new layer for every dot and the animation can be any length with the same overhead.

I have a Null chasing the position of the end of the line.

Thing is, I can't get the expression to sample the new position from the Null *only when size is "0".

This is what I have;

nullPos = thisComp.layer("Null 2").transform.position;
if (content("Ellipse 1").content("Ellipse Path 1").size<=0)
{
nullPos;
}
else
{
value;
}

Currently, what happens is that the Ellipse just stays blinking in the one spot, or follows the position of the null at every frame.

I thought the conditional 'if' statement would get around the fact that AE asseses expressions on each frame.

I'm new to this - please help me before I eat my keyboard in frustration!

Many Thanks

Markus

nullPos = thisComp.layer("Null 2").transform.position;
if (content("Ellipse 1").content("Ellipse Path 1").size&lt;=0)
{
nullPos;
}
else
{
value;
}


Return to posts index

Markus Stone
Re: Referencing another layers position only if size =0
on Aug 12, 2019 at 6:27:25 am

I also tried this way, where I explicitly assign the value to thisPos and return that value. No luck.

nullPos = thisComp.layer("Null 2").transform.position;
thisPos = value;

if (content("Ellipse 1").content("Ellipse Path 1").size <= 0)
{
thisPos=nullPos;
}
else
{
thisPos=value;
}
thisPos;


Return to posts index

Markus Stone
Re: Referencing another layers position only if size =0
on Aug 12, 2019 at 9:29:55 am

I'm trying to do this





Such that it only ever requires six layers to render the dots.

I know trapcode particular can do this, but trying to avoid spending $1000 when I feel this must be possible with expressions. Besides, I might learn something.

M


Return to posts index


Markus Stone
Re: Referencing another layers position only if size =0
on Aug 16, 2019 at 4:52:02 am

No takers? Is this harder than it looks?


Return to posts index

Dan Ebberts
Re: Referencing another layers position only if size =0
on Aug 16, 2019 at 8:58:53 pm

It's definitely do-able, but the algorithm is probably a little tricky. Basically, the expression for each layer has to know which of the 6 instances he is. Then based on the current time and the loop time it needs to calculate when his current cycle started and use that with valueAtTime() to get where the null was at that time. The details will depend on how you have things set up.


Dan



Return to posts index

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