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

Range Selector /Advanced/Mode question

New Here ,
Mar 15, 2025 Mar 15, 2025

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!

TOPICS
Expressions
86
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
New Here ,
Mar 15, 2025 Mar 15, 2025

bogdand55626760_0-1742058840288.pngexpand image

Here is a screenshot

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 15, 2025 Mar 15, 2025
LATEST

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. 

 

 

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