Using hotkey with python actions

Using hotkey with python actions

haggi_master
Advocate Advocate
991 Views
3 Replies
Message 1 of 4

Using hotkey with python actions

haggi_master
Advocate
Advocate

Hi,

I added an extra menu to the max main menu. Now I want to assign a hotkey to one on the menu commands. In the Cusomize UI -> Keyboard interface I can see my actions but assigning a hotkey silently fails. 

 

Maybe it has something to do with macro scripts? Can hotkeys only be assigned to macro scripts?

 

 

0 Likes
Accepted solutions (1)
992 Views
3 Replies
Replies (3)
Message 2 of 4

Kreaction
Advocate
Advocate
Accepted solution

Not a solution, but have a look here:

https://forums.autodesk.com/t5/3ds-max-programming/max2018-maxscript-menu-with-icons/td-p/7052579

 

I have set a python script defining QActions in a custom Qmenu parented to menubar(). But for being accessible via toolbar buttons or hotkey, I did ad a function in my python script that also define a macroscript through a maxscriptEval. So my menu entries are accessible into its category and can be used.

 

There is still one annoying thing with custom python menu. If you access CustomizeUI, menu and change something, the custom qt menu disappear. It is also like this with yours ?

 

 

0 Likes
Message 3 of 4

haggi_master
Advocate
Advocate

Thank you. I came up with another solution. I simply created some small macros in the startup maxscript and source and call my python functions directly form this macros. Works fine.

0 Likes
Message 4 of 4

Kreaction
Advocate
Advocate

Good!

 

Do you have same problem with custom Qt menu disappearing when changing menu in customize UI ?

0 Likes