1

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)

  • Can you share that file, preferably stripped done to a bare minimum of objects necessary to cause this problem? https://blend-exchange.giantcowfilms.com/ – Robert Gützkow Dec 13 '19 at 17:59
  • Over 2500 meshes are a challenge even for powerful CPUs/GPUs. Does the scene have to have that many objects? – Lukasz-40sth Dec 13 '19 at 18:23
  • I have overwritten the original file (because it was crashing). I will try to regenerate it.
  • The whole point here was to eventually merge everything down to just a few meshes, but the objects don't overlap. I want to also run a script to enlarge each object by 1% so that they do overlap, and then boolean them all together. But, I need the origin at the center of mass before I enlarge them.
  • Yes, it takes a couple of hours for the script to run :( "a bit more on an x86"
  • – Stony Smith Dec 18 '19 at 13:19