Handles in HDA's - how to toggle them on and off

   8619   8   4
User Avatar
Member
32 posts
Joined: Jan. 2017
Offline
Hello all,

I exported several handles to an HDA I'm working on and I need them to toggle on and off automatically according to what the user specifies in the ordered menu, I can't get it to work nor can I find any documentation on what to do.

I see in the binding's tab there's an onoff parameter but nothing happens when I try to put in a boolean. And the coding for “hide when” or “disable when” doesn't work with handles, only parameters…I've had that put into the translation parameters the handle is controlling but it doesn't hide the handles. For the record I'm not a programmer so not sure if this is even a scripting issue, but figured there's at least be a user friendly option.
User Avatar
Member
32 posts
Joined: Jan. 2017
Offline
User Avatar
Member
12 posts
Joined: May 2015
Offline
Hey mate, did you end up figuring this one out? I'm having a similar issue here
User Avatar
Member
12 posts
Joined: Oct. 2016
Offline
Me too, would be glad about any ideas
User Avatar
Member
1 posts
Joined: April 2018
Offline
There is a little Hide When in the Type property window that allows you to types in conditions to hide certain parameters for the HDA. The iamge is an example from auto UV sop in Game shelf tools.

Attachments:
autoUV.PNG (68.2 KB)

User Avatar
Member
1265 posts
Joined: March 2014
Offline
I'm sitting with the same problem at the moment. Did you managed to get it to work?
Werner Ziemerink
Head of 3D
www.luma.co.za
User Avatar
Member
17 posts
Joined: July 2013
Offline
Same issue here.
User Avatar
Member
12 posts
Joined: May 2017
Offline
The ability to show/hide handles through Python looks like it was added in Houdini 17 along with the Python States [www.sidefx.com] update. As far as I can see, you still can't toggle the visibility on the node/handle itself, rather you can show/hide it in a specific scene viewer with hou.SceneViewer.showHandle [www.sidefx.com]

If you're writing your own state, your class should be keeping a reference to the scene viewer to use.
If you're just using standard promoted handles, it's less straightforward. You can just do
import stateutils
sv = stateutils.findSceneViewer()
sv.showHandle("Transformer",False)
However, that could start breaking for people with a desktop layout with more than one sceneviewer (or with no sceneviewers). You'd really have to loop over all the scene viewers (using hou.ui.paneTabOfType(hou.paneTabeType.SceneViewer, index))and try to hide the handle in all of them
Edited by Leaf - March 4, 2019 20:08:11
User Avatar
Member
17 posts
Joined: July 2013
Offline
Ben Laidlaw showed me another way: create a toggle param and bind it to the handle's onoff thing. At that point the checkbox controls handle visibility. To automate it just hide the param and change its value from a python module in the Scripts tab, using arbitrary logic.
  • Quick Links