> Craig Allison wrote:
>> Has anyone done a Nuke submit script that auto pulls in all the basic =
>> requirements for rendering from the current open script (i.e. Script =
>> path, frames etc.)?
>>
>> Looking to get our current submit a little more elegant so any tips =
>> gratefully received!
Here's something simple that adds a Rush/Submit item
to the nuke menu bar:
---- snip
def RushSubmit():
nukescript = nuke.Root().name()
sfrm = nuke.Root().firstFrame()
efrm = nuke.Root().lastFrame()
cmd = ( "perl //yourserver/somewhere/rushscripts/submit-nuke.pl " +
"-field Frames: %(sfrm)s-%(efrm)s " +
"-field NukeScript: \"%(nukescript)s\" 2>&1 " ) % locals()
if ( os.path.isdir("/var/tmp") ): cmd += "&"
os.system(cmd)
nukebar = nuke.menu("Nuke")
item = nukebar.addMenu("Rush", "icon.png")
item.addCommand('Submit', 'RushSubmit()')
---- snip
When you click the item, the rush submit form should pop up
with the Frames: and Nuke Script: fields filled out for you
with the currently loaded nuke file.
Feel free to add more logic, eg. to warn the user if no nuke
file is loaded, or the current nuke script has not been saved
before submitting. I kept the above example simple so you can
see clearly what's going on.
You can paste the above into the nuke script editor to test it
(see "TUTORIAL" instructions in my last posting for how to do that),
and when you have it all working, you can add it to nuke's menu.py file.
In the above, you MUST change "//yourserver/somewhere/rushscripts/submit-nuke.pl"
to be the path where your submit-nuke script lives.
Note this example assumes you're using a semi-recent submit-nuke.pl
that allows the -field command line options.
Regarding the 'menu.py' file, if you add it to the one in the Nuke
directory, it will appear for all users. eg:
Linux: /usr/local/Nuke6.1v1-32/plugins/menu.py
Windows: c:/program files/nuke6.1v1/plugins/menu.py
Or, if you add it to your home directory ~/.nuke/menu.py,
then it will just work for you. (a good way to test, if you
don't have root/administration perms)
Let me know if you have any questions.
[EDITED FOR CLARITY - erco 11/10/10]
--
Greg Ercolano, erco@(email surpressed)
Seriss Corporation
Rush Render Queue, http://seriss.com/rush/
Tel: (Tel# suppressed)ext.23
Fax: (Tel# suppressed)
Cel: (Tel# suppressed)
|