I have a scene that contains some 2500+ individual meshes. They were imported from a STL and separated via Separate(P)/Loose(L) and the center of each mesh is on the origin. I ran the script below to move the origin of each mesh to the center of mass for each individual mesh.
Now, any time I click edit on a single object in that file, my computer locks up entirely, and even after waiting 60+ minutes, it never comes back. No mouse movement, no response to ctrl-alt-del, nothing.
I was able to save the file to a .blend, but even opening that file, and then clicking edit on any object, the computer again hard locks.
######################
import bpy
import os
def recenter(a):
a.select_set(True)
bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_VOLUME',center='MEDIAN')
a.select_set(False)
objs=bpy.data.objects[0]
for x in objs:
print(x.name)
recenter(x)