Range Selector /Advanced/Mode question
Copy link to clipboard
Copied
Hello friends, I ran into a problem
I want the parameter Range Selector /Advanced/Mode switching using the checkbox controller
For example, if the check box is off, value Add
If the check box is on, value Substract
Please respond, knowledgeable friends! I am very bad at expressions
Chat GPT does not know anything about this))
effect("Reverse Direction")("Checkbox") == 1 ? 1 : 0;
this code doesn't work
Thanks in advance!
Copy link to clipboard
Copied
Here is a screenshot
Copy link to clipboard
Copied
In my experience, using Chat GBT to help or create expressions for After Effects has a success rate of about 10%.
Numbers, not names, drive menus like the Range Selector/Advanced/Mode. The numbers start from 1, not zero.
The easiest way to understand what is going on is to use an if/else statement:
ctrl = effect("Checkbox Control")("Checkbox");
if (ctrl == 0)
1;
else
2;
Without an if statement, the expression would look like this:
ctrl = effect("Checkbox Control")("Checkbox");
ctrl == 0 ? 1 : 2;
Setting up an Effect/Expression Control as a variable is always a good idea. The ctrl checkbox switch starts at 0 for not selected, then goes to 1.

