-
Select specific values and get the maximum value from the selection.
Hi all,
Here’s what I’m trying to do.
I have 6 text layers and trying to get a longest width value from the only ones that are 100 opacity.
Here’s the code I got so far and trying to get // parts.
Please let me know if anyone has any advise. Thanks!t1_opc = thisComp.layer(“text1”).transform.opacity;
t1_w = thisComp.layer(“text1”).sourceRectAtTime().width;t2_opc = thisComp.layer(“text2”).transform.opacity;
t2_w = thisComp.layer(“text2”).sourceRectAtTime().width;t3_opc = thisComp.layer(“text3”).transform.opacity;
t3_w = thisComp.layer(“text3”).sourceRectAtTime().width;t4_opc = thisComp.layer(“text4”).transform.opacity;
t4_w = thisComp.layer(“text4”).sourceRectAtTime().width;t5_opc = thisComp.layer(“text5”).transform.opacity;
t5_w = thisComp.layer(“text5”).sourceRectAtTime().width;t6_opc = thisComp.layer(“text6”).transform.opacity;
t6_w = thisComp.layer(“text6”).sourceRectAtTime().width;// Select the text layers with 100 opacity from t1 - t6;
// Add the selected text layers into the bracket bellow to get the maximum width from the selection.
// max_w = Math.max(selection)max_w