Is there a way to assign a keyboard shortcut to filter on...

   1213   7   2
User Avatar
Member
369 posts
Joined: 3月 2009
Offline
Is there a way to assign a keyboard shortcut to filter on non-default parameter values in the parameter window?

Thank you
User Avatar
Member
185 posts
Joined: 2月 2016
Offline
It's possible with a shelf tool:


Script code
paneTab = hou.ui.paneTabUnderCursor()
if paneTab.type() == hou.paneTabType.Parm:
    paneTab.setFilterMode(hou.parmFilterMode.GraphSelectedParms)    
    
    toggle = not paneTab.filterEnabled()    
    paneTab.setFilterEnabled(on=toggle)

Currently the hou.parmFilterMode... does not match up with the menu, so you need to use the "graph selected parms" for it to select "non-default parms" I'll submit a bug report for that.
Edited by AslakKS - 2024年6月8日 16:26:16

Attachments:
toggle_parm_filter.png (411.2 KB)

User Avatar
Member
369 posts
Joined: 3月 2009
Offline
Thank you kindly. I’ll try it out. Appreciate your help.
User Avatar
Member
369 posts
Joined: 3月 2009
Offline
AslakKS
paneTab = hou.ui.paneTabUnderCursor()
if paneTab.type() == hou.paneTabType.Parm:
paneTab.setFilterMode(hou.parmFilterMode.GraphSelectedParms)

toggle = not paneTab.filterEnabled()
paneTab.setFilterEnabled(on=toggle)

So doesn't seem to work... I mean it filters, but not on 'parameters with non-default values'...
User Avatar
Member
369 posts
Joined: 3月 2009
Offline
Actually, never mind. Changed the code to:

paneTab = hou.ui.paneTabUnderCursor()
if paneTab.type() == hou.paneTabType.Parm:
paneTab.setFilterMode(hou.parmFilterMode.NonDefaultParms)

toggle = not paneTab.filterEnabled()
paneTab.setFilterEnabled(on=toggle)
User Avatar
Member
185 posts
Joined: 2月 2016
Offline
Oh, nice they must have fixed that bug 🪲👏
User Avatar
Member
143 posts
Joined: 6月 2024
Offline
and I get an error...

Attachments:
Screenshot 2024-07-25 143550.jpg (133.7 KB)

User Avatar
Member
185 posts
Joined: 2月 2016
Offline
You need to indent after the if:
paneTab = hou.ui.paneTabUnderCursor()
if paneTab.type() == hou.paneTabType.Parm:
   paneTab.setFilterMode(hou.parmFilterMode.NonDefaultParms)

   toggle = not paneTab.filterEnabled()
   paneTab.setFilterEnabled(on=toggle) 
  • Quick Links