Count faces by material?
-
Hello everyone.
Just wanted to ask if there's already a routine out there to count the faces in a model by material or material name. I can write it myself but I thought I'd ask if there's already a plugin that can do it since I just need it to debug a model.
Thanks!
EDIT: Let me clarify that it should get all entities, including those inside components (i.e. should look at every face in the entire model), and should also search upward for parent materials for faces that are nested in groups (i.e. if a face has the default material but its parent has the material in question, it should be counted). So it's a little tricky but still seems like something someone out there must have done before.
-
This post has code:
- New Material Methods! (With bugs )Do not forget to check the
back_material
- New Material Methods! (With bugs )Do not forget to check the
-
Thanks Dan.
I'd be willing to bet that
save_delete_material
method doesn't actually search all the faces, only those in the top-level definitions. I had thomthom help me a long time ago to write a recursive function to iterate ALL the faces, so I think I'll piece this together from that...
Advertisement