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

Scale Expression Problem in After Effects

Explorer ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

Screen Shot 2019-01-16 at 2.20.40 PM.png

Hi, I wrote an expression to flip my character's head. I think I have the 2 value of the scale, but it still shows that expression result should be of dimension 2, not1.

Here is my expression:

x = thisComp.layer("C | head").effect("Head_Flip")("Checkbox");

if(x == 0) Scale = [100, 100] if(x == 1) Scale = [-100, 100]

What's the problem?

Views

3.4K

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 , Jan 16, 2019 Jan 16, 2019

Over complicating and poor formatting. Try this:

if (effect("Checkbox Control")("Checkbox") == 0 ) {value} else [-100, 100]

Votes

Translate

Translate
Community Expert ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

Over complicating and poor formatting. Try this:

if (effect("Checkbox Control")("Checkbox") == 0 ) {value} else [-100, 100]

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
Explorer ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

Awesome! Even though I still don't know where is the problem, but your expression works great. Thanks a lot~

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 Expert ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

LATEST

Don't need Scale - That alone would generate an error. The operator after the if statement needs to be in brackets, just stringing together if statements is sloppy and you are missing the brackets again. Multiple if statements work sometimes but are easy to foul up.

if (condition == something) {do this} else do this

or

if (condition == something) {do this} else if (condition == something else) {do this}

If there is nothing in brackets there is nothing for the if statement to do.

You should spend a little time with the expression language guide in the User Manual. The new engine is even more picky about proper formatting.

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