Hello,
Took me a little longer than i thought to strip out our pipe specific code, but this comes from a plugin we use all the time.
I even included the icon
I have tested this with dl7.0.2 and dl 9.0.2.
Once extracted, you want to put NukePy folder in your /custom/plugins
NukePy.zip (7.94 KB)
The only caveat, is you will need to edit the param and dlint files, to add back in which nuke versions you use at your studio.
Also there is no submit gui… but that is ok, because here is the minimum info that you need to create a job via the python standalone api.
job_info = {
'ChunkSize': '1',
'FailureDetectionJobErrors': 5,
'Frames': '1-1',
'Name': 'kw test',
'OverrideJobFailureDetection': True,
'Plugin': 'NukePy',
'Pool': 'nuke',
'Priority': 50,
'UserName': 'me'}
plugin_info = {'BatchMode': True,
'ContinueOnError': False,
'EnforceRenderOrder': False,
'NukeX': False,
'ProxyMode': False,
'SceneFile': '//network/path/test_python_nuke.py',
'ScriptArguments': 'hello happy world 10',
'Verbosity': '0',
'Version': '7.09'}
import Deadline.DeadlineConnect as Connect
Deadline = Connect.DeadlineCon(PULSESERVERNAME, 8080)
jobid = Deadline.Jobs.SubmitJob(info=job_info,
plugin=plugin_info,
idOnly=id_only)
print 'jobid::',jobid
The contents of my script (test_python_nuke.py) look like this:
#imports
import nuke
import sys
# print out each of the sysargs to show it works
for arg in sys.argv:
print 'found a script arg:',arg
## these lines are required at the end of the script, if the job it to complete sucessfully.
# if you want it to error, you can simply have a sys.exit(1) in your script
print 'Finished running script.'
print 'READY FOR INPUT'
# needs a 0 status exit to exit cleanly...
sys.exit(0)
The script output when the job runs on the farm will then contain:
2017-05-19 16:23:29: 0: STDOUT: found a script arg: /tmp/Thinkbox/Deadline7/slave/node42/jobsData/591f539f027b94037905993f/thread0_tempeFoPi0/test_python_nuke.py
2017-05-19 16:23:29: 0: STDOUT: found a script arg: hello
2017-05-19 16:23:29: 0: STDOUT: found a script arg: happy
2017-05-19 16:23:29: 0: STDOUT: found a script arg: world
2017-05-19 16:23:29: 0: STDOUT: Finished running script.
2017-05-19 16:23:29: 0: INFO: marking the progress of the current job to 100% as its done.
2017-05-19 16:23:29: 0: STDOUT: READY FOR INPUT
2017-05-19 16:23:29: 0: INFO: Process exit code: 0
2017-05-19 16:23:29: 0: Render time for frame(s): 2.730 s
2017-05-19 16:23:29: 0: Total time for task: 6.340 s
2017-05-19 16:23:29: 0: Saving task log...
Hope this helps.
Cheers
Kym