FORUMS: list search recent posts

Controlling the opacity of a nested comp from the main comp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kieren Smith
Controlling the opacity of a nested comp from the main comp
on Oct 24, 2012 at 3:10:23 am

Hey AE Expression Geniuses, I'm using a composition of a car, and the "Car" comp contains an "indicators" comp.

I have multiple "Main" comps that will be using the "Car" comp.
What I need to do is be able to change the opacity of the "Indicators" comp from which ever "Main" comp contains the "Car" comp.

The comps are like so: Main comp> contains car comp> contains indicator comp...

I want to be using this same "Car" comp in many different "Main" comps...

So applying the following code to the Opacity of the "Indicator" comp won't work for me:

comp("Main").layer("indicator Control").effect("Slider Control")("Slider")

Is there any way I can create some sort of global variable that can be controlled by a slider in multiple "Main" comps and can change the Opacity of the "Indicator" Comp?

I think I just explained it several times in that message... Any Way Can this be done?


Return to posts index

Darby Edelen
Re: Controlling the opacity of a nested comp from the main comp
on Oct 24, 2012 at 4:51:48 am

The only way to control this on a per-main-comp basis would be to keyframe the opacity in the Car comp, apply time remapping in the Main comp to the Car comp and create an expression to transition from the Car comp's indicator 'opaque' to 'transparent' state.

Of course what this means is that you can't really have other animation in your Car comp as it's timeline will now be controlled separately in the many Main comps.

If needed you may be better off splitting the Car comp into separate compositions for this. Moving the Indicator comp from the car comp into the associated Main comps and then parenting the Indicator to the Car comp in that Main comp should probably work in most cases.

Darby Edelen


Return to posts index

Dan Ebberts
Re: Controlling the opacity of a nested comp from the main comp
on Oct 24, 2012 at 4:52:09 am

No, you can't do it with a single instace of a pre-comp. That's one of the things about a pre-comp--it gets rendered once. So it can't be different in one parent comp than it is in another.

You would have to duplicate the pre-comp in the project bin, then each main comp could have its own copy of the pre-comp. Then with clever naming, expressions in the precomp can figure out which main comp they're in. For example, an expression in pre-com Car_1 could figure out that Car_1 is nested in Main_1. Something like that.

Dan



Return to posts index

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