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

Render from AE to AME one by one with extendscript

Explorer ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

Hello, I am trying to write an automated renderer script that sends comps from AE to AME to render in mp4 format, with this code

 

function AMErender(comp, outPath) {
  var bt = new BridgeTalk();
  if(!BridgeTalk.isRunning("ame")){
    BridgeTalk.launch("ame-14.0", "background") 
  }
  var project = app.project;
  var renderItem = project.renderQueue.items.add(comp)
  renderItem.outputModule(1).file = File(outPath);
  project.renderQueue.queueInAME(true);
  
}

 


Everything works fine, but  "AMErender(comp, outPath)" function is running inside a loop and when I run script I get all comps that I want to render in one queue, both in ae and ame:

Screenshot 2022-10-05 at 21.42.09.pngScreenshot 2022-10-05 at 21.41.45.png

 

But I want the comps to be added and rendered one by one:
1. comp is added to ae render queue;
2. comp is rendered in ame
3. comp is removed both from ame and ae queues
4. repear for next comp

How is it possible to do?

TOPICS
Dynamic link , How to , Import and export , Scripting

Views

159

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 ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

I don't think this is in any way feasible, simply because you won't know when an AME comp has finished nor could you interactively check the status in AE. To my knowledge you can't even cleanly determine the status of a RQ item after it's done and if you blindly check the status, of course your script will simply stop to work or the render stop with an error.

 

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
Explorer ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

Thank you Mylenium for the quick answer 

what do you think is there a way to run a separate asynchronous function that constantly checks "BatchItem.encodeProgress" and batchitem name to determine when the encoding process for the particular comp is finished? I think this function should aslo somehow tell to the main jsx file to sleep until the batchitem is not finished

 

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 ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

I'd have to check it, but I think there is a watch folder function that can trigger a dialog or function and that might be a way to ascertain whether a file is actually finished without having to actually check progress. Otherwise I can't think of much.

 

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
Explorer ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

LATEST

I had to come up with a temporal, I think propabably buggy, workaround for ae part of my question - 
I am checking for renderItem.status == "QUEUED" in a while() loop, once status is changed to something else, that means the item is sent to ame/ error occured and I can remove it from RQ to add another comp. I think renderItem.onstatus does the same thing. 
However I am still not sure how to detect whether ame has rendered file or not on another side. PPro has onEncoderJobComplete function and 
Encoder.encodeSequence() where the 4th argument is 0 or 1, if 1 the item is remove from batch upon rendering is done

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