Delete all objects with children

A coworker who is transitioning from Maya asked for this- delete a parent and the children are deleted as well. This script creates a delete_with_children operator and overrides the default delete.

As always, I can verify this script works on 3.6.13 LTS. I don’t know if it works on newer versions and I have no plans to test that or do anything with the whole extensions fiasco. Use as is if you want, make changes if you need, I don’t plan on making any further changes myself :slight_smile:

3 Likes

In the outliner select the parent - right click and “delete Hierarchy”

That will get rid-of the whole family (parent and kids).

2 Likes

Yeah, I know, my coworker wanted an override for default delete behavior

1 Like

I don’t recall which version of blender added object.children_recursive() but have you verified intended operation on “grandchildren”, “great grandchildren”, etc.

1 Like

Nope, my coworker is happy with it and that’s good enough for me

2 Likes

What do you mean by “the whole extensions fiasco” ?

This thread isn’t the place to have a full-blown discussion, so suffice it to say I find the extensions system poorly designed and poorly implemented, and I’m not interested in contributing to it at this point. I’d be happy to share more thoughts in an appropriate thread :slight_smile:

1 Like