- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello guys, I am trying to rig the fingers of my character but i get this error line on the second run. Kindly check if you would be able to help find the error(could it be the naming convention? Kindly see the screenshot attached):
import maya.cmds as cmds
def kl_fkChain(lookFor='FNG'):
root = cmds.ls(sl=1)
child = cmds.listRelatives(root, typ='joint', ad=1)
child.reverse()
allJnts = root + child
print allJnts
for j in allJnts:
if not 'End' in j:
grpN = j.replace('_JNT', 'Orient_GRP')
grpM = j.replace('_JNT', 'Modify_GRP')
ctl = j.replace('_JNT', '_CTRL')
cmds.circle(n=ctl)
cmds.group(n=grpN, em=1)
cmds.group(n=grpM, em=1)
cmds.parent(ctl, grpM)
cmds.parent(grpM, grpN)
tmpCons = cmds.parentConstraint(j, grpN, mo=0)
cmds.delete(tmpCons)
cmds.connectAttr("%s.rotate" % ctl, "%s.rotate" % j)
rel = cmds.listRelatives(j, p=1)
if rel:
if lookFor in rel[0]:
rel = rel[0].replace('_JNT', '_CTRL')
cmds.parent(grpN, rel)
kl_fkChain(lookFor='FNG')
Solved! Go to Solution.