issue using cmds.getAttr()
Not applicable
03-12-2018
04:50 AM
Hi guys!
I am trying to make a python script that gives me back the translate attribute of my maya selected objetcs.
This is what I have for now (only for the selected geometry on my maya scene).
if cmds.ls(geometry=True):
selectedObjects= cmds.ls(sl=True)
for item in selectedObjects:
translate = cmds.getAttr(item.translate)
I am getting the following error;
# Error: TypeError: file <maya console> line 4: Object <built-in method translate of unicode object at 0x00000000A0A106F0> is invalid #
Same happens if I use a string instead of unicode.
I am trying to follow the maya docs but I can't spot my error for now.
If someone has used this command previously and can help me would be much appreciatted.
Thanks,
Joan
Link copied