Naming Outpoutfiles

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
User avatar
kweso
Posts: 3
Joined: February 19th, 2019, 7:46 am

March 29th, 2019, 6:58 am

Hey,
would it be possible to send a comp to rq while the output would be jpgs. But instead of one sequence with frame numbers i'd like to have multiple rq-items each rendering one frame which would be named after the content of a textfield at that specific frame.

could not find the solution on http://docs.aenhancers.com/renderqueue/renderqueueitem/#

something like:
for (i = 0; i < framecount; i++){
activeComp.addToRenderQueue(om = "JPG", name = activeComp.layer("name").text.sourceText.value, startRange = i, range = 1);
}

TYVM!
kws
User avatar
kweso
Posts: 3
Joined: February 19th, 2019, 7:46 am

April 3rd, 2019, 3:00 am

Figured it out by myself:

Code: Select all


var activeComp = app.project.activeItem;
var  selectedComps = app.project.selection;
var nameLayer = activeComp.layer("name");
var frameNumber = activeComp.workAreaDuration / activeComp.frameDuration;
var title = "";
var output = "";
if(activeComp != null && activeComp instanceof CompItem){
    for( i = 0; i < frameNumber; i++){
            title = nameLayer.text.sourceText.valueAtTime(i * activeComp.frameDuration, false);
            var renderInstance = app.project.renderQueue.items.add(activeComp);
            renderInstance.applyTemplate("Best Settings");
            renderInstance.timeSpanDuration = activeComp.frameDuration;
            renderInstance.timeSpanStart = i * activeComp.frameDuration;
            renderInstance.outputModules[1].applyTemplate("jpg");
            var outMod = renderInstance.outputModule(1);
            var file_name = File.decode(String(activeComp.name) + "_" + String(title) + "_[##]");
            var new_path = outMod.getSettings(GetSettingsFormat.STRING)["Output File Info"]["Base Path"];
            var new_dir = new Folder( new_path );
            new_path = new_dir.fsName;

            var new_data = {
                "Output File Info":
                {
                    "Base Path":new_path,
                    "Subfolder Path": activeComp.name,
                    "File Name":file_name
                }
            };
            outMod.setSettings( new_data );
    }
} else {
    alert("Select a Comp first!");
}

Post Reply