Page MenuHome

Edit-mesh separate by loose parts stuck indefinitely
Closed, ResolvedPublicTO DO

Description

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce GTX 1080 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.48

Blender Version
Broken: version: 2.82 (sub 0), branch: master, commit date: 2019-10-14 16:48, hash: rB519891c6695f

Short description of error
The separate by loose parts tool hangs on large meshes.

Yes it's a fairly large mesh, but tools like select linked or even separate by selection do not have much problem with it. However separate by loose parts takes (forever?) I had to close Blender after 3 hours.

Exact steps for others to reproduce the error


Enter edit mode
Press P
Separate by Loose Parts


Automated test:

blender Separate.blend -b --python-expr "import bpy, time; bpy.ops.object.editmode_toggle(); t = time.time(); print('Objects:', len(bpy.data.objects)); bpy.ops.mesh.separate(type='LOOSE'); print('Seconds:', time.time() - t, 'Objects:', len(bpy.data.objects))"

Related Objects

Event Timeline

Campbell Barton (campbellbarton) renamed this task from Separate by loose parts to Unreasonably high memory usage with edit-mesh separate by loose parts.Oct 16 2019, 4:58 AM
Campbell Barton (campbellbarton) lowered the priority of this task from 90 to Low.
Campbell Barton (campbellbarton) edited a custom field.

Note that this was discussed in blender.chat, this report has some differences to the issue discussed in chat (not sure if the issue is memory usage or just being slow).

This file has 110,512 isolated vertices, each is creating a new object.
Copying the geometry is inefficient too, although it's not the root-cause of the problem.

Firstly to avoid this issue you could delete all isolated vertices.

As for how Blender could handle this better, we could do a pass for isolated verts/edges/faces and split them into a single object.

There might be some cases existing behavior is preferred, so that could be an option (off by default).

Daniel Salazar (zanqdo) renamed this task from Unreasonably high memory usage with edit-mesh separate by loose parts to Edit-mesh separate by loose parts stuck indefinately.Oct 16 2019, 8:14 AM
Daniel Salazar (zanqdo) renamed this task from Edit-mesh separate by loose parts stuck indefinately to Edit-mesh separate by loose parts stuck indefinitely.
Daniel Salazar (zanqdo) updated the task description. (Show Details)

You are right, it's the solo verts that are causing it to hang forever. After I removed them with a non manifold select operation it managed to separate quite quickly.

The problem with this is that lots of CAD files come with similar geometry so the operator just hangs for no apparent reason.

@Daniel Salazar (zanqdo) what do you think about the solution/workaround proposed above?

Having all isolated vertices into a single object by default sounds perfectly reasonable. Considering the trouble of creating thousands of single vert objects.

As mentioned on the chat. This would solve this test file but not a real use case where the mesh comes with thousands of valid parts (CAD Files). The split algorithm seems to be escalating really poorly until the point that you have to force quit Blender.

Something closer to the real test case would be useful to have (just randomize locations, it will work the same for our purposes).