0

I'm pretty new on Blender and I have a problem.

I imported a quite huge model hierarchy and some node contains no mesh.
Is there a way to automaticaly delete all node that does not have mesh ?

model outline

Thanks.

  • While this may not work for you, you could try selecting all objects, joining them together with CMD+J, then going into edit mode and pressing p and separating them by disconnected. – Nascent Space Feb 24 '21 at 11:44
  • Going by the names these "nodes" that contain no mesh are Empties. (which have no data) They are quite likely holding parenting info. However to remove Select > Select All by Type > Empty will select then X to remove the selection. Ctrl-Z to undo if it goes awry. – batFINGER Feb 24 '21 at 11:57
  • @batFINGER , Selecting "Empty" by type select all Empty node even if they contains a mesh. So Deleting them (X) delete everything. – Psykokwak Feb 24 '21 at 13:44
  • Can try https://blender.stackexchange.com/a/200365/88681 – scurest Feb 24 '21 at 14:43

1 Answers1

-1

OK. I just learn Python and developped this script :

import bpy

This script selects all objects hierarchy that have mesh on them

After executing this script, just invert the selection (ctrl+I) and delete (X)

for o in bpy.data.objects: if o.type == "MESH": obj = o while True: obj.select_set(True) obj = obj.parent if obj == None: break;