From: Craig Allison <craig@(email surpressed)>
Subject: Re: Nuke Submit...
   Date: Fri, 12 Nov 2010 05:59:41 -0500
Msg# 1974
View Complete Thread (7 articles) | All Threads
Last Next
That's a great help, I'd already added the submit to the central menu.py =
but it wasn't pulling through those values, this will make it much nicer =
for the guys.

Only thing I had to add to the centralised script was the declaration:

"import nuke, os"

before

> nukescript = nuke.Root().name()



Awesome as ever Greg, thank you!

Craig


Craig Allison
Digital Systems & Data Manager
The Senate Visual Effects


On 11 Nov 2010, at 01:13, Greg Ercolano wrote:

> [posted to rush.general]
> 
>> 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.
> 
> 	Just be sure to at least change "//yourserver/somewhere/rushscripts/submit-nuke.pl"
> 	to where you have your submit-nuke script.
> 
> 	Note this assumes you're using a semi-recent submit-nuke.pl script
> 	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.
> 

Last Next