PolyCleanup suppress warning

124 views
Skip to first unread message

Aren Voorhees

unread,
Oct 22, 2015, 10:32:09 AM10/22/15
to Python Programming for Autodesk Maya
Hey all, I'm working on a tool that can check a mesh for problems before getting exported.  I would like to utilize the Mesh Cleanup tool (or something equivalent) to do part of this.  Currently I am doing it like this:  

#Check for non-manifold geometry
def checkNonManifold(object, chk):
    curSel
= cmds.ls(sl=True)
   
#checkNMG = cmds.polyInfo(nonManifoldVertices=True, laminaFaces=True, nonManifoldEdges=True) # <---My initial solution, but not ideal because it doesn't catch all the issues.
    checkNMG
= mel.eval('polyCleanupArgList 3 { "0","2","1","0","1","1","1","0","0","1e-005","1","1e-005","1","1e-005","0","1","1" };') # <----Here is the problem
   
if chk == 7:
       
if len(checkNMG) > 0: checkFail(object, chk)
    cmds
.selectMode(object=True)
    cmds
.select(curSel)  

It is working fine, but what I don't like is that if there are no issues on the mesh it spits out a warning saying "No items found to cleanup etc."  Can anyone think of way to prevent or suppress that warning?  As you can see, I was initially using the cmds.polyInfo command which nice because it was not causing a warning like that, but I decided not to use it because it did not have flags for all the different issues I needed to check for.  I did some research on catchQuite, but I don't know how to do a mel.eval inside of another mel.eval (and it seems super messy!).

Thanks for any help you can provide!
Aren
Reply all
Reply to author
Forward
0 new messages