Search code examples
mayahotkeysmel

Getting Maya Custom Hotkeys List


I want to share my Maya hotkeys for custom commands along team. Of course, I can use "hotkeySet" command with -export, -import. But in this case, it override all of them with the file. It means that

If I change "save file" to "Ctrl + Alt + S" (sure, it's so weird). I don't want to make my team members to use that weird hotkey.

How can I get the list of my custom hotkeys? If I can know that, I can export and import them selectively.


Solution

  • If you want to share your Maya's custom hotkeys along your colleagues, you'll need to copy userHotkeys.mel (or userHotkeys_Maya_Default_Duplicate.mel) and userNamedCommands.mel files from your comp to the destination team's comp. One more file named userRunTimeCommands.mel is typically empty one.

    These files are located in the following directories on different OS:

    macOS~/Library/Preferences/Autodesk/maya/2016.5/prefs/hotkeys

    Linux~<username>/maya/2016.5-x64/prefs

    Windows\Users\<username>\Documents\maya\2016.5-x64\en_US\prefs

    If you open Maya's Script Editor and check Echo all Commands option on and then save a custom shortcut in Hotkey Editor, you'll notice that Maya saves/updates these three files when you create or edit your hotkey.

    For instance, I've created hotkey Alt G for toggling a grid in Viewport.

    hotkey -keyShortcut "g" -alt -name ("ToggleGridNameCommand");
    

    This is what I can see in Script Editor:

    enter image description here

    After that you can share saved userHotkeys.mel and userNamedCommands.mel files along your team. Also you can edit these ASCII files in any Text Editor.