How to hook to OnEnter of an existing Python state?
358 2 0-
- raincole
- Member
- 732 posts
- Joined: 8月 2019
- オフライン
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
- スタッフ
- 455 posts
- Joined: 2月 2018
- オフライン
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]
https://www.sidefx.com/docs/houdini21.0/hom/hou/SceneViewer.html#addEventCallback [www.sidefx.com]
-
- raincole
- Member
- 732 posts
- Joined: 8月 2019
- オフライン
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.
-
- Quick Links

