Delete hierarchy on a collection in outliner does not really delete objects [they stay in other collections, e.g. rigid body world] #73545

Closed
opened 2020-02-02 14:26:25 +01:00 by Romuald Brunet · 13 comments

System Information
Operating system: macOS 10.13.6
Graphics card: Intel Iris 1536 MB

Blender Version
Broken: 2.81a (2.81a 2019-12-04)
Broken: 2.83 (2.83 2020-02-02)

Short description of issue
When deleting a collection in the outliner via the Delete hierarchy right click menu option, objects that are have a rigid body settings will "stay" in the rigid body world

There seems to be no easy way to clear them afterwards (I've tried to use the purge option in the Orphan data but it doesn't do anything)

Exact steps for others to reproduce the error

From the .blend example file

  • in the outliner, right click on the foo collection

  • select "Delete hierarchy"

  • play the animation

  • the second ball will collide with the first one that was apparently deleted

physics-bug.py.blend

**System Information** Operating system: macOS 10.13.6 Graphics card: Intel Iris 1536 MB **Blender Version** Broken: 2.81a (2.81a 2019-12-04) Broken: 2.83 (2.83 2020-02-02) **Short description of issue** When deleting a collection in the outliner via the *Delete hierarchy* right click menu option, objects that are have a rigid body settings will "stay" in the rigid body world There seems to be no easy way to clear them afterwards (I've tried to use the purge option in the Orphan data but it doesn't do anything) **Exact steps for others to reproduce the error** From the .blend example file - in the outliner, right click on the *foo* collection - select "Delete hierarchy" - play the animation - the second ball will collide with the first one that was apparently deleted [physics-bug.py.blend](https://archive.blender.org/developer/F8317355/physics-bug.py.blend)
Author

Added subscriber: @Sushi

Added subscriber: @Sushi
Author

I've made a script to remove the unused objects (may not be correct, but it worked in my case)

import bpy

rigid_check = (bpy.data.collections['RigidBodyWorld'], )
for obj in bpy.data.objects:
    # Rigid body world is the only collection linked to that object

if obj.users_collection == rigid_check:
bpy.data.objects.remove(obj)

I've made a script to remove the unused objects (may not be correct, but it worked in my case) ```lang=python import bpy rigid_check = (bpy.data.collections['RigidBodyWorld'], ) for obj in bpy.data.objects: # Rigid body world is the only collection linked to that object ``` if obj.users_collection == rigid_check: bpy.data.objects.remove(obj) ```

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Can confirm even after making sure cache is cleared.

Can confirm even after making sure cache is cleared.
Member

Added subscribers: @mont29, @lichtwerk

Added subscribers: @mont29, @lichtwerk
Member

Not sure if this is really supposed to delete the objects entirely?

If I look at the documentation https://docs.blender.org/manual/en/dev/editors/outliner.html#collections, it suggests it would, true...:

Delete Hierarchy
Deletes the collection and all of its child objects.

But code wise, this only does BKE_collection_delete / collection_object_remove, so it wont really delete the object if it is in another collection as well.
(this not only happens with the rigidbody world collection, it is true for any other collection as well -- so if Sphere from the file would also be in another collection in the viewlayer, it would still be visible and not deleted after Delete Hierarchy on the foo collection)

If we wanted to really kill the objects, something like object_batch_delete_hierarchy_cb / object_delete_hierarchy_cb would need to be used...

CC @mont29

Not sure if this is really supposed to delete the objects entirely? If I look at the documentation https://docs.blender.org/manual/en/dev/editors/outliner.html#collections, it suggests it would, true...: > Delete Hierarchy > Deletes the collection and all of its child objects. But code wise, this only does `BKE_collection_delete` / `collection_object_remove`, so it wont really delete the object if it is in another collection as well. (this not only happens with the rigidbody world collection, it is true for any other collection as well -- so if Sphere from the file would also be in another collection in the viewlayer, it would still be visible and not deleted after Delete Hierarchy on the foo collection) If we wanted to really kill the objects, something like `object_batch_delete_hierarchy_cb` / `object_delete_hierarchy_cb` would need to be used... CC @mont29
Member

Added subscriber: @natecraddock

Added subscriber: @natecraddock
Philipp Oeser changed title from Delete hierarchy in outliner does not affect rigid body to Delete hierarchy on a collection in outliner does not really delete objects [they stay in other collections, e.g. rigid body world] 2020-02-03 11:16:47 +01:00

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Bastien Montagne self-assigned this 2020-02-03 11:23:41 +01:00

Code is behaving as it should. Whether doc should be updated, or expected behavior should be modified, may be open for discussion (modifying that behaviour would be for #user_interface team to decide anyway, since that is UX topic). But there is no bug here. Thanks for the report anyway.

Code is behaving as it should. Whether doc should be updated, or expected behavior should be modified, may be open for discussion (modifying that behaviour would be for #user_interface team to decide anyway, since that is UX topic). But there is no bug here. Thanks for the report anyway.
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

The manual has been fixed in rBM6159

The manual has been fixed in rBM6159
Member

In #73545#864446, @Blendify wrote:
The manual has been fixed in rBM6159

thx @Blendify

> In #73545#864446, @Blendify wrote: > The manual has been fixed in rBM6159 thx @Blendify
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 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-manual#73545
No description provided.