Search - User list
Full Version: How to hook to OnEnter of an existing Python state?
Root » Technical Discussion » How to hook to OnEnter of an existing Python state?
raincole
For example, I'd like to make Houdini to run some code when it enters KineFX state. But KineFX state is built-in, not written by me, and I'd not like to change Houdini's built-in Python code directly. Is it possible to hook my functions/scripts to an existing state so it's called upon entering that state?
mabelzile
You could install a callback on the hou.SceneViewer object where the state is running and listen for the hou.sceneViewerEvent.StateEntered event.

https://www.sidefx.com/docs/houdini21.0/hom/hou/SceneViewer.html#addEventCallback [www.sidefx.com]
raincole
mabelzile
You could install a callback on the hou.SceneViewer object where the state is running and listen for the hou.sceneViewerEvent.StateEntered event.

https://www.sidefx.com/docs/houdini21.0/hom/hou/SceneViewer.html#addEventCallback [www.sidefx.com]

Thank you very much! Exactly what I need.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB