admin管理员组

文章数量:1296894

I am trying to use a variable for my skipTranslate argument in my parentConstraint command in Maya. What I want is for "x" to be inserted into the skipTranslate argument by my variable "test"....

test='"x"'
cmds.parentConstraint ('pCube1','locator1',st=[test])

This does not work though as I get a Runtime Error stating that the argument is invalid as the argument must be x, y or z.

If I write in "x" myself to the arg it works, but I need to have it be filled in by a variable for the larger tool to work...is there a way to do this?

I am very new and teaching myself so I appreciate any help. Thank you

I am trying to use a variable for my skipTranslate argument in my parentConstraint command in Maya. What I want is for "x" to be inserted into the skipTranslate argument by my variable "test"....

test='"x"'
cmds.parentConstraint ('pCube1','locator1',st=[test])

This does not work though as I get a Runtime Error stating that the argument is invalid as the argument must be x, y or z.

If I write in "x" myself to the arg it works, but I need to have it be filled in by a variable for the larger tool to work...is there a way to do this?

I am very new and teaching myself so I appreciate any help. Thank you

Share Improve this question asked Feb 11 at 20:38 JayJay 211 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

My use of quoting quotes was causing the issue. If I change

test='"x"'

to instead be

test='x'

Then the argument accepts the variable.

本文标签: