Jump to content

Possible to interact with main menu via script?


MostHated

Recommended Posts

Hello,
I am wondering if it's possible to interact with the main menu via script (File, Edit, Assets, etc)? Such as returning a list of the current menu items at runtime. I say at runtime in case there are custom menu items which are not default, such as the RenderMan menu that shows up when it's installed, etc. Then if it is also possible to open specific menu items, or trigger their functionality via script? I have been searching all day in the help docs and github for examples but the closest things I can find have to do with what looks like simply creating new menu items with MenuParmTemplate().

I have found that there are menu items within MainMenuCommon.xml, but as an example, is there some way to get this info via something like menuList = hou.ui.getMenuNames() and then use hou.ui.openMenu(“h.Asset_Manager”)?

I also was trying to see if there was a way to a list of all current hotkeys. I see there are ways to get specific ones if you have the context code or vice versa, but I was trying to see if there was a way to just get all of them that there are currently?

Thanks,

Edited by MostHated
Link to comment
Share on other sites

I don't think there's an API to read or trigger default menu items but for some of the menus a Python API exists. (for example - opening the Type Property dialog and others). Last time I needed something like this, there was even no HDK access to the menus.

 

Link to comment
Share on other sites

The more I search, the more it seems like that is the case. It seems like most, if not all, of the menu items are present within the hotkey manager under the /Houdini/ context, so if I could figure out a way to dump everything that is in there, that might at least get me the names of everything.

Edited by MostHated
Link to comment
Share on other sites

Yeah, that would be the fallback I suppose, but I was hoping to get it from within the application, in case there are custom things added or mapped via Houdini.env, it would help to get them all directly from it. It seems like there should be some sort of way to get an active current list. I will just have to keep searching.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...