import maya.cmds as cmds
def oddFacesCheck():
objFaces = cmds.polyListComponentConversion(tf=True)
cmds.select(objFaces)
tmpFaces = cmds.ls(fl=True, sl=True)
cmds.select(cl=True)
for preFace in tmpFaces:
faceEdges = cmds.polyListComponentConversion(preFace, ff=True, te=True)
sepFaceEdges = cmds.ls(faceEdges, fl=True)
if(len(sepFaceEdges) %2==1):
cmds.select(preFace, add=True)
oddFacesCheck()
def oddFacesCheck():
objFaces = cmds.polyListComponentConversion(tf=True)
cmds.select(objFaces)
tmpFaces = cmds.ls(fl=True, sl=True)
cmds.select(cl=True)
for preFace in tmpFaces:
faceEdges = cmds.polyListComponentConversion(preFace, ff=True, te=True)
sepFaceEdges = cmds.ls(faceEdges, fl=True)
if(len(sepFaceEdges) %2==1):
cmds.select(preFace, add=True)
oddFacesCheck()