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.
Copy a vanilla Maya Preferences folder into the users home dir
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!
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.
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.
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.
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.
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.
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.