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

Update legacy expressions script leaves errors

Explorer ,
Apr 05, 2019 Apr 05, 2019

Copy link to clipboard

Copied

I have LOTS of expresssions in my project, and I'm trying to update them to the new Javascript engine using the built-in "Update legacy expressions script".

However, some syntax errors still persists.

Take the following for example:

if (value<1) res=1;

if (value>maxValue) res=maxValue;

If I add "else before the second if, the error resolves (and I understand why).

However, I have thousands of such cases. Is there anyway to automatically fix them?

Thank you

Views

904

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 ,
Apr 05, 2019 Apr 05, 2019

Copy link to clipboard

Copied

I guess theres no straight way to fix this automatically.

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 ,
Apr 05, 2019 Apr 05, 2019

Copy link to clipboard

Copied

Is there anyway to automatically fix them?

Nope. The only reason it ever worked in the old engine is mere stepping order and consecutive steps overriding previous ones. Since the new engine evaluates the function as a whole this no longer works, but it is also unable to make any sense of operation precedence of older code if it lacks the proper keywords. I'm afraid you realyl have to tiptoe through each and every one of your expressions and fix them manually.

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 Expert ,
Apr 05, 2019 Apr 05, 2019

Copy link to clipboard

Copied

If you really need to get an old expression to work quickly you can just open up the project settings and choose to use the legacy expression engine. That will make the project work in newer versions.

Screenshot_2019-04-05 08.16.21_pCjLD9.png

When you get the time you can go through the projects that don't work and take a look at the expressions and manually update them.  That is what I am doing with the about 140 custom presets that I have created and linked by an alias to my Effects and Presets panel.

Screenshot_2019-04-05 08.20.29_gxHuu6.png

When the new expression engine came out I had more than 270 presets in this folder that I use all the time. About 80% of the ones that I have checked so far did not need any modifications. All of the edited ones and the ones that work have been moved into the JavaScript Presets folder. It's going to take a while to get them all checked, fix the ones that need fixing, and move them into the new folder. Once you have done a few it becomes easier to see and fix the syntax. The good news for me is that most of mine still work. More than 90% of the motion graphics (explainer videos) that I do are completely driven by expression-based animation presets that I have created over the years to automate the process. Just for fun here's one that I use a lot. Put a layer in a comp, set the hero position including scale and rotation, set in and out points and the layer will fly in from the left, bounce to a stop, then fall off the screen all by itself. Dropbox - flyInBounceDropOut.ffx

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 ,
Apr 06, 2019 Apr 06, 2019

Copy link to clipboard

Copied

Thanks Rick

I did notice that feature of switching the legacy expressions on/off, but with thousands of errors in my expressions I don't think I'll ever be able to upgrade this project to use the new Javascript

Sounds like you've got a lot of work waiting for you too!

Nice preset you have there, saved it to use it myself as well

Thank you!

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 ,
Apr 06, 2019 Apr 06, 2019

Copy link to clipboard

Copied

By the way, that preset did not need an update.

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

LATEST

You saved my life! Thank you!!!

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