I was used to create the "old" handles to my HDAs. But now, for the first time, I need a "realtime" python callback, while user is manipulating the Xform handle.
Should I bind viewport callback to the "oldschool" handle? Should I do that in OnCreated script?
I managed to create a Viewer State for my HDA, create a Xform handle, and I am geting onParmChangeEvent() readings of handle parameters, but so far I did not manage to bind the handle to the object's parm interface. (the Xform always emerges at {0,0,0})
Please, what is the preferred way in this situation?
Thank you very much.
Viewport Xform Handle manipulation & Python Callback (HDA)
2789 5 1-
- ikoon
- Member
- 214 posts
- Joined: Jan. 2016
- Offline
-
- mabelzile
- Staff
- 447 posts
- Joined: Feb. 2018
- Offline
You should be able to bind a xform handle to your HDA without having to write a viewer state. You can do this by mapping editable parms on your HDA to the xform handle parms from the Handles tab [www.sidefx.com]
With a viewer state, it can be done programmatically with hou.ViewerStateTemplate.bindHandleStatic or hou.ViewerStateTemplate.bindHandle. See documentation [www.sidefx.com] for details. You can also look at this example file for a live demo $HFS/houdini/viewer_states/examples/bend_demo.hip
With a viewer state, it can be done programmatically with hou.ViewerStateTemplate.bindHandleStatic or hou.ViewerStateTemplate.bindHandle. See documentation [www.sidefx.com] for details. You can also look at this example file for a live demo $HFS/houdini/viewer_states/examples/bend_demo.hip
-
- ikoon
- Member
- 214 posts
- Joined: Jan. 2016
- Offline
Marc thank you very much for your answer.
Please, is it possible to get a Python Callback Script called while manipulating the "classic" handle in the viewport? Without writing a custom viewer state?
I did this:
- bind the "classic" handle to a parm
- set Callback Script to that parm
But that Callback Script is called only while editing the parm value in the Parameters Pane (MMB Ladder or keyboard entry, or scroll wheel).
Please, is it possible to get a Python Callback Script called while manipulating the "classic" handle in the viewport? Without writing a custom viewer state?
I did this:
- bind the "classic" handle to a parm
- set Callback Script to that parm
But that Callback Script is called only while editing the parm value in the Parameters Pane (MMB Ladder or keyboard entry, or scroll wheel).
-
- ikoon
- Member
- 214 posts
- Joined: Jan. 2016
- Offline
-
- mabelzile
- Staff
- 447 posts
- Joined: Feb. 2018
- Offline
You can't bind a python callback directly to a handle. You can only do this in a python state when binding an handle dynamically. [www.sidefx.com]
-
- ikoon
- Member
- 214 posts
- Joined: Jan. 2016
- Offline
-
- Quick Links