Houdini Tips Notes
HOM Tips
Since - Houdini 18.5.x Py3
The below tips are generated from exploring and testing functionality of the HOM (Houdini Object Model).
Navigate Network View
- Grab selected node.
- Get the desktop singleton instance.
- Query the desktop for the NetworkEditor pane tab.
- Using API from the
nodegraphview
package, change the network location using the selected node’s parent as the new destination.
import nodegraphview
node:hou.Node = hou.selectedNodes()[0]desktop:hou.Desktop = hou.ui.curDesktop()editor = desktop.paneTabOfType(hou.paneTabType.NetworkEditor)nodegraphview.changeNetwork(editor, node.parent(), moving_up=True)
HOM Unsorted Tips
Since - Houdini 18.5.x Py3
===== Load .hip file =====
# load(file_name, suppress_save_prompt=False, ignore_load_warnings=False)hou.hipFile.load('projectFile.hip')
Raises;
- Raises
hou.OperationFailed
if Houdini cannot read the file. - Raises
hou.LoadWarning
if loading the new file triggers warnings (such as missing assets).
See;
- https://www.sidefx.com/docs/houdini/hom/hou/hipFile.html - SideFX hou.hipFile
Save .hip file
# save(file_name=None, save_to_recent_files=True)hou.hipFile.save('projectFile.hip')
Clear .hip file
# clear(suppress_save_prompt=False)hou.hipFile.clear()
Merge .hip Files
# merge(file_name, node_pattern="*", overwrite_on_conflict=False, ignore_load_warnings=False)hou.hipFile.merge()
Raises;
hou.LoadWarning
hou.OperationFailed
Add Float Parm
kwargs
This example is a bare bones print of the kwargs
global session dictionary.
# ShelfTool: create_subnet_hda
def test_KWARGS(kwargs):print(kwargs)
test_KWARGS(kwargs)
# produces the following, its not scary at all!# (the data structure is dynamic though, a guessing game of keys...){ 'toolname': 'create_subnet_hda', 'panename': `, 'altclick': False, 'ctrlclick': False, 'shiftclick': False, 'cmdclick': False, 'pane': None, 'viewport': None, 'inputnodename': `, 'outputindex': -1, 'inputs': [], 'outputnodename': `, 'inputindex': -1, 'outputs': [], 'branch': False, 'autoplace': False, 'requestnew': False}
Network Editor
- Events are passed to the current context module (
nodegraph.py
by default), to a function namedhandleEvent()
. hou.NetworkEditor.pushEventContext()
HOM Class Notes
HOM hou.Desktop
Since - Houdini 18.5.x Py3
Methods
- name() →
str
- setAsCurrent()
- panes() →
tuple
ofhou.Pane
- floatingPanels() →
tuple
ofhou.FloatingPanel
- paneTabs() →
tuple
ofhou.PaneTab
- currentPaneTabs() →
tuple
ofhou.PaneTab
- floatingPaneTabs() →
tuple
ofhou.PaneTab
- paneTabOfType(type, index=0) →
hou.PaneTab
orNone
- findPane(pane_id) →
hou.Pane
orNone
- findPaneTab(name) →
hou.PaneTab
orNone
- createFloatingPaneTab(pane_tab_type, position=(), size=(), python_panel_interface=None, immediate=False) → hou.PaneTab
- createFloatingPanel(pane_tab_type, position=(), size=(), python_panel_interface=None, immediate=False) → hou.FloatingPanel
- shelfDock() → hou.ShelfDock
- displayHelp(node_type)
- displayHelpPath(help_path)
- displayHelpPyPanel(interface_name)
- displaySideHelp(show=True) →
hou.PaneTab
- paneUnderCursor()
- paneTabUnderCursor()
HOM hou.Pane
Since - Houdini 18.5.x Py3
A rectangular area of the desktop that contains one or more pane tabs.
Extends object
.
Methods =====
- TODO