Quantcast
Channel: Adobe Community : Popular Discussions - After Effects Expressions
Viewing all articles
Browse latest Browse all 47983

Change opacity precomp layer expression

$
0
0

Hi,

 

I want to control my precomp layers opacity within my maincomp by changing the layername.

For example: If my layer name(in the maincomp) is "A" only the layer called "A" in the precomp will show.

 

I allready wrote an expression:

 

if (comp("Main Comp").layer("A").name == ('A'))

{temp_opacity = 100};

else

{temp_opacity = 0};

temp_opacity

 

But the problem is, there need to be multiple precomps controlled in the main comp. And if both precomps are called "A" the script fails.

So maybe I need to have a control in the expression that will check which precomp it needs to use. (the sourse.layer.)

 

I'm trying the figgure it out last two weeks without succes, so if anyone can help me I'll be very thankfull!

 

JW


Viewing all articles
Browse latest Browse all 47983

Trending Articles