1
$\begingroup$

I often import CAD files/assemblies from other cad software. It is not obvious which objects were imported with an absurd number of verts. I would like to find those high poly objects and either reconstruct them with better topo or link their duplicates. Ultimately the question is: is there a way to sort all the objects in a scene by vert count or poly count, highest to lowest?

$\endgroup$

3 Answers 3

1
$\begingroup$

I had the same problem. I wanted to identify the objects with the highest poly counts in my scene. I asked ChatGPT to write a script that iterates through all meshes and then sorts them by face count. This seems to work great! Figured I'd share since it helped me!

Just paste this in the in-built text-editor in a new python file and run it. It will output the results in the console which can be found under Window->Toggle System Console.

    import bpy

# Get all mesh objects
mesh_objects = [obj for obj in bpy.context.scene.objects if obj.type == 'MESH']

# Create a list to store tuples of (object name, face count)
face_counts = []

# Iterate through each mesh object and get the face count
for obj in mesh_objects:
    face_count = len(obj.data.polygons)
    face_counts.append((obj.name, face_count))

# Sort the list by face count in descending order
face_counts.sort(key=lambda x: x[1], reverse=True)

# Print the mesh objects with the highest face counts
print("Meshes with the highest face counts:")
for name, count in face_counts:
    print(f"{name}: {count} faces")

# Optionally, you can specify how many top meshes you want to list
top_n = 10  # Change this number to list more or fewer top meshes
print(f"\nTop {top_n} meshes with the highest face counts:")
for name, count in face_counts[:top_n]:
    print(f"{name}: {count} faces")
$\endgroup$
1
$\begingroup$

I made an addon that helps finding heavy objects. You can make a selection, set up the amount of vertices it can have (10k, 100k etc) and it will leave selected only those that are above it. You can also run it on the whole scene.

It reads subdivisions, curves, Geometry Nodes... pretty useful :)

https://gabrielmoro.gumroad.com/l/selectbyminimumverticescount?layout=profile https://blendermarket.com/creators/gabrielmoro

$\endgroup$
0
$\begingroup$

I'm not aware of a way to filter them inside Blender but have you tried turning on Wireframe?

enter image description here

It should be pretty clear which objects are denser than they need to be from the viewport if you have that turned on.

As for sorting them, you could do that in the file explorer itself. It's usually easy to tell from the filesize

$\endgroup$
2
  • $\begingroup$ That's a great tip. It's just that my assemblies are as long as a football field and filled with motors, screws with threads, etc. I may just have to make an addon myself that colors them from high to low poly by color. thanks for your help $\endgroup$ Commented Jun 22 at 21:45
  • $\begingroup$ @JamesRiley Yea, I can't really help with that. If you know how to do it, maybe a script that would rename the objects using the number of their vertices as a prefix? That would auto sort them on the Outliner without changing the display colors at least $\endgroup$
    – Cornivius
    Commented Jun 22 at 22:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .