FORUMS: list search recent posts

Layer In-Point based on Null x-position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Cory Cullington
Layer In-Point based on Null x-position
on Oct 7, 2014 at 5:58:53 pm

I'm hoping that I can get a bit of advice for the animation I'm trying to script.

A bit of background info:
I have a map of the US that has potentially hundreds of pins spread across it. These pins are each instances of a small video (150x250 pixels) rendered out with an alpha channel so that they begin to scale up from 0% at t=0 and then sit at their final scale for the rest of the animation.

What I was hoping to achieve is, in essence, "the wave" from screen left to right, based on the x-position of a null object. As the null passes the x-positions of the pin layers, the layers would begin playing from t=0.

So I suppose what I would be altering would be each layer's in-point, and I would be placing this expression on each pin layer.

I hope the description is clear enough. Thank you for any / all advice! =)


Return to posts index

Cory Cullington
Re: Layer In-Point based on Null x-position
on Oct 7, 2014 at 7:09:31 pm

Update: The expression that I have right now is operation on the Time Remap property of my pin.

The null object passes the xPos of the pin at 3:14, at which point the pin layer jumps to a Time Remapped position of 3:14. I tried adding in timeRemap-time, but because the time value constantly updates, that results in a value of 0:00:00:00.

Is there any way to start the Time Remap fresh from 0 as soon as else is triggered?

if (thisComp.layer("Null 1").transform.xPosition<transform.xPosition) {
time=0
}else{
timeRemap
}


Return to posts index

Dan Ebberts
Re: Layer In-Point based on Null x-position
on Oct 8, 2014 at 12:12:18 am

Triggers can be tricky beasts. This should be close to what you're looking for though:


P = thisComp.layer("Null 1").transform.xPosition;
threshold = transform.xPosition;
trig = false;
for (f = timeToFrames(time); f >= 0; f--){
tCur = framesToTime(f);
v = P.valueAtTime(tCur);
if (trig && (v < threshold)) break;
if (v >= threshold) trig = true;
}
t = trig ? time - framesToTime(f+1) : 0;



Dan



Return to posts index


Cory Cullington
Re: Layer In-Point based on Null x-position
on Oct 8, 2014 at 12:22:29 am

Thanks so much, Dan! Was exactly what I was looking for. Would it be possible for you to make a few notations on what the lines are accomplishing for me?


Return to posts index

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