Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
2

After Effects - Checkbox Control expression to fill effect.

Community Beginner ,
Mar 07, 2020 Mar 07, 2020

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!

15.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Mar 07, 2020 Mar 07, 2020

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.

 

image.png

Translate
Valorous Hero ,
Mar 07, 2020 Mar 07, 2020

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.

 

image.png

Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 07, 2020 Mar 07, 2020

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 07, 2020 Mar 07, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 08, 2020 Mar 08, 2020

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

Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 08, 2020 Mar 08, 2020

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 30, 2023 Jan 30, 2023
LATEST

Just used this as well. Thank you very much 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 14, 2022 Jul 14, 2022

Thanks! just found this and it works a treat for the mogrts I just had to make 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines