View Full Version : Detect ngons

11 November 2010, 05:03 AM
Is there a script that will quickly detect all 5+ sided polies on that mesh?
I think there is such a function in maya but it's rather hard to use, I'd love something that only requires one click.

11 November 2010, 11:45 AM
when you say "detect" what do you mean exactly?

do you want 5+ sided polys to be selected? do you want their names returned in an array? or do you want them simply to be highlighted in the viewport?

Mesh > Poly Cleanup... does this perfectly well. if you run it with:

Select Matching Polygons and:
Apply to Selected Objects and:
Faces with more than 4 sides

turned ON and everything else turned off you get this behaviour. If you want it in a one button click you simply look at what is out put in the Script Editor when you Apply this function and then paste or drag that MEL code onto a shelf button:
polyCleanupArgList 3 { "0","2","1","0","1","0","0","0","0","0","0","0","0","0","0","-1","0" };

11 November 2010, 01:39 AM

polySelectConstraint -mode 3 -type 0x0008 -size 3;
polySelectConstraint -disable;

this two-line-script will select 5+ sided polygons for you. Select the mesh before executing it.

CGTalk Moderation
11 November 2010, 01:40 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.