Activity › Forums › Adobe After Effects Expressions › Expression language to say “any layer”
-
Expression language to say “any layer”
Posted by Jetcityj on March 5, 2007 at 2:52 amI was wondering if there was code to say “any layer” or thisComp.”any layer”?
Thanks
JCJJetcityj replied 19 years, 2 months ago 2 Members · 4 Replies -
4 Replies
-
Dan Ebberts
March 5, 2007 at 4:03 amNot directly. You can loop through all the layers though, which might give you what you’re after. What are you trying to do?
Dan
-
Jetcityj
March 5, 2007 at 4:26 amwell I am trying to write this in expression langauge:
if any layer’s scale is greater than 100
then move left if, any layer on the right is larger,
if not, then move right if any layer on the left is larger -
Dan Ebberts
March 5, 2007 at 5:53 amIt might look something like this:
v = value; for (i = 1; i <= thisComp.numLayers; i++){ if (i == index) continue; if (thisComp.layer(i).scale[0] > 100){ d = (thisComp.layer(i).scale[0] - 100) * thisComp.layer(i).width / 200; if (thisComp.layer(i).position[0] > position[0]){ v -= [d,0]; }else{ v += [d,0]; } } } vDan
-
Jetcityj
March 5, 2007 at 3:05 pmwoah! thanks, this might take me a while to decipher, thanks for getting me started.
Reply to this Discussion! Login or Sign Up