How to script "Create Proxy -> Movie..."

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
mobopro

I'm trying to script something equivalent to the "Create Proxy -> Movie..." command available in After Effects 6.5. With the following code, I seem to get the same results, except for one thing... The render queue item shows the proxy that'll be set when the render completes is for "This Comp" instead of the footage I'm trying to create it for.

That is, if I create a proxy in AE manually for a clip of footage called "b", the post-render proxy will be "b" -- but if I do so with my code it'll be "This Comp".

Any idea how to fix this?

Code: Select all

if (folder.item(i) instanceof FootageItem) {
  var curItem = folder.item(i);
  var newName = myCompName(curItem.name);
  if (curItem.duration == 0 || curItem.frameRate == 0)
    compItem = folder.items.addComp(newName, curItem.width, curItem.height, curItem.pixelAspect, myProjectComp.duration, myProjectComp.frameRate);
  else
    compItem = folder.items.addComp(newName, curItem.width, curItem.height, curItem.pixelAspect, curItem.duration, curItem.frameRate);
  compItem.layers.add(curItem);
  app.project.renderQueue.items.add(compItem);
  var numq = app.project.renderQueue.numItems;
  var q = app.project.renderQueue.item(numq);
  q.applyTemplate("Draft Settings");
  q.outputModule(1).applyTemplate("Lossless with Alpha"); 
  q.outputModule(1).file = new File(newLocation.toString() + "/" + newName + ".mov"); 
  q.outputModule(1).postRenderAction = PostRenderAction.SET_PROXY;
}
Post Reply