Fix exporting mesh without parent

This commit is contained in:
Nikita Lisitsa 2022-06-23 22:38:41 +03:00
parent c6f971a36f
commit 9f0c5a78c3

View file

@ -27,7 +27,7 @@ if len(mesh.uv_layers) > 0:
armature = None armature = None
bone_names = None bone_names = None
if type(obj.parent.data) is bpy.types.Armature: if obj.parent is not None and type(obj.parent.data) is bpy.types.Armature:
armature = obj.parent armature = obj.parent
print('Found armature with {} bones'.format(len(armature.data.bones))) print('Found armature with {} bones'.format(len(armature.data.bones)))
bone_names = [b.name for b in armature.data.bones] bone_names = [b.name for b in armature.data.bones]