Yvy Yeung
Yvy Yeung

Reputation: 1

# TypeError: 'list' object is not callable #

OK, so I'm learning python and I'm just trying to write a script in Maya where I can reorient joints in my scene. I keep getting an error that says

# TypeError: 'list' object is not callable # 

If anyone can help me fix this I'd greatly appreciate it!!

selJnt = cmds.ls (selection=True)

for allJnts in selJnt():

     get_jnt_rx = cmds.getAttr (allJnts + ".rx")
     get_jnt_ry = cmds.getAttr (allJnts + ".ry")
     get_jnt_rz = cmds.getAttr (allJnts + ".rz")

     cmds.setAttr ((allJnts + ".jointOrientX,"), get_jnt_rx)
     cmds.setAttr ((allJnts + ".jointOrientY"), get_jnt_ry)
     cmds.setAttr ((allJnts + ".jointOrientZ"), get_jnt_rz)

     cmds.setAttr ((allJnts + ".rx,"), 0)
     cmds.setAttr ((allJnts + ".ry,"), 0)
     cmds.setAttr ((allJnts + ".rz,"), 0)

Upvotes: 0

Views: 1638

Answers (1)

NPE
NPE

Reputation: 500357

Remove the parentheses in:

for allJnts in selJnt():
                     ^^ THESE

Here, selJnt is a list and you're trying to treat it as if it were a function.

Upvotes: 2

Related Questions