How to switch active radial menu programmatically?

   977   1   1
User Avatar
Member
373 posts
Joined: 6月 2023
オフライン
I'm trying to use radial menus more in my workflow. However, selecting which radial menu to activate from this menu is a bit tedius:



I know I can set a hotkey for each radial menu. But I think a better way is to make a "radial menu of radial menus", where I can switch the active radial menu. To do so I need to:

1. get a list of radial menus in python
2. switch active radial menu in python

What's the API for this?

Attachments:
Screenshot 2023-12-01 225534.png (31.3 KB)

User Avatar
Member
13 posts
Joined: 1月 2015
オフライン
To get a list of radial menus:
hou.ui.radialMenus()

You can check, which menu is active with:
hou.getPreference('radialmenu.val')

Also you can set it with:
hou.setPreference('radialmenu.val', '2')

But... menu bar doesn't refresh and it updates when I hover cursor over radial menu option. I suppose there's some command to run after setting preferences. I don't know.

One thing to note - I haven't tested this solution properly and I'm not sure if this is the right way to do it. Use it at your own risk.
  • Quick Links