ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Index of thiscomp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gabriel Silva
Index of thiscomp
on Mar 4, 2020 at 10:42:07 pm

Folks. I have A precomp A, and within that precomp A I have a pre-comp B, within composition B I want a text.
I would like the text to follow the precomp B Index.

Can you help me I'm desperate!
Sorry for google translator!


Return to posts index

Dan Ebberts
Re: Index of thiscomp
on Mar 4, 2020 at 10:53:48 pm

What do you mean by pre-comp B index? Do you mean the layer index of the pre-comp B layer within precomp A? Something like this:

comp("precomp A").layer(thisComp.name).index


Dan



Return to posts index

Alex Printz
Re: Index of thiscomp
on Mar 5, 2020 at 3:11:36 pm

Compositions in and of themselves do not have indexes; they are entirely object orientated based on their name. They only get layer indexes when they are precomps inside another comp.

Dan's solution seems right, but if you are looking for the inverse of that where Comp B is inside Comp A and has a specific index, you could do the code below.

The strength in this method is you can swap out the compB's with many different precomps all with different text layers inside each, and your compA will update it's expression.

i = 3; //comp B's exact layer index inside compA;
comp(thisComp.layer(i).name).layer("text layer 1").text.sourceText;


Alex Printz
Mograph Designer


Return to posts index


Gabriel Silva
Re: Index of thiscomp
on Mar 10, 2020 at 3:26:55 pm

OMG Thanks!! It helped me a lot! You are awesome!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]