Render 1st item in queue, stop, clear render queue, restart

What type of scripts do you need?

Moderator: byronnash

Post Reply
ChrisReidBR
Posts: 1
Joined: May 9th, 2013, 7:44 pm

I've been having a problem rendering 65 comps of GoPro video with animated pre-comps on them (names, location and these things).
Well, that's not important, what's REALLY important is what's happening with my rendering!

After each completed render, the time it takes to render the next item in the queue increases exponentially!!
Example: I tested rendering 20 second videos of the same comp 10 times in a row. The first one took about 15 seconds to complete, the second, about 25s, third went up to 48s, and so on...the 10th item took almost 5 minutes!

Imagine that on hour-long comps!

I have searched and searched the web to find any solution that makes sense, but couldn't find any. There are a few mentions of the same problem on CreativeCow, but no real solution.

So, what I discovered through testing is that when I stop the rendering at the second and forth item in the list, erase the completed ones from the queue and start rendering again, the render time goes back to normal for that first item.

What I imagined that could be a solution, would be writing a Script that starts the render queue, renders the first item, stops, deletes that completed item and starts again.

Is that easy to do?? I'm a noob on scripting and don't even know where to start... :(

Well, what I imagined would be something like this:

// check if there's any item to render
// if true, proceed, if not, stop and bring a warning like "no items queued"

var myQueue = app.project.renderQueue;
myQueue.render(1); // Call 1st item in queue to render
// Stop rendering after it completes
myQueue.what comes here? // Clear completed items?? Does this command exists?
app.project.save(File); // Save Project as it is
// Start again?? No clue how to do it.

It would be great to have a little help from experts like you guys!!
Thanks A LOT
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

It may be related to it filling up the ram cache on a render and then trying to juggle it later rather than just clearing it out. Maybe stopping and saving the project is sorting this out. There are also script commands for clearing the caches so that might also be worth exploring.

Here's a script based on your request. I've done this pretty quickly but it seems to work ok:

Code: Select all

// queue all your renders first
// will ignore any items not queued when script is run

var RQ = app.project.renderQueue;
var renderArray = new Array();

app.project.save(); // make sure project is saved

for (var x = 1; x<= RQ.numItems; x++) {
	if (RQ.item(x).status == RQItemStatus.QUEUED) {
		renderArray.push(RQ.item(x));	// store this render item object
		RQ.item(x).render = false; // turn off queued item
	}
}

if (renderArray.length == 0) alert("Queue all the items to be rendered first");
else {

	for (x = 0; x < renderArray.length; x++) {
		renderArray[x].render = true; // turn on next RQ item
		RQ.render();
		renderArray[x].remove();	
		app.project.save(); 
	}
}
Post Reply