-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathConnectO.py
39 lines (31 loc) · 1.23 KB
/
ConnectO.py
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
import maya.cmds as cmds
import sys
def c():
c=cmds.promptDialog(
title='ConnectAttrs',
message='t for trans,r for rotate,s for scale,a for all',
button=['Connect', "Don't Connect"],
defaultButton='Connect',
cancelButton="Don't Connect",
dismissString='Bitch')
if c=='Connect':
text = cmds.promptDialog(query=True, text=True)
a = str(text)
sel = cmds.ls(sl=True)
if a == 't':
cmds.connectAttr((str(sel[0])+'.'+'t'),(str(sel[1])+'.'+'t'))
print 'Connected Translation'
elif a == 'r':
cmds.connectAttr((str(sel[0])+'.'+'r'),(str(sel[1])+'.'+'r'))
print 'Connected Rot'
elif a == 's':
cmds.connectAttr((str(sel[0])+'.'+'s'),(str(sel[1])+'.'+'s'))
print 'Connected Scale'
elif a == 'a':
cmds.connectAttr((str(sel[0])+'.'+'s'),(str(sel[1])+'.'+'s'))
cmds.connectAttr((str(sel[0])+'.'+'t'),(str(sel[1])+'.'+'t'))
cmds.connectAttr((str(sel[0])+'.'+'r'),(str(sel[1])+'.'+'r'))
print 'Connected All'
elif c =="Don't Connect":
pass
sys.stdout.write('Nothing connected')