I have an armature that has 616 bones. I’ve just deleted say 200 that were on a 2nd layer. Now I want to walk through the armatures data groups and determine if a bone is alive or has been deleted prior to closing and restarting the Blend file.
I thought I might have been using the wrong data group thought I should have been using edit_bones, but find that only works if the armature is in edit mode. If the armature is in Object mode, 0 bones are returned when the script is run.
I’m using a code like
myFile.write('\n' + "ARMATURE" + '\n') for arm in bpy.data.objects: if arm.type == 'ARMATURE' and arm.users == 1: print(arm.name) g = str(arm.name) myFile.write(g + '\n') for bone in arm.data.bones: print(bone.name) b=str(bone.name) myFile.write(b + '\n')
But the result is giving all bones be they alive or deleted. I don’t see a users flag or a is_deleted flag anywhere in the data blocks. I can’t rely on if a bone is parented as some are and some (like the root bone) aren’t.
Any suggestions? Is there a deleted flag that I’ve missed somewhere when a bone is deleted prior to the blend file being saved and reopened?