ERROR: unsupported operand type(s) for +: 'float' and 'tuple'???

ERROR: unsupported operand type(s) for +: 'float' and 'tuple'???

danispag
Enthusiast Enthusiast
2,980 Views
1 Reply
Message 1 of 2

ERROR: unsupported operand type(s) for +: 'float' and 'tuple'???

danispag
Enthusiast
Enthusiast

I have this line of code and when I run the script i'm getting this error:

Code:

cmds.xform('leftFoot_CTRL', translation = ((t_foot_wrp[0] - t_foot_drp[0] + curr_transform[0]), (t_foot_wrp[1] - t_foot_drp[1] + curr_transform[1]), (t_foot_wrp[2] - t_foot_drp[2] + curr_transform[2])), ws = True)

 

Error:

unsupported operand type(s) for +: 'float' and 'tuple' #

 

Can anyone help me fix this please?

Thanks

Daniel

0 Likes
2,981 Views
1 Reply
Reply (1)
Message 2 of 2

lee.dunham
Collaborator
Collaborator

Looks like one (or more) of the values you are trying to add are in fact tuples.

my_var = ((0.0, 1.0, 2.0))

This can happen if you use getAttr on a compound attribute.

Try printing the the variables you are trying to add in order to see what the issue is.

You'll likely need to unpack the flavors you want from the nested tuple (guessing).

0 Likes