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?
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
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
Copy link to clipboard
Copied
Hi Dan,
Thanks a lot, it helped me!
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
Copy link to clipboard
Copied
Wow, rude much? Typical internet know it all, belittles others for not knowing something but offers no solutions.
Copy link to clipboard
Copied
pompous taint