-
listing a neighbouring comps layers on a text layer
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
//endPete
roguekeyframe.com