select geometry with any kind of mesh

I exhausted all possibilities after one day I'm out of ideas how to solve it, here is my problem:

I have to count all polygones in selection so I have to get to every object with mesh and here is a problem.
I noticed 3dsmax geometrysuperclass is also particle systems, mr proxy and other objects which have no mesh.
I can't define it by class because there is so many classes to predict.
So I created filter to exclude particle systems at least but it seems no matter what I do PF_Source stay always in selection.

Is it way to select geometry objects only with mesh, any kind of mesh, poly, mesh, primitive?

This is my code but not work with pf_source and different not-mesh geometry object, I already checked it on massive scene.
Can somebody take a look on this.I would be thankful.

polygonesc=0
myArray = #()

----this is first firewall to exclude particle but not work for PF_Source
select(for o in selection where classOf o != VRayProxy and classOf o != Snow and classOf o != PF_Source and classOf o != PArray and classOf o != SuperSpray and classOf o != Spray and classOf o != Blizzard and classOf o != Blizzard and classOf o != PCloud collect o)

----this is second firewall to exclude particle but not work for PF_Source
for t in selection do
(
tr=classof t
if tr==PF_Source then deselect t
)

for o in selection where superclassof o == geometryClass do

(

addmodifier o (Edit_Poly ())
myPolyCount = polyop.getNumFaces o
append myArray o
polygonesc=polygonesc+myPolyCount
deleteModifier o 1
)

select myArray

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

Try with this:

for o in selection where ( (superclassof o == geometryClass) and (canConvertto Editable_Mesh ) ) do

You can search the cgtalk form. DenisT showed how to collect only the geometry objects.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.