简体   繁体   English

Maya API从现有网格中添加/删除顶点/边

[英]Maya API add/remove vertices/edges from existing mesh

Is there a way to add/remove vertices, edges and faces from existing meshes with Python API? 有没有一种方法可以使用Python API从现有的网格中添加/删除顶点,边和面? I found a few question around the web about this, but all without answer. 我在网上发现了一些与此有关的问题,但都没有答案。

In OpenMaya.MFnMesh there are some methods for this: OpenMaya.MFnMesh中 ,可以使用一些方法:

  • To delete: 删除:
    • deleteEdge(edgeId, modifier=None) -> self deleteEdge(edgeId,修饰符=无)->自
    • deleteFace(faceId, modifier=None) -> self deleteFace(faceId,修饰符=无)->自我
    • deleteVertex(vertexId, modifier=None) -> self deleteVertex(vertexId,修饰符=无)->自我
  • To add: 加上:
    • addPolygon(vertices, mergeVertices=True, pointTolerance=kPointTolerance, loopCounts=None) -> faceId; addPolygon(vertices,mergeVertices = True,pointTolerance = kPointTolerance,loopCounts = None)-> faceId; Which merges vertices within a certain range (pointTolerance). 合并一定范围内的顶点(pointTolerance)。

So it seems like you cannot just create single vertices and then properly connect them with edges and faces, but you have to define a complete polygon. 因此,似乎不能只创建单个顶点,然后将它们与边和面正确连接,但是您必须定义一个完整的多边形。

If there are other solutions I would be happy to know! 如果有其他解决方案,我将很高兴知道!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM