Archived post by bonsain

Yep, precisely:
PythonModule (or external module to be reused). It’s quite simple, really. Most of the below is just the docstring 😛 “` def fix_inputs(node): “””Shifts inputs of node to remove gaps This function is to be called from an onInputChanged Event Handler inside of the Operator Type Properties’ Script section. To avoid triggering further onInputChanged callbacks while running, a temporary cachedUserData gets added that exits this function early until it is complete. Args: node (:class:`hou.Node`): node to remove empty inputs from. “”” if node.cachedUserData(“skip_onInputChanged”): return if not all(node.inputs()): node.setCachedUserData(“skip_onInputChanged”, True) for i, input_connection in enumerate(node.inputConnections()): node.setInput(input_connection.inputIndex(), None) node.setInput(i, input_connection.inputItem()) node.destroyCachedUserData(“skip_onInputChanged”) “`
onInputChanged: “` node = kwargs[“node”] node.hdaModule().fix_inputs(node) “`

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20233812/14/23/custom_merge_vs_naive_01.gif