Fix mesh exporting script: export armature if it is the selected object's parent
This commit is contained in:
parent
a439d33b0f
commit
9d997bd88b
1 changed files with 4 additions and 5 deletions
|
|
@ -27,11 +27,10 @@ if len(mesh.uv_layers) > 0:
|
||||||
texcoords = mesh.uv_layers.active.data
|
texcoords = mesh.uv_layers.active.data
|
||||||
print('Found texture coordinates')
|
print('Found texture coordinates')
|
||||||
|
|
||||||
# TODO: proper armature support
|
|
||||||
armature = None
|
armature = None
|
||||||
bone_names = None
|
bone_names = None
|
||||||
if 'armature' in bpy.data.objects:
|
if type(obj.parent.data) is bpy.types.Armature:
|
||||||
armature = bpy.data.objects['armature']
|
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]
|
||||||
|
|
||||||
|
|
@ -175,8 +174,8 @@ if armature is not None:
|
||||||
bones.append((p, tuple(b.head_local), tuple(map(tuple, b.matrix_local.to_3x3()))))
|
bones.append((p, tuple(b.head_local), tuple(map(tuple, b.matrix_local.to_3x3()))))
|
||||||
|
|
||||||
poses = []
|
poses = []
|
||||||
if armature is not None:
|
if armature is not None and armature.pose_library is not None:
|
||||||
for index, pose in enumerate(bpy.data.objects['armature'].pose_library.pose_markers):
|
for index, pose in enumerate(armature.pose_library.pose_markers):
|
||||||
print("Found pose", pose.name)
|
print("Found pose", pose.name)
|
||||||
|
|
||||||
# [rotation, scale, translation]
|
# [rotation, scale, translation]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue