Copy link to clipboard
Copied
Hello! How can I create an expression for checkbox Control to "Fill" effect in a PNG logo? I would like that when the checkbox is marked, the logo takes on the solid color filling, and when disabled keep the original colors of the logo. Can anyone help me with this issue? Thanks!
This is the Expression you need -
if(effect("Checkbox Control")(1)==1) {100} else {0}
--------------
The image below provides context on where to apply the Expression.
Copy link to clipboard
Copied
This is the Expression you need -
if(effect("Checkbox Control")(1)==1) {100} else {0}
--------------
The image below provides context on where to apply the Expression.
Copy link to clipboard
Copied
Thanks for the answer! I don't know if I did something wrong, but the checkbox only worked when the checkbox control was applied to the same layer as the fill, my intention is to use the checkbox applied to a layer of controllers, created from a null object. After Effects pointed out an error in the expression when used in this way (I applied the expression in the location indicated in the image you sent and with the pick whip I applied the Effect Opacity of the Fill to the checkbox control placed on the null object, I got an error).
What could I have done wrong?
Copy link to clipboard
Copied
You have to point the expression to the layer that contains the checkbox. Expression basics.
The easiest solution is to declare a variable for the checkbox control by typing something like this:
chkBx = thisComp.layer("Null 1 Controller").effect("Checkbox Control")("Checkbox");
if (chkBx == 1)
100
else
0
This assumes the layer that contains the Checkbox Control is named "Null 1 Controller" and you have not renamed any of the layers. I prefer this format because it is very easy to tell what you are doing.
You can easily define a layer and effect control by simply typing chkbx = and then dragging the pickwhip to the Checkbox Control's Checkbox.
Copy link to clipboard
Copied
Buds, take a closer look at the screen grab I posted - you're supposed to apply the Expression to the Effect Opacity which is WITHIN the Compositing Options section of the effect. This is different from the Fill Effect's Opacity prop. The Compositing Options section is only visible in the Timeline. HTH
Copy link to clipboard
Copied
I had an error in my expression but I found the reason. I applied the "Fill" effect to my layer and the CheckBox Control to my null object called "EXPRESSION CONTROLS". I renamed the CheckBox Control to "LOGO FILL". I put the pick whip from the Effect Opacity of the Fill to the CheckBox Control of my null object and got this expression:
if (comp ("COMPOSITIONS"). layer ("EXPRESSION CONTROLS"). effect ("LOGO FILL") ("Checkbox")
so I added the final part of the expression:
(1) == 1) {100} else {0}
And I got:
if (comp ("COMPOSITIONS"). layer ("EXPRESSION CONTROLS"). effect ("LOGO FILL") ("Checkbox") (1) == 1) {100} else {0}
But for some reason I got an error in the expression. After a while I discovered that I would have to delete the ("Checkbox") of the expression to work correctly, so my expression is working. It looked like this:
if (comp ("COMPOSITIONS"). layer ("EXPRESSION CONTROLS"). effect ("LOGO FILL") (1) == 1) {100} else {0}
I don't know why the expression obtained by the pick whip did not work correctly, only when I deleted the part ("Checkbox").
Anyway it's working now! Thank you all for your help!
Copy link to clipboard
Copied
Just used this as well. Thank you very much 🙂
Copy link to clipboard
Copied
Thanks! just found this and it works a treat for the mogrts I just had to make
Find more inspiration, events, and resources on the new Adobe Community
Explore Now