ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Controlling color with checkbox controller

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Christian Simpson
Controlling color with checkbox controller
on Sep 5, 2017 at 11:43:07 pm

I was wondering if there was a way to control the color values used with the Fill effect based on whether a checkbox was checked or not. For example if i had a solid with the fill effect applied and I had an adjustment layer with 32 different checkboxes. One checkbox could be named Red, the other Blue and so on. Is there a way depending on which checkbox I check that the color values I assign in the expression become active? In other words multiple instances of if/else?


Return to posts index

Dan Ebberts
Re: Controlling color with checkbox controller
on Sep 6, 2017 at 6:31:04 am

Sure, here's a simple example with 5 colors:


L = thisComp.layer("Controls");
if(L.effect("Red")("Checkbox").value)
[1,0,0,1]
else if (L.effect("Green")("Checkbox").value)
[0,1,0,1]
else if (L.effect("Blue")("Checkbox").value)
[0,0,1,1]
else if (L.effect("Yellow")("Checkbox").value)
[1,1,0,1]
else if (L.effect("Orange")("Checkbox").value)
[1,.5,0,1]
else
value;


Dan



Return to posts index

Christian Simpson
Re: Controlling color with checkbox controller
on Sep 6, 2017 at 5:59:06 pm

You're wonderful Dan, thank you very much for your expertise. Worked like a charm


Return to posts index

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