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
Work in Progress: Questions for a RenderFarm Submitter
Moderator: Paul Tuersley
I don't believe renderQueue items have a "selected" attribute, so you'll probably have to stick with:
or
Code: Select all
if(app.renderQueue.item(index).status === RQItemStatus.QUEUED)
or
Code: Select all
if(app.renderQueue.item(index).status === RQItemStatus.UNQUEUED)
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.
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.

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.
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?
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;
}
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?
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?
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?
I'm not completely sure if it'll work, but try this:
Edit: Nevermind, I think that's only for Render Engine actually.
Code: Select all
if (!app.isUISuppressed) {
doRestOfScript;
}