Edit-mesh separate by loose parts stuck indefinitely #70864

Closed
opened 2019-10-16 04:55:17 +02:00 by Daniel Salazar · 10 comments
Member

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: 519891c669

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
Separate.blend
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))"

**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: `519891c669` **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** [Separate.blend](https://archive.blender.org/developer/F7824377/Separate.blend) 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))" ```
Author
Member

Added subscriber: @zanqdo

Added subscriber: @zanqdo
Campbell Barton changed title from Separate by loose parts to Unreasonably high memory usage with edit-mesh separate by loose parts 2019-10-16 04:58:36 +02:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

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).

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 changed title from Unreasonably high memory usage with edit-mesh separate by loose parts to Edit-mesh separate by loose parts stuck indefinately 2019-10-16 08:14:19 +02:00
Daniel Salazar changed title from Edit-mesh separate by loose parts stuck indefinately to Edit-mesh separate by loose parts stuck indefinitely 2019-10-16 08:14:51 +02:00
Author
Member

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.

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.

@zanqdo what do you think about the solution/workaround proposed above?

@zanqdo what do you think about the solution/workaround proposed above?
Author
Member

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

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

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.

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).

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

This issue was referenced by 71538eaad6

This issue was referenced by 71538eaad66b0d2a532df4b1f82e983fb6aed088

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Campbell Barton self-assigned this 2019-10-20 17:58:08 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#70864
No description provided.