phm() → hou.HDAModule
“This shortcut lets you write hou.phm() instead of hou.pwd().hdaModule()
. You are most likely to use this shortcut from event handlers, button callbacks, and menu generation scripts in digital assets.”
It is Houdini’s Help.
But phm()
and hou.pwd().hdaModule()
do not work in event handlers.
Use instead in event handlers:
kwargs['node'].hdaModule().foo()
Otherwise, you can use hou.phm()
to access the Python Module in the asset. For example, to call a function when a button is pressed:
hou.phm().foo(kwargs['node'])
It is worth noting that the kwargs dictionary is fully accessible only in events. Only kwargs['type']
is available in the Python Module:
https://www.sidefx.com/docs/houdini/hom/locations.html#node_event_kwargs