Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Highlighting Shaper layer using sampleImage

  • Highlighting Shaper layer using sampleImage

  • Wyatt Woolley

    May 5, 2020 at 4:31 am

    Attempting to Create a Gauge Risk Chart, like those fire danger signs. High risk-Red, Moderate risk-Orange, Low risk-Yellow, No Risk-Green.

    Attempting to use sampleImage to highlight the colors, but whenever the null is tied to anything, like the needle pointer in the middle, it stops working.

    I tried to load the project, only 285 KB but Creative Cloud won’t do it.

    p = thisComp.layer("Null 2").transform.position
    s = thisLayer

    a = s.sampleImage(p,[.1,.1])[3]

  • Robert Müller

    May 5, 2020 at 10:36 am

    if you parent your null to another layer, the position of the null will always be relevant to the parent layer. You need to use “toComp” (or “toWorld” for 3d layers) to get the global position of your null.

    p = thisComp.layer("Null 1").toComp(anchorPoint);
    s = thisLayer;

    a = s.sampleImage(p,[.1,.1])[3];

Viewing 1 - 2 of 2 posts

Log in to reply.

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