I would like to remove the auto numbering but attempts have eluded me thus far.
Code: Select all
function renderstillstofiles(){
var activeItem = app.project.activeItem;
if (activeItem == null || !(activeItem instanceof CompItem)){
alert("You need to select some layers first.");
}else{
var selectedLayers = activeItem.selectedLayers;
app.beginUndoGroup("render stills to files");
var rq;
var rq = app.project.renderQueue.numItems;
//$.writeln('rq: ' + rq);
var Location = folderGetDialog("Select a destination...");
for (i = 0; i < selectedLayers.length; ++i) {
currentLayer = selectedLayers[i];
// render queue does not seem to be zero based so we need to offset by +1
var currentrq = rq+i+1;
// get the start time
var xstarttime
xstarttime = currentLayer.startTime
// output variables to the console window (for debugging)
// $.writeln('values: ' + currentLayer.name + ' : ' + xstarttime);
// add the frames to the render queue
app.project.renderQueue.items.add(activeItem);
app.project.renderQueue.item(currentrq).timeSpanStart = xstarttime;
// value can not be 0 - or so it seems so we use the min value of 0.04
app.project.renderQueue.item(currentrq).timeSpanDuration = 0.04;
OutputMO = app.project.renderQueue.item(currentrq).outputModules[1];
OutputMO.applyTemplate("Targa File");
OutputMO.file = new File(Location.toString() + "/" + currentLayer.name + "_([#]) .tga");
}
}
}
renderstillstofiles()