-
Layer count
Hi everyone,
I’ve posted a question about cloning objects before, and right now I’m trying to do another trick with the cloned layers.
The basic question I’ve been trying to find an answer to is – is there a way to count the number of layers I have in a particular composition?
The extended version of the question is as follows. I have an X number of duplicates of a layer, and I would like to change the opacity from 100% to 0% linearly from the topmost to the last layer. The formula is quite easy but it requires knowing how many layers there are in the comp. The trouble is, this.layer(y), is a method and not an object. The comp() object has no count or length property or method, like the length property of an array would have, and AE seems to internally somehow store layer objects separately and just provide the layer method for us to access them.
Either way, I can’t at this point figure out how to count the layers even if I know how to reference them, so any help would be appreciated. I mean, I can probably just have a predicted number of duplicates but I’d rather leave as much as I can to the MACHINE.
THANKS in advance.
P.S. Almost certain the answer is somewhere under my nose but I keep thinking it’s more complicated than it is.