Copy link to clipboard
Copied
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.”
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thanks for the reply, Mr Ebberts. It's close, however not quite what I'm looking for, so I'll see if I can rephrase the original question.
Yes, my gradient map is comp-size. It's a standard horizontal linear gradient: white to black, from left to right.
I'm looking to use this image map to taper the choke matte strength on an oblong shape.
Is such a thing possible in AE?
Copy link to clipboard
Copied
Try using the Gradient Ramp layer as a Luminosity Track Matte for an Adjustment layer above the layer you want to choke. Pre-compose all layers and adjust the opacity of the Luma Matte layer or the Matte Choker.
Copy link to clipboard
Copied
Thanks so much for taking the time to test this out, @Rick Gerard. This setup certainly uses the gradient map, but unfortunatly the outer transparency of the shape and it's unrefinment defeats what I'm trying to accomplish. I'll have to to figure out another means.
Copy link to clipboard
Copied
Nothing keeps you from using the gradient to affect Gaussian Blur or any other effect to achieve different levels of control over the layers below. Matte choker does not create a soft edge. Here's what I got with the Gradient as a luma matte for Gaussian Blur and Directional Blur.
The rings are from the GIF's compression.
Copy link to clipboard
Copied
Another possibility, which depends on what your oblong shape looks like, would be to build the shape using a createPath() expression which would use sampleImage() to modify the position of the points based on the underlying gradient. It might be possible but not practical, or it might make sense, depending on your setup.