我正在尝试在Maya中创建MASH,并使用Python API设置输入网格。这在GUI中非常简单,但我花了几个小时,不知道如何在API中工作。以下是我目前的代码:
from maya import cmds
import MASH.api as mapi
#create backplate
backplate = cmds.polyPlane(w=10,h=10)
#create cube
cube = cmds.polyCube(w=10,h=10)
#create mash
cmds.select(cube[0])
mashNetwork = mapi.Network()
mashNetwork.createNetwork()
#set mash to mesh distribution type
cmds.setAttr(mashNetwork.distribute + '.arrangement', 4)
这之后我该怎么办?我希望背板成为MASH的输入网格。我知道我需要设置的参数可以通过以下方式访问:mashNetwork.distribute+'.inputMesh'
但不管我怎么做,我都会出错。我试过setAttr,connectAttr,但都没有成功。有人知道怎么做吗
您需要将shape节点的
outMesh
连接到MASH_Distribute
的inputMesh
属性。您可以在“节点编辑器”(Node Editor)中检查手动创建的连接,以了解它在没有先编写脚本的情况下是如何工作的相关问题 更多 >
编程相关推荐