Skip to main content
Jochem.dk
Participating Frequently
April 11, 2023
Question

showing expression errors, while there are technically none

  • April 11, 2023
  • 2 replies
  • 804 views

Hi, I'm setting lots of expressions to comps & layers via a jsx file.

In current versions I have no problems, but the Beta app (23.4.0) gives me errors, while there are none...

 

What the issue probably is, is that I'm setting e.g.

_ references to effects (and ffx files) which are not applied yet

_ linking to layer names in compositions which are renamed afterwards in the jsx file etc...

 

So it seems that the Beta version is evaluating expression on the fly, while current AE versions check the expressions afterwards.

I tried to fix some issues with "autoFixExpressions", but that doesn't work in this case...

 

Is there anything to worry about when the new release comes out, or will this behaviour of "evaluating expressions" change?

The reason I ask, is because it's a bit clumsy to go through "expression errors" only to click them away and be totally fine at the end.

 

Anyhow, hope to hear from you, Jochem

This topic has been closed for replies.

2 replies

JohnColombo17100380
Community Manager
Community Manager
May 2, 2023

Hi @Jochem.dk,

Thank you for your patience. I was able to give your script a try and found that the errors are not specific to the latest Betas (I could repro them in AE 2022) and that they are related to rendering and expression evaluation.

 

Expressions are not always re-evaluated when applied—they get re-evaluated when a frame is rendered. In the case of your script, the script created a pre-comp and added expressions within it, but the frames within the pre-comp were not re-rendered when the item names changed because nothing had changed within the pre-comp. This led to the errors you saw when the names of items in the project changed; the expressions were not able to re-evaluate and have their errors resolved as they usually would when the name of a referenced item changed.

 

To prevent the errors, you can do a couple of things:

  1. Open the pre-comp in the Viewer after creating the expressions e.g. preComp.openInViewer(); after line 21.
  2. Disable and re-enable each expression as they are applied using the .expressionEnabled attribute of the property.

 

The second option above requires a little more code, but I've found it to be more reliable in preventing errors like the ones you saw, due to variability in render performance and the synchronous nature of the scripting. This works both in previous versions and the latest Beta builds.

 

Cheers,

- John, After Effects Engineering Team 

Jochem.dk
Jochem.dkAuthor
Participating Frequently
May 6, 2023

Hi John,

I get it and was also afraid of this answer 🙂 Since there's no such thing as a global project "reset evaluation", I prepared my script like I mentioned in my previous comment. Thx anyway, perhaps this reset evaluation thing would be a nice addition for a next update? Cheers, Jochem

JohnColombo17100380
Community Manager
Community Manager
April 11, 2023

Hi @Jochem.dk,

Thank you for posting about this issue. Would you be able to share a sample project with a .jsx data file that exhibits this issue, along with the steps to reproduce the errors? And what are your system details?

 

Seeing issues in the Beta that aren't occurring in the release version is an indicator that a recent change may have introduced a bug and we would like to investigate it before it is released to all customers. Your report appears to indicate that expression evaluation has already changed, hence our need to investigate.

 

Thank you again for posting about this and for any further info,

- John, After Effects Engineering Team

Jochem.dk
Jochem.dkAuthor
Participating Frequently
April 11, 2023

Yes, sure - first thing in the morning!

I’ll make a super simple file to reproduce the issue, shouldn’t be a problem :}
Too busy now, kind regard, Jochem