Only editablemesh
and editablepoly
objects can be queried for number of faces.
Assuming obj
is your objects:
local numFaces = getNumFaces obj
or
local numFaces = obj.numFaces
If obj
is a different object which can be evaluated to an editableMesh
or editablePoly
, you can use the .mesh
property of the object:
local m = obj.mesh
local numFaces = m.numFaces
free m
edit:
There is actually:
getPolygonCount <obj>
which works on all objects regardless of their class.