PDA

View Full Version : non Quad Locator


GlenGramling
07-28-2005, 01:07 PM
im looking for something that will either select or point out all the non quads in a mesh, similar to what the normal checker does in Bonus tools, perhaps someone can point me in the right direction, i have done some breif scanning and cant seem to find anything, but this would make my life as a modeler much easier. :shrug:

BigErn
07-28-2005, 01:10 PM
There is a script called "Quadchecker".. I dont know who wrote it at this time, but its the same guy who wrote "Half" for cutting meshes in half. It colours all your mesh depending on 3,4,Ngons.. its pretty useful really.... I`ll go look to see who it was now.....

and here it is! :D

benbathen.com/MELscripts/Scripts/quadChecker.mel

or check the guys site, some useful stuff there.

GlenGramling
07-28-2005, 01:21 PM
thanks!.. exactly what i needed

goleafsgo
07-28-2005, 04:00 PM
The guys name is Ben Bathen. It is a handy script but it can be made a lot faster if you don't iterate over all faces individually, and you don't need to use polyInfo to get what you are looking for.
Here is a modified version of his script...try running both and see the speed difference.


// Original script by Ben Bathen
// http://benbathen.com/
global proc quadChecker()
{
string $polyObjs[] = `ls -sl`;

if (`objExists triangleShader` == 0)
{
$triangleShader = `shadingNode -asShader lambert -n triangleShader`;
sets -renderable true -noSurfaceShader true -empty -name triangleShaderSG;
connectAttr -f triangleShader.outColor triangleShaderSG.surfaceShader;
setAttr "triangleShader.color" -type double3 .206 .323 .802 ;
}

if (`objExists QuadShader` == 0)
{
$QuadShader = `shadingNode -asShader lambert -n QuadShader`;
sets -renderable true -noSurfaceShader true -empty -name QuadShaderSG;
connectAttr -f QuadShader.outColor QuadShaderSG.surfaceShader;
setAttr "QuadShader.color" -type double3 0 .837 .273 ;
}

if (`objExists NsidedShader` == 0)
{
$NsidedShader = `shadingNode -asShader lambert -n NsidedShader`;
sets -renderable true -noSurfaceShader true -empty -name NsidedShaderSG;
connectAttr -f NsidedShader.outColor NsidedShaderSG.surfaceShader;
setAttr "NsidedShader.color" -type double3 .84 0 0 ;
}

ConvertSelectionToFaces;
polySelectConstraint -m 2 -sz 1;
polySelectConstraint -m 0;
string $tris[] = `ls -sl`;

select $polyObjs;

ConvertSelectionToFaces;
polySelectConstraint -m 2 -sz 2;
polySelectConstraint -m 0;
string $quads[] = `ls -sl`;

select $polyObjs;

ConvertSelectionToFaces;
polySelectConstraint -m 2 -sz 3;
polySelectConstraint -m 0;
string $ngons[] = `ls -sl`;

select $polyObjs;

if (size($tris) > 0)
sets -e -forceElement triangleShaderSG $tris;
if (size($quads) > 0)
sets -e -forceElement QuadShaderSG $quads;
if (size($ngons) > 0)
sets -e -forceElement NsidedShaderSG $ngons;

print "BOOYAH!! quadChecker, in Yo Face Sucka!!!";

}

BigErn
07-28-2005, 06:34 PM
thanks goleafsgo, I havent used it in a while but if there is a faster way to do it then thats cool. :D

GlenGramling
07-28-2005, 07:35 PM
your version is just giving me a completely red mesh, the other works fine on a lower rez mesh, but it freezes up when i try to use it on one of my hi res (20000+ faces)

i get this error

;quadChecker;

// Error: flag "-size" available in Face mode //

// Error: flag "-size" available in Face mode //

// Error: flag "-size" available in Face mode //

perhaps you can give me a version that doesnt color the quads and colors the tri's and Ngons the same color

john_homer
07-28-2005, 08:21 PM
select 1 poly object and run this...
it will select all faces that are non quad.

string $sel[] = `ls -sl`;
if ((size($sel) == 1))
{
int $numFace[] = `polyEvaluate -face`;
polyCleanupArgList 3 { "0","2","1","1","0","0","0","0","1","1e-005","1","1e-005","0","1e-005","0","1","0" };
for ($i=0; $i<$numFace[0]; $i++)
{
select -tgl ($sel[0] + ".f[" + $i + "]");
}
}
else error ("select 1 poly object");

GlenGramling
07-28-2005, 11:30 PM
that works great john, this way i can just color them how i want


here is the guy im working on btw

GlenGramling
07-29-2005, 08:47 PM
so far so good, but it seems unless i have my history deleted, maya completely locks up when i use this

Iconoklast
07-29-2005, 11:11 PM
because John's script is iterating through every face on your mesh.
The best way to go about this is using polySelectConstraint command..

thematt
07-29-2005, 11:32 PM
The best way to go about this is using polySelectConstraint command..

beat me to it..;)

use that command and select all the face of you object..

polySelectConstraint -m 2 -sz 3;


to go back to normal


polySelectConstraint -m 0 -sz 0;


take a look at those command you can do quite a lot with it..

cheers

SpaXe
07-30-2005, 07:40 AM
beat me to it..;)

use that command and select all the face of you object..

polySelectConstraint -m 2 -sz 3;


to go back to normal


polySelectConstraint -m 0 -sz 0;


take a look at those command you can do quite a lot with it..

cheers


try polySelectConstraint -m 3 -sz 1;
that will give the constraint of tris select.
then simply drag select your model.

cheers^^.

ephemeros
07-31-2005, 11:33 PM
try this guys, i needed this long time ago (not realy long :) )...it could take a little too long (i was in a hurry and used polyInfo and tokenize :( ), but can be useful.

CGTalk Moderation
07-31-2005, 11:33 PM
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.