RENDER QUEUE SCRIPT QUESTION

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
Matt_B
Posts: 1
Joined: August 3rd, 2007, 2:25 am
Location: London

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: June 5th, 2004, 7:59 am
Location: London, UK

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: viewtopic.php?t=310
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

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.

Code: Select all

{
	// 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: April 26th, 2011, 12:33 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: March 12th, 2012, 9:51 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: January 13th, 2012, 2:28 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: September 1st, 2014, 11:58 am

Code: Select all

 // 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: June 13th, 2016, 7:52 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?
Post Reply