FORUMS: list search recent posts

Evaluate expression at time

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
loris grifa
Evaluate expression at time
on Jan 25, 2018 at 12:14:25 pm

Hi to everybody,

i've got a question for you all. I'm using the espression below to evaluate the first pixel on X coordinate at fixed Y.


L = thisComp.layer("00_LAYOUT_SOTTOPANCIA_STILL");
w =L.width;
h = 355;

K=0;

for (i = 0; i < w;i++)

{

p = L.sampleImage([i,h], [.1,.1]);

if (p[3]>0.999)

{K=i; i=w}

}

K


It works fine, but the value is calcolated on every frame of the composition.

How can i "say" to AE to evaluate the result in a specific moment on the timeline?

Thank


Return to posts index

Kevin Camp
Re: Evaluate expression at time
on Jan 25, 2018 at 6:21:27 pm

sampleImage() has a time parameter: sampleImage(point, radius = [.5, .5], postEffect = true, t = time)

so you could p to this: p = L.sampleImage([i,h], [.1,.1], true, 5);

sample image would then only sample the frame at 5 seconds.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

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