Page 1 of 1

RENDER QUEUE SCRIPT QUESTION

Posted: August 14th, 2007, 6:04 am
by Matt_B
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

Posted: August 14th, 2007, 6:25 am
by Paul Tuersley
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

Posted: August 14th, 2007, 4:21 pm
by Paul Tuersley
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);
				
			}	
		}
	}
}

Re: RENDER QUEUE SCRIPT QUESTION

Posted: April 26th, 2011, 1:56 pm
by tristan15
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!

Re: RENDER QUEUE SCRIPT QUESTION

Posted: March 15th, 2012, 8:56 am
by dj_lino
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

Re: RENDER QUEUE SCRIPT QUESTION

Posted: March 21st, 2012, 4:52 pm
by Storytellers
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!

Re: RENDER QUEUE SCRIPT QUESTION

Posted: May 11th, 2015, 2:52 pm
by Amaylayinsues

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

Re: RENDER QUEUE SCRIPT QUESTION

Posted: June 13th, 2016, 7:58 am
by chrism9879
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?