-
Find how many layers with the same name there are in the comp?
Hi there. I need to find out how many layers with the same name there are in the Comp.
For exemple, I have 1 layer called “Lord Scales” and I duplicate it several times. I’d like to know if there is a way to find out how many layers with the name “Lord Scales” are there in the comp.
I have got this in the opacity:
for (i=1; i<=thisComp.numLayers;i++) { a = 1; //number of layers with the same name L = thisComp.layer (i); if (L.name == name) a++; } value/(a-1) I need the value of "a", but if I duplicate my layer nothing happens to the opacity of the first one. The value of "a" doesn't change as I duplicate the layers. I changed the expression several times but it never works as I want. What is going wrong? Thank you.