ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Nested Comp Expression

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Brian WalshNested Comp Expression
by on Oct 28, 2011 at 5:12:09 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.


Return to posts index

Michael SzalapskiRe: Nested Comp Expression
by on Oct 28, 2011 at 1:41:12 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.


Return to posts index

Walter SoykaRe: Nested Comp Expression
by on Oct 28, 2011 at 2:34:46 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


Return to posts index

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