Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Evaluate expression at time

  • Evaluate expression at time

    Posted by Loris Grifa on January 25, 2018 at 12:14 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

    Kevin Camp replied 8 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kevin Camp

    January 25, 2018 at 6:21 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

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