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

After Effect CC2019 expression issue

Community Beginner ,
Oct 15, 2018 Oct 15, 2018

Copy link to clipboard

Copied

Hello! In the new version СС2019, an expression error began to appear, which was not in the version of cc2018. For example in this:

ch = thisComp.layer("Settings").effect("Flip Motion")(1);

if(ch == 0){100}

if(ch == 1){-100}

This is one example. Most likely from the lack of a "else". But I have a lot of such expressions in projects and these projects are for thousands of clients. Why has the processing of expressions changed in the new version?

Views

7.6K

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 15, 2018 Oct 15, 2018

The new JavaScript expression engine is more strict about if/else syntax. You can either switch your project back to the legacy engine

File > Project Settings > Expressions > Legacy ExtendScript

or change your syntax to something the new engine accepts. In your case, I think I'd do this (I'm assuming your control is a checkbox):

ch = thisComp.layer("Settings").effect("Flip Motion")(1).value;

ch ? -100 : 100

Dan

Votes

Translate

Translate
Community Expert ,
Oct 15, 2018 Oct 15, 2018

Copy link to clipboard

Copied

The new JavaScript expression engine is more strict about if/else syntax. You can either switch your project back to the legacy engine

File > Project Settings > Expressions > Legacy ExtendScript

or change your syntax to something the new engine accepts. In your case, I think I'd do this (I'm assuming your control is a checkbox):

ch = thisComp.layer("Settings").effect("Flip Motion")(1).value;

ch ? -100 : 100

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 15, 2018 Oct 15, 2018

Copy link to clipboard

Copied

Hi Dan,

Thanks a lot, it helped me!

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
LEGEND ,
Oct 15, 2018 Oct 15, 2018

Copy link to clipboard

Copied

The new engine evaluates whole blocks/ structures, not line by line like the old one. Hence your old code won't work since it's actually terrible (or even wrong in the strictest sense). You'd have much less of a problem had you actually cared to write it correctly in the first place.

Mylenium

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 ,
Dec 07, 2018 Dec 07, 2018

Copy link to clipboard

Copied

Wow, rude much? Typical internet know it all, belittles others for not knowing something but offers no solutions.

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
New Here ,
Aug 16, 2019 Aug 16, 2019

Copy link to clipboard

Copied

LATEST

pompous taint

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