[Closed] getting number of quads and tris
hi,
how can i get the number of quads and triangles of the object i have currently selected.
i tried using
mesh = snapshotAsMesh selection[1]
but that seems to always create a mesh consisting of triangles only.
thanks!
go to your ui/macroscripts directory and open up polygon_counter.mcr
mark
One might assume that since this question was asked in the maxscript forum, the author may have wanted a maxscript answer
Triangles is easy: $.mesh.numFaces. I’m not sure what you mean when you say “number of quads” though – do you mean the number of polygons, or the number of polygons that have exactly 4 sides? If you need the number of polygons, and you have an editable poly object, just use $.numFaces. If you need the number of exactly quad polys, that would involve some kind of looping, e.g. (for f in $.faces where (polyOp.getFaceDeg $ f.index) == 4 collect f).count. This also assumes you’re dealing with an editable poly object, of course. It gets a bit trickier if you need this info from an editable mesh; I’ll assume this is not the case.
<allonym>