Skip to main content
Participant
July 22, 2024
Question

Luminence drives effects values

  • July 22, 2024
  • 1 reply
  • 1015 views

Hey AE Users! I’m looking for a creative solution using expressions or by any other means.



Is there a way to drive the value strength of an effect via luminence map?



For example, if “Shape Layer 1” has the effect simple choker, I want the choke matte value to be controlled by the luminance intensity for layer “Gradient Map.”

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
July 22, 2024

Assuming your gradient map is a comp-sized layer centered in the comp, and you want to sample an area of the gradient under the anchor point of the shape, you could use something like this for the Choke Matte property:

 

r = .5; // sample radius
maxChoke = 50; // max value for Choke Matte

L = thisComp.layer("Gradient Map");
p = transform.position;
c = L.sampleImage(p,[r,r],true,time);
hsl = rgbToHsl(c);
linear(hsl[2],0,1,0,maxChoke)

 

Community Expert
July 23, 2024

Once again, Dan Ebberts nails it. I have about ten animation presets that use his basic expression to examine different layer color values by sampling part of the image, converting the color information, and then applying different interpolation and Java math formulas to the resulting values. Many of them are tied to some tracking information so that I can specifically target specific areas of the comp.