当你所拥有的只是该地理的一个组件(uvs、面、顶点、边缘)时,你如何获得一块地理的名称?
所以例如我有:
MeshVertex(u'pCubeShape1.vtx[0]') #replace that with any of the following (uvs, faces, edges)
我想结束的是:
nt.Transform(u'pCube1')
我该怎么做?
说vtx = MeshVertex(u'pCubeShape1.vtx[0]')
然后可以使用以下方法找到转换/地理:
import pymel.core as pc
transforms = pc.listTransforms(vtx.node())
transform = transforms[0] #in case there is only one.
作为您的示例,假设v = MeshVertex(u'pCubeShape1.vtx[0]')
import pymel.core as pm
transform = v.node().getParent()
select(transform)
我知道这个问题已经得到了回答,但我想我会发布我的方式,以便其他人可以看到不同的方式:)
希望这有帮助