-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEyeRig
More file actions
28 lines (20 loc) · 642 Bytes
/
Copy pathEyeRig
File metadata and controls
28 lines (20 loc) · 642 Bytes
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
from maya import cmds, OpenMaya
center = 'center'
vtx = cmds.ls(sl=1, fl=1)
for v in vtx:
cmds.select(cl=1)
jnt = cmds.joint()
pos = cmds.xform(v, q=1, ws=1, t=1)
cmds.xform(jnt, ws=1, t=pos)
posC = cmds.xform(center, q=1, ws=1, t=1)
cmds.select(cl=1)
jntC = cmds.joint()
cmds.xform(jntC, ws=1, t=posC)
cmds.parent(jnt, jntC)
cmds.joint(jntC, e=1, oj="xyz", secondaryAxisOrient="yup", ch=1)
sel = cmds.ls(sl=True)
for s in sel:
loc = cmds.spaceLocator()[0]
pos = cmds.xform(s, q=1, ws=1, t=1)
cmds.xform(loc, ws=1, t=1)
par = cmds.listRelatives(s, p=1)[0]