-
Multiple checkbox related to each other with expressions
Hi guys,
I’ve been trying quite hard to get this to work but I can’t seem to figure it out alone.
I have 3 checkbox controls, each one a different layer (A, B, C).The idea is a three way checkbox selection which coordinates with each other in the following way:
1. If A Checkbox is Enabled, then B Checkbox is Disabled.
2. If B Checkbox is Enabled, then A Checkbox is Disabled.
3. If C Checkbox is Enabled, then A Checkbox & Checkbox B are Enabled.
So I created an expression (attached below) and pasted it in layers A & B (switched around the X/Y in layer B). Layer C has no expressions, only the checkbox control.
Up to here, everything works fine..
The problem is that I’m getting all kinds of strange behaviours from different layers doing things they’re not meant to do..
Many different layer properties around the project are connected to the these checkboxes. For example – if Checkbox A is Enabled – Layer White opacity is 100% – Which means – Layer Black opacity is 0%. This happens because layer Black is connected to Checkbox B which is now disabled because A is Enabled. (When Checkbox B is disabled, Layer black opacity goes to 0%).
Wow I hope I’m describing this well enough..
Until now it’s was all working great. But then.. I have another layer. This layer is has a ‘fast blur’ effect, and the fast blur properties are connected to layer D’s Slider control. Layer D has no relationship whatsoever to Layers A, B or C.
But – when I slide layer D slider, suddenly layers a & b switch their opacity values. A goes to 0% opacity and layer B goes to %100. i.e. Layer A’s checkbox ticks off and B’s ticks on.
I’ve double and triple checked everything and I really can’t find any relationship between the two things. I assume there is something I am not familiar with about expressions.
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.
Many thanks,
Danielx = thisComp.layer("a").effect("Use This")("Checkbox");
y = thisComp.layer("b").effect("Use This")("Checkbox");
z = thisComp.layer("c").effect("Use This")("Checkbox")if ( x == 1) {
y = 0;
}if ( x == 0) {
y = 1;
}if ( z == 1) {
y = 1;
}
After Effects Template & Photoshop Tutorials:
https://www.amigo-productions.com

