Tag Archives: Python

HOUtilities

Introducing HOUtilities, collection of small to large utilities and tools written in Python/PySide, to make Houdini artists/TDs lives easier.
Source code coming soon after adding all features for version 1.0 and proper testing.

Current utilities include –

Frequent OPs
Quick access to most frequently used OPs.
This will allow users to design their own prefs. with user defined frequent OPs, colors per OP category, context sensitive OPs, as well as auto-naming etc…

FrequentOPs

HDA Manager
HDA Manager is designed to make dealing with lots of HDAs easier.
Feature will include ability to favourite HDAs to keep them at top, saving individual as well as all unlocked HDAs and quickly fetching various information about any HDA.

HDAManager

Miscellaneous Utilities
As it suggests, these are small but sometimes handy set of utilities.
First one is to add a switch sop to selected sop and expose switch’s input parm to parent Geo or HDA as a toggle – all in a click.

switch_001 switch_002

Add a switch to selected Houdini node

Here is a quick way to add a switch to currently selected Houdini Node.
For further improvements it would be great to have switch input exposed to parent HDA’s interface.
Also an option to have auto-Null input to switch sop.
i.e. “Switch to nothing” mode.


def addSwitchForDebug(self, parentOp = ""):
	'''
	Add switch op to bypass selected node and expose switch input to the parent.
	'''

	currentSel = hou.selectedNodes()
	if len(currentSel) == 1:
		current = currentSel[0]
		opName = "switch"
		parentNode = hou.node(current.path()).parent()

		# Get inputs and outputs
		outNodes = current.outputs()
		inNodes = current.inputs()

		#Create switch
		newNode = current.createOutputNode(opName)
		newNode.setName(opName, True)
		newNode.setColor(Color.Default)

		# Set correct inputs to switch node
		if len(inNodes) > 0:
			newNode.setFirstInput(inNodes[0])
			newNode.setNextInput(current)

		# Insert switch between current and its immediate output node
		if len(outNodes) > 0:
			currentOut = outNodes[0]
			currentOut.setFirstInput(newNode)

		newNode.moveToGoodPosition()