-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path_HotKey.py
More file actions
20 lines (16 loc) · 797 Bytes
/
Copy path_HotKey.py
File metadata and controls
20 lines (16 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import maya.cmds as mc
def main():
# Returns all available hotkey sets in Maya
hotkeySetList = cmds.hotkeySet( q=True, hotkeySetArray=True )
hotkeySetListSize = len(hotkeySetList)
if hotkeySetListSize == 1:
return
currentHotkeySet = cmds.hotkeySet( q=True, current=True )
if hotkeySetList.index(currentHotkeySet) == hotkeySetListSize - 1:
hotkeySet = cmds.hotkeySet( hotkeySetList[0], e=True, current=True )
mc.warning("Switched to '{}' hotkey set.".format(hotkeySetList[0]))
else:
cmds.hotkeySet( hotkeySetList[hotkeySetList.index(currentHotkeySet) + 1], e=True, current=True )
mc.warning("Switched to '{}' hotkey set.".format(hotkeySetList[hotkeySetList.index(currentHotkeySet) + 1]))
if __name__ == "__main__":
main()