ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How to get the layer with the biggest width in an a group of layers

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
ayoub gharafi
How to get the layer with the biggest width in an a group of layers
on Jun 11, 2020 at 12:25:38 am

Hey guys basically I have 6 text layers ,

Line01
Line02
Line03
Line04
Line05
Line06

and I want to get the value of the one with the biggest:

sourceRectaAtTime().width


Return to posts index

Dan Ebberts
Re: How to get the layer with the biggest width in an a group of layers
on Jun 11, 2020 at 12:36:55 am

There are a lot of ways to do it--this is one:


names = ["Line01","Line02","Line03","Line04","Line05","Line06"];
w = 0;
for (i = 0; i < names.length; i++){
w = Math.max(w,thisComp.layer(names[i]).sourceRectAtTime(time,false).width);
}
w



Dan



Return to posts index

ayoub gharafi
Re: How to get the layer with the biggest width in an a group of layers
on Jun 11, 2020 at 12:16:21 pm

Thanks man , That will do it ,Do you have an online course or something I am ready to pay for it , thanks again


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]