Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Index of thiscomp

  • Index of thiscomp

  • Gabriel Silva

    March 4, 2020 at 10:42 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!

  • Dan Ebberts

    March 4, 2020 at 10:53 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(


  • Alex Printz

    March 5, 2020 at 3:11 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

  • Gabriel Silva

    March 10, 2020 at 3:26 pm

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

Viewing 1 - 4 of 4 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy