ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Control opacity with two layers

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Saso Goricar
Control opacity with two layers
on Jan 13, 2020 at 4:25:10 pm

Hey guys, I have a question. I'm creating a template in AE and is it possible to control the opacity of one layer with two different controls. I created one "menu control" and one "checkbox control" to control opacity.

Is this possible? I wrote an expression myself and is not working. If this is possible, what did I missed in expression?

var menu = comp("MOGRT").layer("MOGRT Controls").effect("Position")("Menu");
var opa = comp("MOGRT").layer("MOGRT Controls").effect("StrokeAnimation")("Checkbox");

if (menu == 1 || opa == 1)
{100}
else if (menu == 1 || opa == 0)
{0}
else
{0}


Thanks for the help.

Saso


Return to posts index

Dan Ebberts
Re: Control opacity with two layers
on Jan 13, 2020 at 5:23:49 pm

I haven't tested this, but give it a try:

var menu = comp("MOGRT").layer("MOGRT Controls").effect("Position")("Menu").value;
var opa = comp("MOGRT").layer("MOGRT Controls").effect("StrokeAnimation")("Checkbox").value;

(menu == 1 || opa) ? 100 : 0


Dan



Return to posts index

Saso Goricar
Re: Control opacity with two layers
on Jan 13, 2020 at 7:01:42 pm

Unfortunately, this is not working for me. Any other ideas maybe?
Thanks, Saso


Return to posts index


Dan Ebberts
Re: Control opacity with two layers
on Jan 13, 2020 at 7:09:11 pm

Assuming the expression is not throwing an error, what is the exact behavior you're looking for?


Dan



Return to posts index

Saso Goricar
Re: Control opacity with two layers
on Jan 15, 2020 at 3:17:04 pm

Hello,

I managed to solve it. I will control stroke opacity of the shape layer (checkbox control) and opacity of the whole layer with menu control

ae-text-1.png

Thanks for all the suggestions.

Saso


Return to posts index

Saso Goricar
Re: Control opacity with two layers
on Jan 15, 2020 at 3:18:55 pm

Wrong picture in the previous post:


Return to posts index

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