Work in Progress: Questions for a RenderFarm Submitter

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
Iaenic
Posts: 14
Joined: August 9th, 2012, 11:29 am

Hi everyone!
Having used expressions pretty extensively for the past couple years, i've decided to jump neck-deep into teaching myself scripting. I've been at it for a couple weeks now, and have decided to tackle a project as a case-study to learn the ins and outs of everything.

I'm working on a script that provides a docking UI for submitting render jobs to Smedge. (http://www.uberware.net/smedge3/)

I've finished building the UI and am now starting in on making all the pretty buttons actually do things.

As i'm going along though I find myself running into the occasional issue or questions, and i'm wondering if I can reach out to you guys for help as I proceed.

The intended behavior is to be able to select a bunch of comps (or render queue items), fill in the settings for the render farm, select output settings, and then have the script do the grunt work with a single click. Here is where I run into my first question:

Question 1:
Can I determine the difference between whether or not a project item or render queue item is selected?

Reasoning:
My colleagues have expressed an interest in either being able to select a bunch of comps, and then fill in the desired settings with the "Render Queue" section as shown in the screenshot. The script would then submit the items to the render queue, save, and then submit the job to the farm. Alternatively, they also would like the ability to select pre-existing jobs already in the render queue and submit those directly. In that case, I would have the script disregard everything in the "Render Queue" section of the palette. I've had difficulty pinning down how to tell the difference between what is selected (or if both are selected). I could use a point in the right direction.

More questions to follow im sure! I will keep them all in this work in progress thread. Thanks for any advice you can give!


Additional infos:

Resources im using to learn in case you need to tell me to RTFM a specific page:
Adobe After Effects CS6 Scripting Guide: http://blogs.adobe.com/toddkopriva/file ... -Guide.pdf
Beginning ScriptUI: http://www.scribd.com/doc/56130789/scri ... er_page_52
Creative Suite 6 Tools Guide: (Offline: CS5 version is here: http://wwwimages.adobe.com/www.adobe.co ... de_CS5.pdf)
Adobe Introduction to Scripting(2012): (Offline: 2007 here: http://wwwimages.adobe.com/www.adobe.co ... pting1.pdf)

Scripts i'm using as references/examples:
Batchprocessor.jsx by Charles Bordenave and Lloyd Alvarez
CreateFoldersForSequences.jsx by crgreen
Duplicator.jsx assembled by David Torno
Attachments
Current Palette
Current Palette
SmedgeUI.jpg (61.77 KiB) Viewed 22012 times
dfred
Posts: 29
Joined: July 23rd, 2010, 11:49 pm

I don't believe renderQueue items have a "selected" attribute, so you'll probably have to stick with:

Code: Select all

if(app.renderQueue.item(index).status === RQItemStatus.QUEUED)

or

Code: Select all

if(app.renderQueue.item(index).status === RQItemStatus.UNQUEUED)
Iaenic
Posts: 14
Joined: August 9th, 2012, 11:29 am

Ahh, I see.

I think my plan will be to give it three conditions then...

if Queued render items exist but selected comps dont, then use the queue.
If selected comps exist, but queued render items don't, use comps.
If both exist, pop up an annoying window asking the user which he wants to use. :mrgreen:
Iaenic
Posts: 14
Joined: August 9th, 2012, 11:29 am

Ok, new question.

I have some code that is allowing me to over-ride the start frame and duration of an item added to the render queue.

Code: Select all

            if (SmedgeIt.checkbox2.value == false) {
             var STS_Framerate = app.project.item(i).frameRate; 
             rqi.timeSpanStart = SmedgeIt.edittext4.text / STS_FR; 
             var STS_Duration = SmedgeIt.edittext5.text - SmedgeIt.edittext4.text;
             rqi.timeSpanDuration = STS_Duration / STS_Framerate; 
             }
It works as it's supposed to, but i'm having some difficulty:

If I have a comp that uses starting frame 1 (Duration 900) and I specify 1 to 900, I get a result of it setting the Render Settings to 2-900.

If I have a comp that uses starting frame 1 (Duration 900) and I specify 0, then it gives me the proper result, but also an error message:
"After Effects warning: timeSpanStart of 0 seconds will cause render to have frames outside of range defined by comp displayStartTime (0.03) and end of comp duration (30.03). Render will succeed, but may have blank frames)"

I would like to avoid having my comps set to use starting frame "0", it tends to screw up things in our pipeline. Is there some kind of math adjustment I can use to fix this?

edit: in fact, is there any way to just use framesToTime() for this?
dfred
Posts: 29
Joined: July 23rd, 2010, 11:49 pm

Paul Tuersley came up with a hack to this problem:

viewtopic.php?f=8&t=1878
dfred
Posts: 29
Joined: July 23rd, 2010, 11:49 pm

Also, I believe if you have projectStartFrame set to 1 and all comps set to start at frame 1 everything should work as expected. The issue arises when projectStartFrame is set to 0 and comp start frame is set to 1.
Iaenic
Posts: 14
Joined: August 9th, 2012, 11:29 am

Thank you! That's exactly what I needed.
Iaenic
Posts: 14
Joined: August 9th, 2012, 11:29 am

Ok, i've come up with a new problem!

I've got the script set up to where it can queue up renderitems, save, and then submit the jobs to the farm.

The only problem is, I think that it's not actually completing the save before starting the function to send off the data to the farm. That's causing some of the render packets to error out.

Is there any way I can rememdy this so that the function only begins once the file has finished saving completely?
dfred
Posts: 29
Joined: July 23rd, 2010, 11:49 pm

I'm not completely sure if it'll work, but try this:

Code: Select all

if (!app.isUISuppressed) {
    doRestOfScript;
}
Edit: Nevermind, I think that's only for Render Engine actually.
Iaenic
Posts: 14
Joined: August 9th, 2012, 11:29 am

Might that work if I force it to bring up a save-as dialog with app.project.saveWithDialog()?
Iaenic
Posts: 14
Joined: August 9th, 2012, 11:29 am

Update: Turns out it's not what I thought it was. Instead the renderfarm engine is not liking that some mapped network drives have red X's over them, even though they are connected.
Post Reply