Maya allows window sensitive hotkeys, but what about marking menus?

Maya allows window sensitive hotkeys, but what about marking menus?

gilleybaba
Contributor Contributor
477 Views
1 Reply
Message 1 of 2

Maya allows window sensitive hotkeys, but what about marking menus?

gilleybaba
Contributor
Contributor

So Maya lets you have window/editor sensitive hotkeys. You can set up a key to do different things depending if you are in the model panel or graph editor for example.  It's a really helpful feature if you use lots of hotkeys.

 

Has anyone ever tried to make editor sensitive marking menus though? A different marking menu would pop up depending on which window you're in, by pressing the same hotkey the marking menu is assigned to.


I can't seem to get it to work with Maya's hotkey editor. I'm probably going to have to code this functionality myself.  I was curious if there's a more simple process first though.

0 Likes
Accepted solutions (1)
478 Views
1 Reply
Reply (1)
Message 2 of 2

gilleybaba
Contributor
Contributor
Accepted solution

I found a code solution to my issue.  If I could figure out how to post formatted code to this forum I would do it Smiley Happy  I wasn't able to find a way for the Hotkey Editor to have window sensitive marking menus.

 

You basically do a cmds.getPanel(underPointer=True) and store that in a variable, then do 2 if statements.  If the panel.startswith("graphEditor1") create the popupMenu for the graph editor.  If the panel.startswith("modelPanel") create the popupMenu for the modelPanels.

 

Then you hotkey this to something.  But then you have to assign a "release" function to this hotkey the same way you would with any other marking menu.  This release function needs to check if either of the popupMenus exist.  If so, deleteUI on the popupMenu.