-
Notifications
You must be signed in to change notification settings - Fork 0
/
Connecto
63 lines (38 loc) · 1.76 KB
/
Connecto
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#################################################################
###################### Connecto ########################
#################################################################
#Author:Siddarth Mehra
#Email:[email protected]
#Mobile: +91-7728050400(Whatsapp)
#just run it than you can run c() from the command line, select any two object/nodes and run it'll connect object quicly
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')