In this post I describe what files to edit in the deadline repository, if you want to submit not all, but specific view(s) from a multiview (stereo) nuke scene to deadline. The modification include the nuke submitter dialog, where user can check which views to render, and the nuke plugin file. Hope it helps someone. By the way it is for deadline 5.0, the exact solution for other versions may be different.
Submission/SubmitNukeToDeadline.py, gui declaration in __init__ somewhere append this:
1: self.viewToRenderLabel = nuke.Text_Knob( "separator31", "Views to render:" )
2: self.addKnob( self.viewToRenderLabel)
3: self.views = nuke.views()
4: self.viewToRenderKnobs = []
5: for x, v in enumerate(self.views):
6: bknob = nuke.Boolean_Knob(('viewToRender_%d' % x), v)
7: bknob.setFlag(0x1000)
8: self.viewToRenderKnobs.append((bknob, v))
9: self.addKnob(bknob)
10: bknob.setValue(True)
Still SubmitNukeToDeadline.py, in SubmitJob function, where writing into plugin info file, for example after: "fileHandle.write( "NukeX=%s\n" % dialog.useNukeX.value() )"
1: viewsToRender = getSelectedViews()
2: viewsToRender_str = ','.join(viewsToRender)
3: print 'Views to render in plugin info file: %s' % viewsToRender_str
4: fileHandle.write( "viewsToRender=%s\n" % viewsToRender_str )
Still SubmitNukeToDeadline.py, at the end, a new function to get list of views from submitter dialog (that the user selected) write this:
1: def getSelectedViews():
2: global dialog
3: x = 0
4: viewsToRender = []
5: for vk in dialog.viewToRenderKnobs:
6: if vk[0].value():
7: viewsToRender.append(vk[1])
8: x+=1
9: print '\nViews to render: %s\n\n\n ' % viewsToRender
10: return viewsToRender
-------
In plugins/ nuke.py file in RenderArgument function, just before return append this:
1: viewsToRender = GetPluginInfoEntryWithDefault( "viewsToRender", "" )
2: if viewsToRender != '':
3: LogInfo( "==VIEWS==\nUsing " + viewsToRender + " view(s) for rendering\n" )
4: renderarguments += " -view \"" + viewsToRender + "\""
And that's it. It's even logging the views to be rendered.
Cheers,
Gabor