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 badge1 Answer
Reset to default 0My use of quoting quotes was causing the issue. If I change
test='"x"'
to instead be
test='x'
Then the argument accepts the variable.
本文标签:
版权声明:本文标题:How can I use a variable for my skipTranslate argument within my parentConstraint command with Python in Maya? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741636024a2389643.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论