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

   9472   9   5
User Avatar
Member
32 posts
Joined: 1月 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: 1月 2017
Offline
User Avatar
Member
12 posts
Joined: 5月 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: 10月 2016
Offline
Me too, would be glad about any ideas
User Avatar
Member
1 posts
Joined: 4月 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
1268 posts
Joined: 3月 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
18 posts
Joined: 7月 2013
Offline
Same issue here.
User Avatar
Member
12 posts
Joined: 5月 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 - 2019年3月4日 20:08:11
User Avatar
Member
18 posts
Joined: 7月 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.
User Avatar
Member
708 posts
Joined: 2月 2017
Offline
Is there a way to hide them completely? The on/off toggle in the Handle Bindings Tab only greys them out. But they are still visible in the viewport and still recognize the mouse. So when an active handle(one I actually want to use) is overlayed by a off-toggled one. the active one is hard to select as the mouse wants to grab the inactive one, too. Why does the on/off toggle not hide them completely....

Cheers
CYTE
  • Quick Links