Fix convert-mesh script

This commit is contained in:
Nikita Lisitsa 2021-07-15 18:57:11 +03:00
parent 2b46b38da2
commit 463cb5372b

View file

@ -190,13 +190,14 @@ if armature is not None:
bones.append((p, tuple(b.head_local), tuple(map(tuple, b.matrix_local.to_3x3()))))
poses = []
if armature is not None:
for index, pose in enumerate(bpy.data.objects['armature'].pose_library.pose_markers):
print("Found pose", pose.name)
# [rotation, scale, translation]
data = []
for i in range(len(bone_names)):
data.append([[None, None, None, None], [None, None, None], [None, None, None]])
data.append([[1.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0], [0.0, 0.0, 0.0]])
marker = armature.pose_library.pose_markers[index]
frame = marker.frame
@ -245,6 +246,8 @@ def to_bytes(obj):
if type(obj) == str:
b = obj.encode('utf-8')
return struct.pack('<I', len(b)) + b
print("Type", type(obj), "not supported")
sys.exit(1)
SECTION_MESH = 1
SECTION_BONES = 2