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

Evaluating property expressions consistently not working from scripting

New Here ,
Jul 16, 2024 Jul 16, 2024

Copy link to clipboard

Copied

[NOTE: I have tried to upload repro .zip, but it system didn't allow me to do so, so I have uploaded it as .pptx (this forum does not allow uploading of .zip / .aep / .jsx / ...). To repro the issue please download repro.pptx attachment and then rename it to repro.zip]

 

Hi, I have an issue to report, related to the expression evaluation from scripting. If you are to open project, to add expression and to read its value inside of the same script, results might be invalid (they are reproducibly invalid for sampleImage at least). If you were to open project inside of the script, then finish the script, then add expression and read its value inside of another script everything would work as expected.

 

I have much more complicated examples, but attached is the minimal repro - I'm using sample image to detect whether image has any transparency (it does not). script1.jsx, which does everything inside a single script, returns that image is transparent, which is wrong. script2.jsx which opens project in script, and then schedules everything else in another script returns image is not transparent, which is correct. You could invoke these scripts from the console and look for the result in the console, something like the attached screenshot.

 

Again, I have much more complicated examples, this is the minimal repro of the problem. You can imagine all the problems that this can cause, mainly code based, as app.schelduleTasks() needs to be used and everything needs to be written in callbacks, and callbacks cause hell.... And in general, that is not correct behavior and you should jump through loops to find this kind of workaround.

 

PS. Even worse, if in script1 I render the comp with the footage and the text, text is correctly rendered out as false, even though its value is true in scripting both before and after the render. So, in the same script:
  1. I prepare everything and get the text layer value - it is true
  2. I render it out - in the render it is false (attached)
  3. After the render I get the text layer value - it is still true
Bug Acknowledged
TOPICS
Expressions , Scripting

Views

217

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 Pinned Reply

Adobe Employee , Aug 06, 2024 Aug 06, 2024

Thanks for the info! We'll take a look and see if we can reproduce. Thanks for bringing it to our attention!

Status Acknowledged

Votes

Translate

Translate
6 Comments
New Here ,
Jul 16, 2024 Jul 16, 2024

Copy link to clipboard

Copied

PPS. Forgot to mention, tried to invoke 'Convert Expression to Keyframes', it sets invalid values at keyframes as well. For reference, this is the change at the end of script1.jsx that shows it off:

 

comp.openInViewer();
textLayer.sourceText.selected = true;
app.executeCommand(2639);
writeConsole("is transparent: " + textLayer.sourceText.keyValue(1).text);
 

Votes

Translate

Translate

Report

Report
New Here ,
Jul 17, 2024 Jul 17, 2024

Copy link to clipboard

Copied

PPPS. Another thing to add is that this expression is evaluated correctly if you sleep for a few seconds. However, I have expressions where sleeping does not help at all, they are always invalid until evaluated in another script (those are more complicating so I didn't want to include them in this minimal repro).

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Aug 05, 2024 Aug 05, 2024

Copy link to clipboard

Copied

Hi @skvifi,

 

Thanks for the detailed report! Could you let me know what build of After Effects and Windows you are using?

 

Thanks!
Theresa 

Status Needs More Info

Votes

Translate

Translate

Report

Report
New Here ,
Aug 06, 2024 Aug 06, 2024

Copy link to clipboard

Copied

Hi Theresa!

 

It's reproducing both on AE 24.5.0 (Build 52) and AE beta 24.6.0 (Build 59). As far as I know this bug exists for a long time, I had this issue before, I think I first met this behavior ~3 years ago.

 

Windows (11 Pro) version is 10.0.22621 Build 22621

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Aug 06, 2024 Aug 06, 2024

Copy link to clipboard

Copied

Thanks for the info! We'll take a look and see if we can reproduce. Thanks for bringing it to our attention!

Status Acknowledged

Votes

Translate

Translate

Report

Report
New Here ,
Sep 06, 2024 Sep 06, 2024

Copy link to clipboard

Copied

LATEST

Any update?

Votes

Translate

Translate

Report

Report