3D Max Python 在 pymxs 上选择多项

3D Max Python selection multiple items on pymxs

如何 select 来自 pymxs 列表的面孔?

例如这段代码有错误:运行时错误:操作需要节点集合,得到:

from pymxs import runtime as rt

t = []
for face in rt.getCurrentSelection()[0].Faces:
    t.append(face)
rt.select(t)

以及如何在没有“执行”和 maxplus 命令的情况下转换此代码?

from pymxs import runtime as rt

rt.execute('subObjectLevel = 4')

是否可以在不重新组合的情况下获取列表?

from pymxs import runtime as rt

object = rt.getCurrentSelection()[0]

for face in object.Faces:
    edges = rt.polyop.getEdgesUsingFace(object, face.index)
    for e in [x for x, edge in enumerate(edges, start=1) if edge]:
        print(e)

与在 maxscript 中使用的方法相同,即使用特定类型的方法,polyop 用于可编辑多边形,meshop 用于网格:

from pymxs import runtime as rt

obj = rt.getCurrentSelection()[0]
rt.polyop.setFaceSelection(obj, rt.name('all'))
rt.subObjectLevel = 4