我目前有一个字符串列表,需要在其中转换为命令。
IE:
"checkerText.outAlpha" needs to be checkerText.outAlpha有没有一个命令可以将字符串转换为pymel的命令?
我需要这个,这样我才能将两个着色器连接在一起。
IE:
'checkerText.outAlpha' >> 'layText.inputs[0].alpha'
needs to be
checkerText.outAlpha >> layText.inputs[0].alpha发布于 2013-07-15 11:15:37
具体地说,对于pymel节点,inputs属性实际上是一个layeredTexture方法,因此它返回该节点的输入节点。为了获得期望的结果,您必须通过pymel的Attribute()类显式地将"layeredTexture1.inputs1.alpha“声明为属性,或者通过pymel提供的名为PyNode()的非常方便的命令来传递它,该命令可以做您想要的事情。关于PyNodes,This应该提供您需要了解的所有内容。所有这一切的一些示例如下:
PyNode("checker1").outAlpha >> PyNode("layeredTexture1.inputs[1].alpha") # The whole attr needs to be in the string because of the above explenation.
Attribute("checker1.outAlpha") >> Attribute("layeredTexture1.inputs[1].alpha")最好使用PyNode,但也可以同时使用这两种方法。
https://stackoverflow.com/questions/17460897
复制相似问题