Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

listing a neighbouring comps layers on a text layer

Cow Forums : Adobe After Effects Expressions

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
listing a neighbouring comps layers on a text layer
by Peter O'Connell on Aug 26, 2008 at 12:36:51 am

Hello expression enthusiasts. I am working on a text layer expression that gathers info about neighbouring layers. What I want to do is have the text layer list every layer of the comp that it is above (so that I don't have to open the comp to have a peak what's in it). The expression work fine as long as the text layer is directly above a comp, but if it is above any other kind of layer I get an error. So I am having trouble building the "If the layer is a comp then... else "The layer below this one is not a comp!"" business
Here is the code I have so far which works above a comp only.


//start
var compBelowName = comp((thisComp.layer(index+1)).name).name
var compBelow = comp((thisComp.layer(index+1)).name)

s = "";
i = 1;
while (true){
try{
s += comp(compBelowName).layer(i).name;
}catch (err){
break;
}
i++;
s += "\r";
}

s
//end



Pete

roguekeyframe.com


Respond to this post   •   Return to posts index

Re: listing a neighbouring comps layers on a text layer
by Dan Ebberts on Aug 26, 2008 at 2:04:26 am

You were pretty close:

try{
compBelow = comp((thisComp.layer(index+1)).name);
s = "";
for (i = 1; i <= compBelow.numLayers; i++){
s += compBelow.layer(i).name + "\r";
}
s
}catch (err){
"The layer below this one is not a comp!"
}

Dan



Respond to this post   •   Return to posts index

Re: listing a neighbouring comps layers on a text layer
by Peter O'Connell on Aug 26, 2008 at 2:57:14 am

Thanks Dan
Pete

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]