-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmanagerUI.py
More file actions
42 lines (31 loc) · 1.38 KB
/
Copy pathmanagerUI.py
File metadata and controls
42 lines (31 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'''Creates a very simple UI, which is just a button on a specified shelf containing a popup with all the needed
control shape functions.'''
import maya.cmds as mc
# Local import
import functions
reload(functions)
SHELF_NAME = "Custom"
ICON_PATH = "C:/PATH_TO_ICONS"
if SHELF_NAME and mc.shelfLayout(SHELF_NAME, ex=1):
children = mc.shelfLayout(SHELF_NAME, q=1, ca=1) or []
for each in children:
try:
label = mc.shelfButton(each, q=1, l=1)
except:
continue
if label == "ctlShapeManager":
mc.deleteUI(each)
mc.setParent(SHELF_NAME)
mc.shelfButton(l="ctlShapeManager", i="commandButton.png", width=37, height=37, iol="CTL")
popup = mc.popupMenu(b=1)
mc.menuItem(p=popup, l="Save to library", c=functions.saveCtlShapeToLib)
sub = mc.menuItem(p=popup, l="Assign from library", subMenu=1)
for each in functions.getAvailableControlShapes():
mc.menuItem(p=sub, l=each[0], c=each[1])
mc.menuItem(p=popup, l="Copy", c=functions.copyCtlShape)
mc.menuItem(p=popup, l="Paste", c=functions.pasteCtlShape)
sub = mc.menuItem(p=popup, l="Set colour", subMenu=1)
for each in functions.getAvailableColours():
mc.menuItem(p=sub, l=each[0], c=each[1], i=ICON_PATH + each[2])
mc.menuItem(p=popup, l="Flip", c=functions.flipCtlShape)
mc.menuItem(p=popup, l="Mirror", c=functions.mirrorCtlShapes)