Skip to main content
Participant
July 29, 2022
Question

proximity expression based layer width

  • July 29, 2022
  • 1 reply
  • 141 views

 

 

 

i want an expression that changes the transparency of a nearby layer to 100 depending on the text length

 

there is my code

target = thisComp.layer("dddddd").sourceRectAtTime();
dist = Math.floor(target.width, target.height);
maxSize = thisComp.layer("Null 1").effect("maxSize")("Slider");
minSize = thisComp.layer("Null 1").effect("minSize")("Slider");
range = thisComp.layer("Null 1").effect("range")("Slider");
sensitivity = thisComp.layer("Null 1").effect("sensitivity")("Slider");
opacity = linear(dist, range, sensitivity, maxSize, minSize);

This topic has been closed for replies.

1 reply

Mylenium
Legend
July 29, 2022

I'm not clear what you mean by "nearby layer". The position of the text? How are the bars even created? That said, why not simply create the opacity using simple compositing techniques? I feeel you are making this way too complicated. All that would be required to duplicate the layer and use it as a track matte. It may just need to be expanded heavily with an outer glow and possibly be quantized to match the grid of the bars with e.g. a Mosaic effect, then perhaps soem more finetuning at the edges with sime soft linear wips that match the text width. Other than that latter point I really can't see what use expressions would have here. Again, I feel you're approaching this completely the wrong way.

 

Mylenium