selectedNodes(include_hidden=False)
→ tuple
of hou.OpNode
Returns a sequence of hou.OpNode objects representing the nodes that are currently selected.
print("The following nodes are currently selected:") for node in hou.selectedNodes(): print(node.path())
The last selected item has special meaning in Houdini: it controls what network unpinned panes focus on.
selected = hou.selectedNodes() # In Python, a negative index counts from the end print("Following:", selected[-1])