conductor.lib.nuke_utils module¶
-
class
conductor.lib.nuke_utils.
NukeInfo
¶ Bases:
conductor.lib.package_utils.ProductInfo
A class for retrieving version information about the current maya session.
Will ultimately produce something like this:
{'product': 'nuke', 'vendor': 'The Foundry', 'version': '9.0v7' 'major_version': '9', 'minor_version': '0', 'release_version': '7', 'build_version': '', 'host_product': '', 'host_product_version': ''}
-
classmethod
get_build_version
()¶ Return the minor version of the product, e.g.
“SP4”
-
classmethod
get_major_version
()¶ Return the major version of the product, e.g.
“9”
-
classmethod
get_minor_version
()¶ Return the minor version of the product, e.g.
“”
-
classmethod
get_product
()¶ Return the name of the product, e.g.
“nuke”
-
classmethod
get_release_version
()¶ Return the minor version of the product, e.g.
“SP4”
-
classmethod
get_vendor
()¶ Return the Product vendor name, e.g. “Autodesk”
-
classmethod
get_version
()¶ Return the product version, e.g.
“9.0v7”
-
product
= 'nuke'¶
-
classmethod
-
conductor.lib.nuke_utils.
check_script_modified
()¶ Check if the scene’s been modified, and error out if it has been
-
conductor.lib.nuke_utils.
collect_dependencies
(write_nodes, views, dependency_knobs=None)¶ For the given Write nodes, traverse up their hierarchy to query any nodes for dependency filepaths and return them.
Note that a path value found in a node/knob may contain tcl expressions that this function will resolve, e.g. a path value of:
"[python {nuke.script_directory()}]/[value seq]/[value shot]/cat.####.jpg"
May resolve to:
"/tmp/conductor/nuke/010/010_250/cat.%04d.jpg
Parameters: - write_nodes (list[nuke.Node]) – A list of Write nodes (their node names) for which to collect dependencies for.
- dependency_knobs (dict) –
A dictionary of nuke node types (and their knob names) for which to query for dependency paths, e.g.:
{ 'Read':['file'], 'DeepRead':['file'] }
-
conductor.lib.nuke_utils.
get_all_write_nodes
()¶ Return a dictionary of all Write and Deep Write nodes that exist in the current Nuke script. The dictionary key is the node name, and the value (bool) indicates whether the node is currently selected or not.
-
conductor.lib.nuke_utils.
get_frame_range
()¶ Return the frame range found in Nuke’s Project settings.
-
conductor.lib.nuke_utils.
get_image_dirpath
()¶
-
conductor.lib.nuke_utils.
get_node_dependencies
(node, types=(), collected_deps=())¶ Recursively traverse (upwards) the given node’s node-graph, aggregating a list of all of its contributing nodes.
Parameters: - node (nuke.Node) – Any nuke node object
- types (tuple[str]) – Nuke node types (strings) to restrict the returned nodes to.
- collected_deps (tuple) – This should not be used by the caller. A running-record of the dependencies that have been collected thus far (at any given point in the recursion process).
Returns: Nuke node objects
Return type: tuple[nuke.Node]
-
conductor.lib.nuke_utils.
get_nuke_script_filepath
()¶
-
conductor.lib.nuke_utils.
get_nuke_version
()¶ Return the full version string of the currently running nuke session. e.g. “9.0v5”
-
conductor.lib.nuke_utils.
get_plugins
()¶ TODO:(lws) WIP - there has to be better way of doing this.
Return the plugins from the current Nuke session. This is a list of filepaths to each nuke plugin. ugly:
['/home/nuke/tools/customCG_Neutralize.gizmo', '/home/nuke/tools/customCG_deNeutralize.gizmo', '/home/nuke/tools/customCameraShake.gizmo', '/home/nuke/tools/customChromaticAbberation.gizmo', '/home/nuke/tools/customGlint.gizmo', '/home/nuke/tools/customGrain.gizmo', '/home/nuke/tools/customHaze.gizmo', '/home/nuke/tools/custom_OutputCrop.gizmo', '/home/nuke/tools/gizmos/default_viewer.gizmo', '/home/nuke/tools/nuke/init.py', '/home/nuke/nuke/linux64/Nuke9.0/GeoPoints.so', '/home/nuke/nuke/linux64/Nuke9.0/LD_3DE4_Anamorphic_Degree_6.so', '/home/nuke/nuke/linux64/Nuke9.0/OpticalFlares.so', '/home/nuke/nuke/linux64/Nuke9.0/pgBokeh.so', '/home/nuke/nuke/linux64/Nuke9.0/render', '/home/nuke/nuke/linux64/Nuke9.0/starpro.key', '/home/nuke/.nuke/MTTF', '/home/nuke/.nuke/ScriptEditorHistory.xml', '/home/nuke/.nuke/layout1.xml', '/home/nuke/.nuke/preferences8.0.nk', '/home/nuke/.nuke/recent_files', '/home/nuke/.nuke/uistate.ini', '/home/nuke/.nuke/user.9-0.hrox', '/home/neatvideo/neat_video_ofx/NeatVideo.ofx.bundle/Contents/Linux-x86-64/NeatVideo.ofx']
-
conductor.lib.nuke_utils.
get_plugins_info
()¶
-
conductor.lib.nuke_utils.
get_views
()¶ Return a list of the views that are available in the scene.
-
conductor.lib.nuke_utils.
get_write_node_filepath
(node_name)¶ For the given Write/Deepwrite node (name), return it’s output filepath (“file” attr) If the node does not exist or it’s not a write/deepwrite node, raise an exception
-
conductor.lib.nuke_utils.
resolve_knob_path
(knob)¶ Resolve the knob value of any TCL expression and/or relative path Note that this does not resolve any frame number expressions.
example paths:
'[python {nuke.script_directory()}]/../images/sequences/02/image.%04d.jpg' '../images/sequences/[value this.name]/image.%04d.jpg' '../images/sequences/03/image.%04d.jpg' '../images/sequences/../sequences/03/image.%04d.jpg' ''
Parameters: knob (nuke.File_Knob) – File_Knob object Returns: The resolved path value Return type: str
-
conductor.lib.nuke_utils.
save_current_nuke_script
()¶ Save the current script