Houdini SideFX Utils Notes
UI Utils - uitools.py
Since - Houdini 18.5.x Py3
$HFS/houdini/python3.7libs/uiutils.py
uiutils
package
Detail
TODO
Functions
- getScreenRect()
- getMaximumWindowGeometry() - Get the maximum geometry rectangle for a window by using the screen that it is on, or will open into.
- fitWindowToScreen()
- fitWindowToRect() - Moves the given rectangle (pos, width, height) so that it lies inside bounding_rect. It’s assumed that (width, height) is not larger than bounding_rect.size().
- dumpWidgetLayout() - Debug utility to print out tree of widgets with relevant layout properties.
- invalidateWidgetLayout() - Debug utility to thoroughly invalidate cached sizes so that we rule out such issues.
Tool Utils - toolsutils.py
Since - Houdini 18.5.x Py3
$HFS/houdini/python3.7libs/toolutils.py
toolutils
package
Detail
sceneViewer()
Returns an existing open Scene Viewer pane if there is one.
A Context viewer is also acceptable is no dedicated scene viewer is found.
Functions
- safe_reload()
- dataTree() - Returns an existing open Data Tree pane if there is one.
- sceneViewer() - Returns an existing open Scene Viewer pane if there is one.
- compositorViewer() - Returns an existing open Compositing Viewer pane if there is one.
- networkEditor() - Returns an existing open Network Editor pane if there is one.
- activePane() - Returns the current active pane. If the current tool was launched from a Tab menu, the “pane” scriptarg will be set, and indicates the active pane.
- activeCompositorPane() -
- homeToSelectionNetworkEditorsFor() - Homes to their selection all network editors to that are showing the network that contains node.
- homeToItems() - Homes to their selection all network editors that are showing the network that contains items.
- selectionPrompt() - Generates a generic selection prompt string when no specific prompt string is available in the toolprompts module.
- replaceOutputConnections() - Stick the new node between the input node and all nodes it is connected to (insert operation).
- replaceInputConnections() - Stick the new node between the output node and the node it is connected to (insert operation). Note there can be only one.
- getBestConnector() -
- connectMultiInputsAndOutputs() - Wire the network so that new node connects to the provided inputs and outputs.
- connectInputsAndOutputs() - Simplified version of
connectMultiInputsAndOutputs
that takes at most a single input and output. - nodeTypeNameBase() - Returns the node type base name (stripped of namespace or version).
- nodeTypeNameVersion() - Returns the node type version component.
- nodeTypeNameMatches() - Returns true if the node’s type base name matches the given type.
- nodeTypeBaseNameMatches() - Returns true if the node’s type name components matches the given type.
- nodeTypeNameComponentsMatch()
- __nodeMatches() - True if node is of type matchtype and the parmlist dictionary matches our contents.
- findConnectionChainToInputNode() - Finds a chain of hou.Connections that lead to endnode.
- findAllConnectionChainsToInputNode() - Finds all chains of hou.Connections that lead to endnode.
- findConnectionChainToOutputNode() - Finds a chain of hou.Connections that lead to endnode.
- findAllConnectionChainsToOutputNode() - Finds all chains of hou.Connections that lead to endnode.
- findConnectedNodes() - Finds all nodes that are connected to startnode for which match_method returns True. Searches either inputs or outputs, depending on the value of connection_type (either ‘input’ or ‘output’).
- findAllInputNodesOfTypeWithParms() - Finds all nodes that are an ancestor of endnode, match nodetype, and have the parameters & value pairs listed in the parmlist dictionary.
- findInputNodeOfTypeWithParms() - Finds any nodes that are an ancestor of endnode, match nodetype, and have the parameters & value pairs listed in the parmlist dictionary.
- findGreatestCommonDescendent() - Starting from end node and heading up the input chain locate the first node that doesn’t have all of searchnodes on the same input wire.
- findInputNode() - This function searches the endnode’s hierarchy to find if the given search node is connected
- findInputNodeOfType() - This function does a depth first traversal of the node input hierarchy to find the first node of a particular type.
- findInputNodeOfBaseType() - This function does a depth first traversal of the node input hierarchy to find the first node whose type’s base name (ie, type name stripped of any namespace or version) matches the given type.
- findOutputNodeOfTypeWithParms() - Finds any nodes that are a descendent of startnode, match nodetype, and have the parameters & value pairs listed in the parmlist dictionary.
- findOutputNodeOfType() - This function does a depth first traversal of the node output hierarchy to find the first node that matches our search.
- findOutputNodeOfBaseType() - This function does a depth first traversal of the node input hierarchy to find the first node whose type’s base name (ie, type name stripped of any namespace or version) matches the given type.
- findAllChildNodesOfTypeWithParms() - Returns a list of all nodes contained in parent that match the nodetype & parmlist filters.
- findChildNodeOfTypeWithParms() - This function does a search of the node container hierarchy (rather than connection hierarchy) searching for a matching node type which also has the given parameter list match.
- findChildNodeOfType() - This function does a search of the node container hierarchy (rather than connection hierarchy) searching for a matching node type.
- findAllChildNodesOfType() - Returns a list of all child nodes that match the given node type
- findAncestorOfType() - Return closest ancestor (or self) of ‘startnode’ with the specified category and type.
- findAncestorOfBaseType() - Return closest ancestor (or self) of ‘startnode’ with the specified category and type.
- chooseNode() - Prompts the user to select on of the given nodes. If there is only a single node, then that node is automatically returned. The title and message parameters determine what will show up in the prompt.
- _askUserToSelectNode()
- setUpOrientation() - Assumes that the default value of the specified parameter in the given node corresponds to the orientation specified in defaultup and applies the necessary change to convert the node to the current orientation mode.
- baseUpOrientation() - This function returns the base orientation (rotation) matrix that aligns the standard world axes to those of the global orientation preference.
- ocioColorSpaceMenu()
- parseDialogScriptMenu() - This function parses a disk file specified by the filename.
- updatePlaneType() - This function is intended to update deep raster plane parameters based on the newly set plane variable name.
- updateBakeExtractImageFormat() - Obsolete
- updateBakePlanes() - Obsolete
- mapTypeCategoriesToSubnetName() - This function returns a name of the subnet that accepts etypecategory as child type and can be created in a container whose child type is acceptedtypecategory.
- _mapSubnetToNode() - Returns the target node new nodes can be created under
- removeDefaultGeometryObjectContents() - Destroy the File SOP that gets created inside a default Geometry Object.
- createNodeInContainer() - This function attempts to create a node of a given type category and type name in a given container.
- reformatPermissionErrors() - This function decorator will trap any permission error exceptions and raise a different exception with a nicer message.
- genericTool() - Handles the creation of any node in a Network Editor pane.
- _getBranchMode() - Utility function to convert the “branch” key in scriptargs into a hou.stateGenerateMode enum.
- _getRequestNew() - Utility function to convert the “requestnew” key in scriptargs into a boolean.
- genericStateTool() - Runs a specific state in an open viewer pane.
- moveNodesToGoodPosition() - Moves a list of nodes to good positions.
- generateToolScriptForNode() - string parse and create
- _createModule()
- createModuleFromSection() - Create and return a module-like object with the given name from the contents of a section in an HDA.
- nodeNameFromTypeName() - Given an operator node type name, return a valid node name corresponding to that type.
- placeToolImmediately() - Returns true if the provided kwargs has a modifier key suggesting the tool be placed right away.
- getImmediatePlacementPosition() - Returns the world space position to use for immediate placement of a new tool given a scene viewer.
- getImmediatePlacementOrientedPosition() - Returns the world space position and world space orientation to use for immediate placement of a new tool given a scene viewer.
- getSubnetOutputNodes() - Returns a list of output nodes. The position of a node within the list corresponds to it’s output index.
- ToolboxTemplateGroup class - Generates a UI code block and a template group for toolbox hou.SceneViewer.selectObject
- testTool() - Executes a shelf tool.
- recursiveShowPane() - Maximize all the parent Pane splits and make the given panel visible.
- findPythonPanel()
- createOrShowPythonPanel() - creates a new float panel from a pypanel interface name or make existing ones visible.
- minimizePythonPanel() - minimize pypanel interfaces.
- outputConnectionsAtIndex() - Returns the output connection of a node at a specified index.
- inputConnectionsAtIndex() - Returns the input connection of a node at a specified index.
- insertNodeAbove() - Inserts a new node (newnode) between the given node (node) and the given node’s input node.
- branchNodeAbove() - Inserts a new node (newnode) between the given node (node) and the given node’s input node.
SOP Tool Utils - soptoolutils.py
Since - Houdini 18.5.x Py3
$HFS/houdini/python3.7libs/soptoolutils.py
soptoolutils
package
Detail
scriptSopFilterTool()
TODO
Functions
scriptSopFilterTool()
-findDeformTypeInputSop()
-getGeometrySelections()
-setGroupParmsOnSopNode()
-initReusedSopFilterNode()
-initNewSopFilterNodeWithOutput()
-initNewSopFilterNode()
-createSopNodeContainer()
-createSopNodeFilter()
-createSopNodeGenerator()
-genericSopNodeGeneratorTool()
-getSelectors()
-genericSopNodeFilterTool()
-customSopNodeFilterTool()
-createCustomSelectionSopNodeFilterTool()
-genericCaptureTool()
-genericReusableTool()
-customStateTool()
-genericTool()
-chooseAndOpenGeoFile()
-buildPaintNode()
-paintObject()
-paintNodeInput()
-chooseAndPaintObject()
-chooseAndPaintEaseInObject()
-chooseAndApplyTexture()
-buildBlockPair()
-buildBlockMetadata()
-buildBlockBeginCompile()
-setBendRegionParms()
-processPositions()
-createBendSop()
-setupBendRegion()
-getItemGeometry()
-addBooleanTool()
-findViewersUV()
-addUVTool()
-buildAttribAdjustFromActionButton()
-addPolyBevelTool()
-