Copy link to clipboard
Copied
Hello!
I'm trying to export the comps I create with my script to AME.
On the documentation, I've found the
app.project.renderQueue.queueInAME(boolean)
function, but it is giving me serious problems.
When I try to run the script from the Visual Studio Code plugin, I get:
An exception I catch:
After Effects error: internal verification failure, sorry! {Bad rq item index.}
And this error pops up in After Effects:
After Effects: AEGP Plugin AEDynamicLinkServer: Failed to connect to Adobe Media Encoder. (5027 :: 12)
And the project does an immediate "Undo" (so all the comps the script creates are gone)
This DOES NOT happen if I just run the script from After Effects, with no debugger attached.
This is the code I use:
/**
* Adds comps to Adobe Media Encoder Queue
* @Param {CompItem[]} comps Comps array to add to AME
*/
function addToAMEQueue(comps){
var date = getDateYYMMDD();
var outputPath = getDirectoryPath(app.project.file.fullName) + date + "/";
for(var i = 0; i < comps.length; i++){
var resultFile = new File(outputPath + comps[i].name);
var render = app.project.renderQueue.items.add(comps[i]);
render.outputModules[1].file = resultFile;
}
if(app.project.renderQueue.canQueueInAME){
app.project.renderQueue.queueInAME(false);
}
}
Note: getDateYYMMDD() and getDirectoryPath() are functions I tested, they should not be the problem.
Does anyone have an insight on why this happens?
It's more out of curiosity that a practical problem, since in the end, it still works.
Thanks
Copy link to clipboard
Copied
Quick update, in case someone else finds this
The issue was with the app.beginUndoGroup().
Initially, the process of adding the comps to the render queue
var render = app.project.renderQueue.items.add(comps[i]);
was in between app.beginUndoGroup() and app.endUndoGroup()
Putting it after the app.endUndoGroup() solved the problem.
Though now I can't undo the comp creation process.... damn you ExtendScript