On this page |
This class inherits from Qt’s QtWidgets.QToolButton
class.
Signals ¶
nodeSelected(str)
This signal is emitted when a selection is made in the node chooser dialog.
Methods ¶
__init__()
Create and return a new NodeChooserButton object.
setNodeChooserRelativeToNode(relative_to_node)
Set the reference node to use in the node chooser dialog. This will cause the Use Relative Paths checkbox in the dialog to be set. Node paths returned by the node chooser dialog will be relative to the reference node when the checkbox is set.
relative_to_node
must be a hou.OpNode object.
If no reference node is set or if the Use Relative Paths checkbox is not set then returned paths will be absolute.
setNodeChooserInitialNode(initial_node)
Set the node that is initially selected when the node chooser dialog is opened.
initial_node
must be a hou.OpNode object.
setNodeChooserFilter(node_filter)
Set the node type filter used by the node chooser dialog.
node_filter
must be a hou.nodeTypeFilter enumerated value.
setSelectMultiple(value)
Set if multiple nodes should be selectable with the chooser dialog.
Examples ¶
This example demonstrates creating a chooser button for SOP nodes and hooking it to a callback function that is invoked when a node is selected from the chooser dialog:
def onNodeSelected(node_path): print("Selected node:", node_path) node_chooser_btn = hou.qt.NodeChooserButton() node_chooser_btn.setNodeChooserFilter(hou.nodeTypeFilter.Sop) node_chooser_btn.nodeSelected.connect(onNodeSelected)