Bubble Up network editor tool
Take a selected node in a Network Editor pane and swap it (bubble up) with the node connected to the first input.
This tool does not work in the VOP context. This tool works best when you assign a hotkey to it.
||Added the Bubble Up tool.
||OBJ SOP POP CHOP ROP COP2 DOP
# Produced by:
# Graham Thompson
# Name: net_bubble_up.shelf
# Comments: Take a selected node and bubble it up in the Network Editor.
# Version: 1.0
# Compatibility: Houdini 9.0
# Get the pane the tool was invoked from.
pane = kwargs["pane"]
# If it isn't a Network Editor we need to look for some.
if not isinstance(pane, hou.NetworkEditor):
# Get the current desktop.
desktop = hou.ui.curDesktop()
# Search for Network Editor pane tabs in the desktop that are the
# current (displayed) tab.
net_editors = [panetab for panetab in desktop.paneTabs()
if isinstance(panetab, hou.NetworkEditor)
# Throw an OperationFailed exception if none were found.
if len(net_editors) is 0:
raise hou.OperationFailed("No Network Editor pane tabs found.")
# Set pane to be the first editor found.
pane = net_editors
# Get the current path of the editor.
cwd = pane.pwd()
# Get a list of the selected nodes.
selected_nodes = [child for child in cwd.children()
#TODO: Handle multiple nodes that are connected in a chain.
if len(selected_nodes) is not 0:
for node in selected_nodes: