conductor.submitter_nuke module

class conductor.submitter_nuke.NukeConductorSubmitter(parent=None)

Bases: conductor.submitter.ConductorSubmitter

The class is PySide front-end for submitting Nuke renders to Conductor. To launch the UI, simply call self.runUI method.

This class serves as an implemenation example of how one might write a front end for a Conductor submitter for Nuke. This class is designed to be ripped apart of subclassed to suit the specific needs of a studio’s pipeline. Have fun :)

applyDefaultSettings()

Set the UI to default settings.

checkSaveBeforeSubmission()

Check if script has unsaved changes and prompt user if they’d like to save it before continuing

collectDependencies(write_nodes, views)

For the given write nodes, return a list of filepaths that these write nodes rely upon (external file dependencies)

createUI()

Create UI widgets and make.

generateConductorArgs(data)

Override this method from the base class to provide conductor arguments that are specific for Nuke. See the base class’ docstring for more details.

generateTasksData()

Return a list of tasks data. Each item in the list represents one task of work that will be created. Each task dictionary has the following keys:

  • "command": The command for the task to execute

  • "frames": optional, helps to bind/display the relationship between a task and the frames that the task is operating on.

    Because a task can be any arbitrary command, the notion of “frames” may not be relevant and can be left empty.

Example(two tasks):

# Task 0
[{"command": "nuke-render --view main -X AFWrite.write_exr -F 1-1x1 "/tmp/my_nuke_file.nk""
  "frames": "1"},
# Task 1
 {"command": "nuke-render --view main -X AFWrite.write_exr -F 10-20x2 "/tmp/my_nuke_file.nk""
  "frames": "10-20x2"}]
getExtendedWidget()

This method extends the Conductor UI by providing a single PySide widget that will be added to the UI. The widget may be any class object derived from QWidget.

In order to do so, subclass this class and override this method to return the desired widget object. This widget will be inserted between the Frame Range area and the Submit button. See illustration below:

 ____________________
|     Conductor      |
|--------------------|
|  Frame Range Area  |
|--------------------|
|                    |
|  <EXTENDED WIDGET> |   <-- your extended widget goes here.
|                    |
|--------------------|
|   submit button    |
|____________________|
getHostProductInfo()
getJobTitle()

Generate and return the title to be given to the job. This is the title that will be displayed in the webUI.

Construct the job title by using the software name (Nuke), followed by the filename of nuke file (excluding directory path), followed by the write nodes being rendered. If all of the write nodes in the nuke file are being rendered then don’t list any of them.

Nuke - <nuke scriptname> - <writenodes>

example: “Nuke - my_nuke_script.nk - beauty, shadow, spec”

getOutputPath()

From the selected Write nodes (in the UI), query their output paths and derive common directory which they all share (somewhere in their directory tree). Return a two-item tuple, containing the output path, and a list of the write node’s output paths

getPluginsProductInfo()
getSourceFilepath()

Return the currently opened nuke script

product = 'nuke'
runConductorSubmission(data)

Instantiate a Conductor Submit object with the given conductor_args (dict), and execute it.

runPreSubmission()

Override the base class (which is an empty stub method) so that a validation pre-process can be run. If validation fails, then indicate that the the submission process should be aborted.

We also collect dependencies (and asds) at this point and pass that data along… In order to validate the submission, dependencies must be collected and inspected. Because we don’t want to unnessarily collect dependencies again (after validation succeeds), we also pass the depenencies along in the returned dictionary (so that we don’t need to collect them again).

runValidation(raw_data)

This is an added method (i.e. not a base class override), that allows validation to occur when a user presses the “Submit” button. If the validation fails, a notification dialog appears to the user, halting the submission process.

Validate that the data being submitted is…valid.

  1. Dependencies
  2. Output dir
class conductor.submitter_nuke.NukeWidget(parent=None)

Bases: sphinx.ext.autodoc.importer._MockObject

getSelectedViews()

Return the names of the views that are selected in the UI

getSelectedWriteNodes()

Return the names of the write nodes that are selected in the UI

getUploadOnlyBool()

Return whether the “Upload Only” checkbox is checked on or off.

populateViews(views)

Populate each view into the UI QTreeWidget. All views will be selected by default

populateWriteNodes(write_nodes)

Populate each Write and Deep Write node into the UI QTreeWidget. Any write nodes that are currently selected in nuke by the user will be also be selected in UI. Note that only write nodes that are selected in the UI will be rendered when submitting to Conductor.

refreshUi()
conductor.submitter_nuke.logger = <logging.Logger object>
  1. implement pyside inheritance for Nuke’s window interface
  2. Validate that at least one write node is selected
  3. Test file pathing on Windows. Especially file_utils manipulations.
Type:TODO