Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Nested Comp Expression

  • Nested Comp Expression

    Posted by Brian Walsh on October 28, 2011 at 5:12 am

    Hey all,
    Im not an expression whiz, but I know a little bit.
    I wanted to know if there is a way for an expression to refer to a layer inside the comp in which it is nested without actually typing out the name of the comp it is nested within. To clarify, as far as I know AE allows you to refer to “thisComp” or another comp by name. But Im working on a project where if I could easily refer to the comp which that layer is nested within, it would save me a LOT of trouble. Any help would be appreciated.

    Walter Soyka replied 14 years, 6 months ago 3 Members · 2 Replies
  • 2 Replies
  • Michael Szalapski

    October 28, 2011 at 1:41 pm

    You can open up the timeline for both comps and pickwhip between them.

    – The Great Szalam
    (The ‘Great’ stands for ‘Not So Great, in fact, Extremely Humble’)

    No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.

  • Walter Soyka

    October 28, 2011 at 2:34 pm

    [Brian Walsh] “I wanted to know if there is a way for an expression to refer to a layer inside the comp in which it is nested without actually typing out the name of the comp it is nested within.”

    Not automatically. It’s a scope problem — the precomp has no idea what (if anything) it’s nested within.

    You can, however, use an object so that you’d only have to refer to the main comp once. Open your expression with:
    c = comp("Main Comp");

    Now, instead of continually referring to comp(“Main Comp”) in your expression, you can use c as a kind of shorthand:
    c.layer("Black Solid in Main Comp").transform.position

    You can also change which composition the entire expression refers to by changing only that first line.

    Walter Soyka
    Principal & Designer at Keen Live
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    RenderBreak Blog – What I’m thinking when my workstation’s thinking
    Creative Cow Forum Host: Live & Stage Events

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