Studio-Wide Hotkeys

What methods are you guys using to maintain hotkeys across Maya versions and computers?

The scenario is; a new user is registered with the studio and has a fresh workstation-setup with default install of Maya et al. Once booted up, shelves, menus, hotkeys and various environment variables are setup for the individual user.

Another scenario is; Maya is updated and preferences from previous version can’t be trusted to fit updated version (say 2008 to 2014 in extreme scenario)

I can think of two solutions right off the bat.

  1. Copy a vanilla Maya Preferences folder into the users home dir
  2. Use cmds.hotkey() command in conjunction with cmds.namedCommand() to write hotkeys upon first launch.

Are these sufficient for you, what else is there and why are you using what you’re using?

haha thats a good one!
each artist here has their own way of working and i wouldn’t dare force hotkeys on em! :slight_smile:

seriously tho, what i do is register all commands with Maya as RunTimeCommands. This allows me to populate Menus, Marking Menus and Shelves with the same commands each artist can assign custom hotkeys too. This gives me a buffer between code and hotkeys to fix bugs or rename functions without invalidating a shelf button or hotkey.

it would be a very bad choice to force hotkeys, marking menus or shelfs. All it will accomplish is making your art team very angry and frustrated.

I hear ya. It’s not about forcing hotkeys onto people. But rather, just like Maya ships with a set of hotkeys - e.g. ctrl-a for Attribute Editor - a few hotkeys may apply to studio tools like publishing or mirroring a pose.

Then, if a user overwrites any of the studio hotkeys, no matter. Just like we can override the default Maya keys.

Basically, I’m looking to augment Maya’s default setup.

runTimeCommand seems quite similiar to nameCommand

Any specific reason you’re using a MEL-only equivalent?

no reason, but now that you mention it, i may go back and change it over to use nameCommand…

After some digging around, it seems commands made via runTimeCommand appears in the hotkey menu, categorised via the “category” flag. And, it is available for python too, via cmds.runTimeCommand, although it is undocumented except for this little snippet.

Running it via MEL requires a command in MEL whereas running it via Python requires a command in Python. userCommand provides a choice via the -sourceType flag whereas runTimeCommand does not.

E.g.

: runTimeCommand -command (“polyCube”) myMelCommand
>>> cmds.runTimeCommand(“myPythonCommand”, command=“cmds.polyCube()”)

Then they’re both available via python like you would expect
>>> cmds.myPythonCommand()
>>> cmds.myMelCommand()

And also via MEL
: myPythonCommand
: myMelCommand

In addition to being stored in the userRunTimeCommands.mel in your \2014-x64\prefs folder

Still unsure of where nameCommand is useful over runTimeCommand. Their only difference, as far as I can tell, is that one is accessible via the Python cmds module and the hotkeys window, and one is not.

Thoughts?

Still unsure of where nameCommand is useful over runTimeCommand. Their only difference, as far as I can tell, is that one is accessible via the Python cmds module and the hotkeys window, and one is not

That is the big one - runtimeCommand does the work, nameCommand wraps a runtimeCommand or snippet and makes it accessible in the hotkey editor.

Ah, there we go. Thanks Theodox.

You mean the other way around, right? nameCommand does the work and runTimeCommand wraps it?

you can set the language of the runTimeCommand using the “-cl” flag.
as you already surmised, I used runTimeCommands because they can be categorized in the hotkey editor.

Excellent, makes sense now.