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

if statement and array values

Community Beginner ,
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

Im trying to build an essential graphics template in After Effects. I want to use a slider control (clamped with "Math.floor(clamp(value, min=1, max=2));") to control the scale an object.  I guess the issue is that scale is an array and not a single value. What's the best way to solve this?

myVar =  thisComp.layer("Control-layer").effect("Slider Control")("Slider");

if(myVar == 1)100 else 50;

thanks

//Si

TOPICS
Expressions

Views

567

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Oct 11, 2018 Oct 11, 2018

Like this maybe:

myVar =  thisComp.layer("Control-layer").effect("Slider Control")("Slider");

s = (myVar == 1) ? 100 : 50;

[s,s]

Dan

Votes

Translate

Translate
Community Expert ,
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

Like this maybe:

myVar =  thisComp.layer("Control-layer").effect("Slider Control")("Slider");

s = (myVar == 1) ? 100 : 50;

[s,s]

Dan

Votes

Translate

Translate

Report

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 Beginner ,
Oct 12, 2018 Oct 12, 2018

Copy link to clipboard

Copied

LATEST

Many thanks! That works like a charm.

Votes

Translate

Translate

Report

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