Maya python中的列表的setAttr

托米斯

我仍在弄清楚Python和Maya是如何协同工作的,所以请原谅我的无知。所以我试图使用像这样的循环来改变玛雅关节列表的属性:

for p in jointList: cmd.getAttr(p, 'radius', .5)

我得到这个错误:

Invalid argument 1, '[u'joint1']'. Expected arguments of type ( list, )

我不知道我在做什么错。

阿查延

除非您使用pyMel,否则需要指定要获取或设置的属性名称和节点。

对于getAttr:

for p in jointList:
    val = cmd.getAttr('%s.radius' % (p))

对于setAttr:

for p in jointList:
    cmd.setAttr('%s.radius' % (p), .5)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章