-
Referencing a parent of a comp
Hi,
I’m still pretty new to After Effects, though not programming. I was creating an animation of a cube, where each side had a piece of text on it. I precomped the side and the text, and created 4 different precomps like this, one for each side. I wanted to use these precomps in a variety of other comps, and the transparency of the text on the various sides would change, depending on which parent comp it was placed in. I wanted to do this by creating a null object in the parent comp, naming it “Side1-Opacity”, adding a slider effect to it, and then referencing that slider in an expression for the transparency of the text in the included comp. This would essentially allow “parameters” to be passed to the precomps. The expression I wanted was:
thisComp.parent.layer(“Side1-Opacity”).effect(“Slider Control”)(“Slider”)
But evidently this is not possible. I read in another post that you can reference parent comps by name, and I have done this before, but it would defeat the “reuseability” of the precomps. I eventually solved it by pulling the sides, text, etc. out and putting them all into a single comp, and using parenting to do it. This was possibly the most elegant way to do this particular thing, but I know this will come up again, and was just wondering if there was some workaround out there for finding the parent of a comp.Thanks
Brian