Maya polyInfo -ve return 错误的值

Maya polyInfo -ve return the wrong values

我正在慢慢学习 python 和 Maya,所以我可能做错了什么。

因此,出于某种原因,当我使用 polyInfo 时,它 returns 提供了错误的信息。 例子,在基本平面上,我select一个顶点,执行下面命令

import maya.cmds as cmds

cmds.polyInfo(ve = True)

它returns

# Result: [u'VERTEX     48:     93     90     72     92 \n'] # 

那些顶点与我 select 编辑的顶点完全不相关。地狱,有时,它 returns 不存在的顶点,取决于 selected 一个。

我不知道是否相关,但我在 MEL 中的结果与

相同
polyInfo -ve

该文档对我没有用,我很难找到有类似问题的人。

这是怎么回事?

您想查询什么?你能举个你的脚本的例子吗?

maya 文档中的标志 -ve return:Returns 连接到顶点的边。需要对顶点进行 select 编辑。 http://download.autodesk.com/us/maya/2011help/CommandsPython/polyInfo.html

您是否正在向命令提供 selection :即:

edges = cmds.polyInfo("pPlane1.vtx[48]", ve=True)

所以它作为输出给出:'VERTEX 48:' selection 是顶点号 48(目前只有一个),' 93 90 72 92 ' 并连接到 4 条边,索引为:93、90、72、92

编辑:

这里是 select 边缘的示例代码:

edges = cmds.polyInfo(['pPlane1.vtx[54]', 'pPlane1.vtx[43]'], ve=True)
selOut = []
for i in edges:
    # split the indexes
    indexes = i.split(':')[-1].split(' \n')[0].split('    ')[1:]
    # write as : pPlane1.e[]
    selEdges = ['pPlane1.e[{}]'.format(j.replace(' ','')) for j in indexes]
    # merge the selection
    selOut+=selEdges
# remove duplicated edges :
newSel = list(set(selOut))
cmds.select(newSel)