Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to find the index of a nested comp in it’s parent comp?

  • How to find the index of a nested comp in it’s parent comp?

    Posted by Carey Pagan on June 23, 2017 at 8:38 am

    I want to create an expression on a layer of a comp, that references the comp’s index inside the parent comp.

    Something like

    index = comp(“Parent Comp”).thisLayer.index

    is there a way?

    Dan Ebberts replied 8 years, 10 months ago 3 Members · 3 Replies
  • 3 Replies
  • James Ronan

    June 23, 2017 at 8:51 am

    Almost!

    index = comp(“Parent Comp”).layer(“Child Comp”).index;

    Replace Child Comp with whatever your precomp is named.

  • Carey Pagan

    June 24, 2017 at 5:46 am

    Yeah I knew it could be referenced by name but there are more than 50 instances of the same pre comp so I really wanted a way to have their expressions reference the index of that particular instance of the pre comp inside it’s parent comp.

    Is there any other way to get a reference to ‘self’ like in c?

  • Dan Ebberts

    June 24, 2017 at 6:32 am

    There’s no way to do that. Otherwise, you could have the same precomp rendering differently in different layer instances, which can’t happen.

    Dan

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