0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Check missing faces

Posted at
import maya.cmds as cmds

# get the currently selected object
sel = cmds.ls(selection=True)
if not sel:
    print('Error: no object selected')
else:
    # get the number of vertices, edges, and faces for the selected object
    num_verts = cmds.polyEvaluate(vertex=True)
    num_edges = cmds.polyEvaluate(edge=True)
    num_faces = cmds.polyEvaluate(face=True)

    # calculate the expected number of faces based on the number of vertices and edges
    expected_faces = num_edges - num_verts + 2

    # check if the actual number of faces matches the expected number
    if num_faces != expected_faces:
        print('Selected object has missing faces')
    else:
        print('Selected object is complete')
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?