Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Turn Layers on/off with Luma Matte

  • Turn Layers on/off with Luma Matte

    Posted by Jay Ingles on January 12, 2011 at 4:52 pm

    I’m trying to turn a wall of layers on/off (or individually scale from 0 to 100 to 0) with a luma matte but don’t know where to start. In the image below i want to have simple black/white rings of a circle growing that define which balls are visible…similar to an LED screen.

    I’ve had luck with QubaHQ’s light wall tutorial but don’t know how to apply this to layers vs lights.

    Any help is appreciated.
    Thanks

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

    January 12, 2011 at 6:09 pm

    you could use sampleImage() in each layer’s opacity (or scale) property to sample your luma matte.

    to make the expression easier, i would probably convert your luma matt to an alpha with an effect like channel combiner (set from>luminance and to>alpha only).

    then the expression for opacity would look like this:

    target=thisComp.layer(“luma matte”); // set this to your luma matte layer
    target.sampleImage(position, radius = [.5, .5], postEffect = true, t = time)[3] * 100

    or scale:

    target=thisComp.layer(“luma matte”);
    s=target.sampleImage(position, radius = [.5, .5], postEffect = true, t = time)[3] * 100;
    [s,s]

    depending on how you want things to work, you could set the sampleImage sample radius to use the layer’s width & height by changing radius to [width/2,height/2].

    if you wanted the layer to be eight on or off (nothing in between), you could add a rounding function to the sampleImage value like this:

    Math.round(target.sampleImage(position, radius = [.5, .5], postEffect = true, t = time)[3]) * 100

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

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