Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Luminence drives effects values

New Here ,
Jul 22, 2024 Jul 22, 2024

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.”

TOPICS
Expressions , How to , Resources , Scripting
634
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 22, 2024 Jul 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)

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 22, 2024 Jul 22, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 22, 2024 Jul 22, 2024

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 22, 2024 Jul 22, 2024

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. 

RickGerard_0-1721705347190.gif

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 23, 2024 Jul 23, 2024

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 23, 2024 Jul 23, 2024
LATEST

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.

RickGerard_0-1721799246754.gif

The rings are from the GIF's compression.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 23, 2024 Jul 23, 2024

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines