Change property of layer in precomp

Scripting for After Effects

Change property of layer in precomp

Postby anewfoundflo on 03/17/2015, 8:49 am


I'm slowly going nuts and I can't seem to find the answer to my problem anywhere.

Withing my master comp I have a precomp. So far so good. Now I want to change the opacity of one layer in this precomp right from the master comp.
Pick-whip is not an option since I am planning of having about 60 instances of this one precomp in my master comp and I need to be able to change the opacity of this one layer via an expression on the precomp in the master comp.

So the setup would look like this:

Master comp:

I would like to do something like this (but it's not working):

On a slidercontrol as an effect on precomp I'd put an expression similar to this:
comp("precomp").layer("precom_layer").transform.opacity = 100;

I have the feeling I am really close but can't seem to find this simple term I need to use.
Can anybody help please?
Posts: 48
Joined: 11/10/2009, 2:45 pm
Location: Europe
Twitter: floriankozak

Re: Change property of layer in precomp

Postby 0ather on 03/21/2015, 11:21 am

Hi !

You just have add a null on the Master_comp and add a slider effect on it. Go into your precomp, alt-click on the opacity clockwatch of the precomp_layer and type:

comp("Master_comp").layer("Null").effect("Slider Control")("Slider");

From here you can change the opacity of the precomp_layer from the Null in the Master_comp ;)

Posts: 4
Joined: 03/21/2015, 11:17 am

Return to After Effects Expressions