help me with a python problem!

   2699   3   0
User Avatar
Member
5 posts
Joined: 5月 2012
Offline
Hi all,

currently, I am working on characterRigging series and now am on inverseKIinCHOPsInAnAsset. The problem is that the python code according to the DVD doesn't work in my version, houdini12. This down below is the syntax.

channles = pwd().node(“../KIN_L_bone1”).tracks()
returnString = ‘ ’

for channel in channels:
splitName = channel.name().split('/')
newName = splitName

returnString += newName + ‘ ’


return returnString


But then after typing this code, an Error message that says “Unable to evaluate expression” pops up. I have a guess of the problem but am not sure.

After creating bones by inverse Kinematics, diving into a KIN Chops and laying down a rename sop, I need to type this code first at the To of the rename sop according to the DVD

returnString = ‘*’
return returnString

After that, if I click ‘toggle expression’ on the To of it, the color of blink is supposed to change but then it doesn't. So I just pushed alt + left click on it that changes the color. But I don't feel like it's a right method.

What could possibly be the problem in your opinion. Help me.

thanks.
User Avatar
Member
7901 posts
Joined: 7月 2005
Offline
Try right-clicking on the parameter and choosing Expression > Use Python (or something like that).
User Avatar
Member
5 posts
Joined: 5月 2012
Offline
thanks! running expression by right-clicking is working, and yet, the syntax brings me an error message.

Error: Unable to evaluate expression (
Traceback (most recent call last):
File “<stdin>”, line 2, in expression
AttributeError: ‘NoneType’ object has no attribute ‘tracks’
(/obj/KIN_Chops/rename1/renameto)).
Warning: This CHOP has no effect.

Do you have any idea?
User Avatar
Member
7901 posts
Joined: 7月 2005
Offline
It looks like you function call to node() didn't find a node.
  • Quick Links