Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

ValueError: file <maya console> line 30: No object matches name: l_handFNGAJA_CTRL

ValueError: file <maya console> line 30: No object matches name: l_handFNGAJA_CTRL

Oladoyinbodaniel
Contributor Contributor
2,410 Views
5 Replies
Message 1 of 6

ValueError: file <maya console> line 30: No object matches name: l_handFNGAJA_CTRL

Oladoyinbodaniel
Contributor
Contributor

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')

 

Autodesk Maya 2019_ C__Users_Victor_Documents_maya_projects_FemaleCharacter_scenes_SmaallgirlManoRig2019.ma_   ---   l_indexFNGAJA_JNT 9_19_2020 4_18_47 PM.png

Accepted solutions (1)
2,411 Views
5 Replies
Replies (5)
Message 2 of 6

mcw0
Advisor
Advisor

Might I suggest some additional print statements.  They are a great way to debug.  I would print when you create your "_CTL" node so you know what you've created.  Then another print of "rel" so you know what you are trying to parent to.  You might want to add a conditional to check if "rel" exists.  And then give yourself another print statement to inform you if it does not.  This way, your code won't error and you get useful information.

Message 3 of 6

Oladoyinbodaniel
Contributor
Contributor

Thanks for the reply. I'm pretty new to python in Maya and do not know how to really workaround it yet. Just following tutorials.

0 Likes
Message 4 of 6

Oladoyinbodaniel
Contributor
Contributor
Accepted solution

Figured it out. It was my naming of joints. I added the 'FGN' to the parent node of my joints😅. This was what caused the error and it's working fine now after removing it. Cheers😁

0 Likes
Message 5 of 6

adamghering
Contributor
Contributor

and what is FGN?  can you post the exact code to fix this?  as Im having the same issue

0 Likes
Message 6 of 6

mcw0
Advisor
Advisor

I think that was a typo.  I think he meant "FNG" for "finger".

0 Likes