I’ve been trying quite hard to get this to work but I can’t seems to figure it out alone.
I have 3 checkbox controls, all in one layer (R, B, G) to control three colour or anything for example if I checked R then my colour layer will change to Red and if I checked B it will change to Blue and so on based on the three combine checkboxes . And the rule for that is “if R checked in the box then the others un-checked and vice versa”.
The idea is a three way checkbox selection which coordinates with each other in the following way:
It’s seems like all work fine but when I checked the boxes nothing would change on the effected layer that I linked it with all checkboxes. If you managed to understand what I’m trying to do, I’d love to hear your thoughts about this and what I am doing wrong.
Here more details
I use this expression for each checkbox
R checkbox:
R = effect("R")("Checkbox");
T = effect("B")("Checkbox");
C = effect("G")("Checkbox");
if ((T == 1) || (C == 1)) {false} else true;
B checkbox:
R = effect("R")("Checkbox");
T = effect("B")("Checkbox");
C = effect("G")("Checkbox");
if ((R == 1) || (C == 1)) {false} else true;
G checkbox:
R = effect("R")("Checkbox");
T = effect("B")("Checkbox");
C = effect("G")("Checkbox");
if ((T == 1) || (R == 1)) {false} else true;
And on the effected layer I did this rule:
Red = thisComp.layer("Red").effect("Fill")("Color");
Blue = thisComp.layer("blue").effect("Fill")("Color");
Green = thisComp.layer("Green").effect("Fill")("Color");
R = thisComp.layer("Controler").effect("R")("Checkbox");
B = thisComp.layer("Controler").effect("B")("Checkbox");
G = thisComp.layer("Controler").effect("G")("Checkbox");
if (R==1) Red;
else if (B==1) Blue;
else if (G==1) Green;
else value;
To be honest I don’t understand exactly what you’re trying to do, but if you want to have 3 options to control colors, wouldn’t it be easier to have 3 separate adjustments layer for each color and connect the opacity of the layer?
So you make 3 adjustments layers with red / green / blue fill colors, and you turn them on/off with the expression controls, through opacity. So, for example you add the expression to the opacity of the RED adjustment layer to something like
Thank you for your replay. I actually attached the project.
Basically I need to do three colour options only one of them must be selected at a time so for example if I select Red colour then the other two options (Blue & Green) will be deselected automatically.
Thank you very much GTMotion!
I followed your expressions. It’s very good solution but the only problem left when I try to check and unchecked the checkboxes the colour solid layer not responded.
I think it’s impossible to do, because AE don’t “understand” the time when you press on checkbox. All 3 expressions in checkboxes works instantly (upper expression works first, then goes the second, then the lowest one. But this rule not always true.)
So to work it correctly you need some kind of “mechanism”, that disables all checkboxes’ expressions and triggers them when you press on one of checkbox. I think it’s impossible, but may be you are smarter then me.
Sorry SkillLine. I don’t install CC versions on my PC because it isn’t good enough for CC versions, then I can’t go forward with you. I hope another guy helps you out on newer versions.
Many thanks GTMotion and DOGmotion,
Actually the problem in the software itself not in the expression and it’s not good idea to use this method for customers and . It’s really huge wast of time. Maybe I’ll go to the slider like GTmotion said.