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')
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme