voptoolutils module

class voptoolutils.InputData(inputnode, inputname, inputlabel, inputparmtuple, outputnode, outputname)

Bases: tuple

inputlabel

Alias for field number 2

inputname

Alias for field number 1

inputnode

Alias for field number 0

inputparmtuple

Alias for field number 3

outputname

Alias for field number 5

outputnode

Alias for field number 4

class voptoolutils.PromotedParmData

Bases: voptoolutils.PromotedParmData

class voptoolutils.VopInputPresetManager
addPreset(preset)
addPresets(presets)
addPresetsFromJson(json_path)
checkNodePresetCreatesInput(node, input_index_or_name, preset_name_or_preset=None)
createAllInputsFromPreset(node, passthrough_input=None, parm_gen_type=vopParmGenType.SubnetInput, recurse=True, preset_name_or_preset=None, replace_existing=True, depth=0)
createInput(node, input_index_or_name, passthrough_input=None, type='parameter', node_type=None, node_output=0, node_useexisting=False, node_folderlevel=None, parm_name=None, parm_label=None, parm_type=None, parm_useexisting=False, parm_invisible=False, parm_inheritname=False, parm_gen_type=vopParmGenType.SubnetInput, preset=None, default_value=None, node_folder=None, node_prefix=None, recurse=True, replace_existing=True, guard_conditionals=False, add_promotion_parms=False, depth=0)
createInputUsingPreset(node, input_index_or_name, passthrough_input=None, parm_gen_type=vopParmGenType.SubnetInput, recurse=True, input_preset=None, guard_conditionals=False, replace_existing=True, depth=0)
currentInputUsedByPreset(node_type, preset_name)

Returns True if the nodes currently connected to the input of ‘node’ would be reused when an input of ‘node_type’ is created using the preset specified by ‘preset_name’

filterPresets(node_type, preset_name=None, find_default_for_type=False)

Finds presets that match node_type and, if specified, the preset name.

If find_default_for_type is True, the preset_name is ignored and the preset marked as default for the node_type is returned in a list.

findPreset(node_type, preset_name=None)

Finds a preset that matches node_type as well as preset_name, if preset_name is not None.

getInputPresetFromNodePreset(node, inputname, preset_name_or_preset=None)
getPreset(node_type, preset_name_or_preset=None)

Returns a preset that’s already merged on top of all it’s parents

validatePreset(preset)
voptoolutils.addOrReplaceParm(node, parm_template)
voptoolutils.addOrReplaceStringParm(node, parm_name, parm_label, string_type=stringParmType.Regular)
voptoolutils.addPromotionParms(node, ui_host_node=None, folder=None, prefix=None, use_host_folder=True, use_host_prefix=True)

Adds parameters which control how parameters are promoted from this node.

The values of the parameters are set according to the arguments passed to this procedure.

These parameters are added to ‘node’:

vopui_host Parameters promoted from ‘node’ will show up in

the folder of this host.

Default value: ‘ui_host_node’

vopui_usehostfolder A toggle that controls whether to append to

host folder.

Default value: True

vopui_usehostprefix A toggle that controls whether to append to

host prefix.

Default value: True

vopui_folder The folder to add parameter.

If vopui_usehostfolder is True, this folder will be appended to the host’s folder

Default value: node.type().description()

vopui_prefix The prefix to use for parameters.

If vopui_usehostprefix is True, this prefix will be appended to the host’s prefix

Default value: ‘’

vopui_myfolder This is set up with a python expression which
computes the concatenated folder.
vopui_myprefix This is set up with a python expression which
computes the concatenated prefix.
voptoolutils.autoCreateComputeLighting(shadernode)
voptoolutils.buildBlockPair(scriptargs, name, opentype, closetype, encloseinputs)

Builds a pair of block nodes, a begin and an end, and links them together nicely.

voptoolutils.checkHasInput(node, index_or_name)
voptoolutils.checkHasOutput(node, index_or_name)
voptoolutils.checkInput(node, index_or_name)
voptoolutils.checkOutput(node, index_or_name)
voptoolutils.checkValidParmDataType(data_type)
voptoolutils.collectParmChain(node, parm_name, usehost_name, separator, separator_at_end=False, level=0)
voptoolutils.createAllParmVops(node, parm_gen_type=vopParmGenType.Parameter)
voptoolutils.createInputs(node, parm_gen_type=vopParmGenType.Parameter, preset_name_or_preset=None)
voptoolutils.createPromotionRefs(node)
voptoolutils.deleteAllInputs(begin_node)
voptoolutils.destroyExclusiveInputNodes(endnode, endnode_input=None)
voptoolutils.embedInputParmVops(node)
voptoolutils.embedInputParms(node)
voptoolutils.filterParmSetByPresets(parm_set)
voptoolutils.findContributingParms(node, target_name=None, _depth=0)
voptoolutils.findCorrectlyPlacedItem(item, ptg, parm_set, search_dir)
voptoolutils.findExclusiveInputNodes(endnode, endnode_input=None)

Recursively finds nodes that only output to ‘endnode’. If endnode_input is not None, only nodes that only output to that input are returned.

voptoolutils.findParmsToEmbed(node)
voptoolutils.genericTool(scriptargs, nodetypename, nodename=None, exact_node_type=True)

Calls the generic tool handler for all nodes, which allows the user to lay down a node in the network editor.

voptoolutils.getIndependentSiblingOfType(node, node_type, pool=None)
voptoolutils.getInputConnector(node, input_index_or_name)
voptoolutils.getInputData(node, input_index_or_name)
voptoolutils.getInputIndex(node, index_or_name)
voptoolutils.getInputLabel(node, index_or_name)
voptoolutils.getInputName(node, index_or_name)
voptoolutils.getInputNode(node, input_index_or_name)
voptoolutils.getInputNodeOutputIndex(node, input_index_or_name)
voptoolutils.getInputOfTypeRecursive(node, node_type, skip_self)
voptoolutils.getInputOfTypeRecursiveHelper(node, node_type, skip_self, array)
voptoolutils.getInputParmTuple(node, index_or_name)
voptoolutils.getInputsRecursive(node)
voptoolutils.getInputsRecursiveHelper(node, res, array)
voptoolutils.getNewParmName(source_node, parm_name)
voptoolutils.getOutputIndex(node, index_or_name)
voptoolutils.getOutputLabel(node, index_or_name)
voptoolutils.getOutputName(node, index_or_name)
voptoolutils.getParmName(parm_vop)
voptoolutils.getParmPromotionFolder(parm_vop, contributing_nodes=None)

Returns the folders that a parameter should be promoted to as a slash separated string

This is done by checking which promotion folders the parm’s output nodes specify. If there is a conflict between the folders on output nodes the deepest common folder is returned.

If contributing_nodes is a list, it will be populated with all the nodes that contributed to the folder path.

voptoolutils.getParmPromotionFolderString(parm_vop, contributing_nodes=None)
voptoolutils.getPromotionFolder(node, input_names=(), contributing_nodes=None)
voptoolutils.getPromotionFolderString(node, input_names=(), contributing_nodes=None)
voptoolutils.getPromotionPrefix(node)
voptoolutils.hasNodeAsInputRecursive(node, find_node)
voptoolutils.insertFilterNode(target_node, input_index_or_name, orig_input_node, new_input_node, filter_node_type, filter_node_input)
voptoolutils.insertParm(node, input_name, parm_gen_type=vopParmGenType.Parameter)
voptoolutils.insertParmVop(node, input_index_or_name, parm_gen_type=vopParmGenType.Parameter, parm_name=None, parm_label=None, parm_type=None, default_value=None, move_to_folder=True)

Creates a Parameter VOP for the given input. If the input has a corresponding parameter of the same name, all relevant attributes are copied over to the Parameter VOP.

voptoolutils.jumpToNode(kwargs, effect_type)
voptoolutils.makeFilterNodePreset(passthrough_input_name, excluded_inputs=[])
voptoolutils.moveParameters(ptg, parm_set, included_parm_names=None)
voptoolutils.movePromotedChildParameters(owner_node, included_parm_vops=None)

Sorts and moves into folders all parameters promoted to this node

If included_parm_vops is an iterable containing Parameter VOPs, only only parameters associated with those Parameter VOPs will be moved.

voptoolutils.movePromotedParameters(node)

Moves the VOP node’s promoted parameters to the folder specified by the ‘In Folder’ parameter.

voptoolutils.parmVopEffect(kwargs, effect_type, name_prefix=None, mix_with_existing_type=None, custom_creator=None, parm_gen_type=vopParmGenType.Parameter)

High-level utility function for creating a parm effect where the effect filters the parameter animation. It returns the created hou.VopNode.

kwargs
A dictionary containing the keyword ‘parms’, mapping to a tuple of hou.Parm objects that is to be affected.
effect_type
The type of the effect to create. Note that because some of them may involve more than one node, we can’t just blindly make this the node type to create.
name_prefix
The name prefix used for the created node.
voptoolutils.positionItems(target_node, items)
voptoolutils.printTable(data)
voptoolutils.replaceInput(node, input_index_or_name, new_input_node, output_index_or_name=0)

Sets the new input node, and deletes the existing input node (and it’s inputs) if they only depended on ‘node’.

voptoolutils.setConnection(start_node, start_node_output, end_node, end_node_input, delete_unused=True)
voptoolutils.setDefaultColor(parm_node, def_col)
voptoolutils.syncParmTemplateGroupToParmSet(ptg, parm_set)
voptoolutils.translateConditionalNames(cond, translate_method)

Updates the conditional with new parm names

translate_method should take the old parm name as it’s sole argument and return the new parm name

voptoolutils.updateParmVopConditionals(parm_nodes)

Replaces parm names in conditionals with the name parameters are exposed with. i.e. with the name of the parm VOP plugged into the parameter’s input, including it’s prefix.

voptoolutils.wrapParmInFolder(ptg, parm_name, folder_label)