forked from davegreenwood/zbw_python_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
haveRibbonSetupCtrlJnts.py
34 lines (26 loc) · 1.04 KB
/
haveRibbonSetupCtrlJnts.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
import maya.cmds as cmds
import zbw_rig as rig
#already have ribbon with shit-on of joints. Deleted control structure. Create a chain for the master controls
def ctrlSetup():
cmds.select(hi=True)
sel = cmds.ls(sl=True)
ctrlList = []
groupList = []
for x in sel:
if (cmds.listRelatives(x, p=True)):
cmds.parent(x, w=True)
#could rename joint here
ctrl = rig.createControl("%s_CTRL"%x, "cube", "x", "red")
ctrlList.append(ctrl)
group = rig.groupOrient(x, ctrl)
groupList.append(group)
cmds.parent(x, ctrl)
for x in range(len(ctrlList)-1, 0, -1):
#create a control for the move of the joint
#snap this to the joint
#parent the joint to the control
#switch this to parenting the new control to the other control . . .
cmds.parent(groupList[x], ctrlList[x-1])
#strip to rotateTranslate, then lock the translate of the old control
#strip to translate of the new control . . . (lock other channels other than up?2)
#TO-DO----------------put a "local" control onto the joint to do the up/down stuff for each control