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

showing expression errors, while there are technically none

New Here ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

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

TOPICS
Error , Feedback , Question

Views

297

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
Adobe Employee ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

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

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 ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

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

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 ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

Hi John, thx for looking into this.

 

My specs: MacOS Ventura 13.2.1  / AE Beta 23.4.0

2,4 GHz 8-Core Intel Core i9 / AMD Radeon Pro 5500M 8 GB
Intel UHD Graphics 630 1536 MB / 64 GB 2667 MHz DDR4

 

So I tested this morning with an oversimplified version of my jsx file..

In the current releases 22/23 of AE there is no problem, but in the Beta version I get errors..

The crazy thing is that sometimes I get 1 or 2 errors & sometimes I get none, but that's probably because this script is so simple. I can assure you that on a larger script with way more things going on I get a lot of "non-existing" errors..

I also get more errors when the composition window is closed before running the script (which is the case in my larger setup).

Another strange thing is that there's a difference in how the errors are shown, depending if your layers are set to layerNames or sourceNames (see attachment).

 

And yes I need to set expressions before names are changed or effects are added 🙂

So below is a simple jsx script to test, hope you can encounter the same issue.

 

/*
_ Just add a compostion and insert a solid layer.
_ With the composition selected in the project panel, run this simple script.
*/

app.beginUndoGroup("z");

if(app.project.activeItem == null || !(app.project.activeItem instanceof CompItem)) {
    alert("Select a comp..");
}else{
    var activeComp = app.project.activeItem;
    var cmpName = activeComp.name;
    var lay = activeComp.layer(1);
    var layName = lay.name;

    // just a precomp & set some expression to - currently none existing - name and layerFX
    var preComp = activeComp.layers.precompose([1], layName, false);
    var preLay = preComp.layer(1);

    preLay("ADBE Transform Group").property("ADBE Opacity").expression = 'comp("' +  cmpName + '").layer("someFX").effect("slide")(1)';
    preLay("ADBE Transform Group").property("ADBE Scale").expression = 'comp("' +  cmpName + '").layer("renamed")("ADBE Transform Group")("ADBE Scale")';

    // add 
    activeComp.layers.addNull();
    fxNull = activeComp.layers[1];
    fxNull.selected = false;
    fxNull.source.name = "someFX";
    fxNull.enabled = false;
    fxNull.guideLayer = true;

    var pr = fxNull.property("ADBE Effect Parade").addProperty("ADBE Slider Control");
    pr.name = "slide";
    fxNull.effect("slide")(1).setValue(66);
    fxNull.effect("slide")(1).expression = 'clamp(effect("slide")(1),0,100);';
    pr.enabled = true;

    activeComp.layer(2).name = "renamed";

    activeComp.openInViewer();
};  
app.endUndoGroup();

 

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 ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

Hi @JohnColombo 

Perhaps I should have tagged you.. no hurries, thx

 

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 ,
Apr 17, 2023 Apr 17, 2023

Copy link to clipboard

Copied

As primarily a Mac user, I wasn't aware this is also a Windows thing. I asked chatGPT who gave me the solution... "To address the issue while still using composition, layer, and effect names, you can escape the double quotes in your expressions".

 

So these are the lines to change in the above code to get it working on Windows:

# Note: still having issues in the Mac Beta version..

 

preLay("ADBE Transform Group").property("ADBE Opacity").expression = 'comp(\"' + cmpName + '\").layer(\"someFX\").effect(\"slide\")(1)';
preLay("ADBE Transform Group").property("ADBE Scale").expression = 'comp(\"' + cmpName + '\").layer(\"renamed\")(\"ADBE Transform Group\")(\"ADBE Scale\")';

fxNull.effect("slide")(1).expression = 'clamp(effect(\"slide\")(1),0,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
New Here ,
Apr 17, 2023 Apr 17, 2023

Copy link to clipboard

Copied

this is annoying, why can't I edit my posts on this site?.. last call to someone who knows... yes, on a Mac there's the same issue as well, forgot to turn on my show errors bar in the settings 😞 But, still the code works fine, but the errors are just simply not true. Anyone?

 

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
Adobe Employee ,
Apr 17, 2023 Apr 17, 2023

Copy link to clipboard

Copied

Thank you for your patience @Jochem.dk. I am down at NAB this week, but I will be more deeply investigating this expression behavior once I return. The inability to edit to related to the maturity of your forum account; newer accounts are not allowed to edit posts until a certain number of posts.

 

Cheers,

- John, After Effects Engineering Team 

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 ,
Apr 29, 2023 Apr 29, 2023

Copy link to clipboard

Copied

Hi @JohnColombo ,

The only thing which seems to be working is..

1. setting an expression

2. immediately turn in it off: .expressionEnabled = false;

3. do all the rest

4. at the very end turn all expressions on / to true

 

Isn't there a more elegant way? The problem is I have to go through multiple compositions twice (potentially hundreds..), which will take unnecessary extra time. Hope to hear from you, tia, Jochem

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
Adobe Employee ,
May 02, 2023 May 02, 2023

Copy link to clipboard

Copied

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 

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 ,
May 06, 2023 May 06, 2023

Copy link to clipboard

Copied

LATEST

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

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
Resources