System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.30
Blender Version
Broken: version: 2.83 (sub 2), branch: master, commit date: 2020-02-09 16:59, hash: rB5314161491d4
Short description of error
This problem was originally discovered by Eduardo Ramírez.
Joining objects while iterating over a collection of objects, e.g. bpy.context.view_layer.objects or bpy.context.scene.objects, results in a crash.
It's possible that this isn't supposed to work, since the collection that is being iterated over is modified inside the loop, which is rarely a good thing. This issue is similar to T60491 which was closed because it couldn't be reproduced.
Exact steps for others to reproduce the error
- Open the attached blend file
- Run the script
import bpy
for obj in bpy.context.view_layer.objects:
bpy.ops.object.select_all(action='SELECT')
bpy.context.view_layer.objects.active = obj
bpy.ops.object.join()