Skip to main content
Participant
June 29, 2023
Question

Opacity expression based on gradient or noise layer

  • June 29, 2023
  • 1 reply
  • 539 views

I am sure this should be a simple one but just can't find the right one that works. I want the opacity of a shape layer to be controlled by the white values on a gradient or noise layer. So I need to sample the area the shape layer travels over and vary opacity acordingly (ie when it travels over a full white area the opacity is set to 100 and when it travels over a black area its opacity is 0).

This topic has been closed for replies.

1 reply

Mylenium
Legend
June 29, 2023
Daz2811Author
Participant
June 29, 2023

Yep. Saw that tutorial but need to know how to apply that to opacity. 

Dan Ebberts
Community Expert
Community Expert
June 29, 2023

Something like this should work for opacity:

C = thisComp.layer("Gradient").sampleImage(position,[.5,.5],true,time);
L = rgbToHsl(C)[2]*100