Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
Matt_B
Topic Author
Posts: 1
Joined: Fri Aug 03, 2007 2:25 am
Location: London

RENDER QUEUE SCRIPT QUESTION

Tue Aug 14, 2007 6:04 am

HELLO ALL

JUST A QUICK QUESTION REGARDING RENDER QUEUES AND MORE SPECIFICALLY THE 'OUTPUT TO' TAB AREA. DOES ANYONE KNOW OF A SMALL BIT OF SCRIPT THAT I CAN ADD TO THE 'OUTPUT TO' INFO THAT WILL AUTOMATICALLY CREATE A NEW FOLDER IN THE NAME OF THE QUEUED COMP, FOR EACH NEW RENDER IN SAID QUEUE.
I OFTEN HAVE TO CREATE QUITE LARGE RENDER QUEUES OF TGA SEQUENCES AND I FIND CREATING ALL THE SEPERATE FOLDERS FOR THE SEQUENCE'S TO GO IN RATHER LABOUR INTESIVE.

ANY ADVISE ON THIS WOULD BE GREAT.

THANKS
 
Paul Tuersley
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Tue Aug 14, 2007 6:25 am

You can't add a script to that "Output To" section. It just allows you to create a template to control the name of the render in various ways.

To automatically create new folders for each render in the queue, you'll need a regular script that you'd run from the File > Scripts menu. This post may be of some help: http://aenhancers.com/viewtopic.php?t=310
 
Paul Tuersley
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Tue Aug 14, 2007 4:21 pm

This script will take the existing render path for each queued render item, create a new folder at that location with the current comp name, and then set the file path for that render to inside the new folder.

Paste the code into a text/script editor, then save with a .jsx file extension into the AE Scripts folder.

If you try removing the "//" before each "alert" line in the script, it may help you understand what the script is doing. Typically I'll use lots of alerts when writing a script as it's very handy for tracking down errors.

{
   // define variables
   var thisRender, newPath, i, j;
   var renderQ = app.project.renderQueue;
   //alert("there are " + renderQ.numItems + " render queue items");
   
   // loop through each renderQueue item, checking if any are queued
   for (i = 1; i <= renderQ.numItems; ++i) {
      
      // check if the render item is queued
      if (renderQ.item(i).status == RQItemStatus.QUEUED) {
      
         // shortcut variable for render item   
         thisRender = renderQ.item(i);
         
         //alert(thisRender.comp.name + " is queued");   
         //alert("it has " + thisRender.outputModules.length + " output modules");
         
         // loop through any output modules
         for (j = 1; j <= thisRender.outputModules.length; ++j) {
         
            //alert("current path is " + thisRender.outputModule(j).file.path);
            newPath = thisRender.outputModule(j).file.path + "/" + thisRender.comp.name;
            //alert("path for new folder is " + newPath);
            
            // create a new folder
            Folder(newPath).create();
            
            newPath += "/" + thisRender.outputModule(j).file.name;
            //alert("new path for this render is " + newPath);
            
            // set the new file path
            thisRender.outputModule(j).file = new File(newPath);
            
         }   
      }
   }
}
 
tristan15
Posts: 1
Joined: Tue Apr 26, 2011 12:33 pm

Re: RENDER QUEUE SCRIPT QUESTION

Tue Apr 26, 2011 1:56 pm

Thanks Paul, this was extremely helpful to me. I was able to modify this script to automatically place render queue items in specific folders within a file structure based on the shot code in DPX naming, without having to set any "output to" settings. This has saved me days of work. Instead of using the file.path from the render queue, I am grabbing it from my source object, then using that path to build a new file path where i want my comp to render. I think it is important to note that the name of your output is going to be whatever is after the last "/" of your newPath, and your newPath can be any path you choose. So in my case I declared a new var to create the right naming. I then create two folders, and the folder inside will be the correct naming for my render queue item. After the folders are made and AE sets the correct output name, the script then deletes the folder that is labeled (var outputName).

var outputName = fileName + ".[####].jpg"

//creates path for new folder
var newPath = (platesFolder + "/" + fileName + "_1k_jpg" + "/" + outputName);

//creates folder with name fileName_1k_jpg and create folder inside of it with proper naming for output jpeg sequence fileName.[####].jpg folder at path
Folder(newPath).create();

// forces AE to make output at end of path/ takes (var ouputName) as Name
qItem.outputModules[1].file = new File(newPath);


// declares var for folder created at end of path
var deleteFolder = Folder(newPath);

//deletes this unnecessary folder
deleteFolder.remove();




Almost four years since your post, and still extremely useful. Thank you!
 
dj_lino
Posts: 1
Joined: Mon Mar 12, 2012 9:51 am

Re: RENDER QUEUE SCRIPT QUESTION

Thu Mar 15, 2012 8:56 am

Hi, I know this is an old thread but it definitely needs to be seen! I just signed up to this website to make this post.

Thanks very much for this script. Helped loads with exporting multiple TIFF sequences into folders. Huge time saver.

Linus
 
Storytellers
Posts: 1
Joined: Fri Jan 13, 2012 2:28 pm

Re: RENDER QUEUE SCRIPT QUESTION

Wed Mar 21, 2012 4:52 pm

That little snippet of code is perfect! I had about 500 directories as well as Output modules to configure. Now, they are all done! Thanks!
 
Amaylayinsues
Posts: 4
Joined: Mon Sep 01, 2014 11:58 am

Re: RENDER QUEUE SCRIPT QUESTION

Mon May 11, 2015 2:52 pm

 // check if the render item is queued
      if (renderQ.item(i).status == RQItemStatus.QUEUED) {


that little nugget is genius.

Thanks for that. :D
 
chrism9879
Posts: 1
Joined: Mon Jun 13, 2016 7:52 am

Re: RENDER QUEUE SCRIPT QUESTION

Mon Jun 13, 2016 7:58 am

tristan15 wrote:
Thanks Paul, this was extremely helpful to me. I was able to modify this script to automatically place render queue items in specific folders within a file structure based on the shot code in DPX naming, without having to set any "output to" settings. This has saved me days of work. Instead of using the file.path from the render queue, I am grabbing it from my source object, then using that path to build a new file path where i want my comp to render. I think it is important to note that the name of your output is going to be whatever is after the last "/" of your newPath, and your newPath can be any path you choose. So in my case I declared a new var to create the right naming. I then create two folders, and the folder inside will be the correct naming for my render queue item. After the folders are made and AE sets the correct output name, the script then deletes the folder that is labeled (var outputName).

var outputName = fileName + ".[####].jpg"

//creates path for new folder
var newPath = (platesFolder + "/" + fileName + "_1k_jpg" + "/" + outputName);

//creates folder with name fileName_1k_jpg and create folder inside of it with proper naming for output jpeg sequence fileName.[####].jpg folder at path
Folder(newPath).create();

// forces AE to make output at end of path/ takes (var ouputName) as Name
qItem.outputModules[1].file = new File(newPath);


// declares var for folder created at end of path
var deleteFolder = Folder(newPath);

//deletes this unnecessary folder
deleteFolder.remove();




Almost four years since your post, and still extremely useful. Thank you!


Hello, Thank you very much for this script.

I need a little help getting it to work though. I do not code and I am trying to figure out how you modified the original script. Can you please post the full script you modified from start to finish?

Who is online

Users browsing this forum: No registered users and 3 guests