Fix convert-mesh script
This commit is contained in:
parent
2b46b38da2
commit
463cb5372b
1 changed files with 31 additions and 28 deletions
|
|
@ -190,13 +190,14 @@ 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 = []
|
||||||
for index, pose in enumerate(bpy.data.objects['armature'].pose_library.pose_markers):
|
if armature is not None:
|
||||||
|
for index, pose in enumerate(bpy.data.objects['armature'].pose_library.pose_markers):
|
||||||
print("Found pose", pose.name)
|
print("Found pose", pose.name)
|
||||||
|
|
||||||
# [rotation, scale, translation]
|
# [rotation, scale, translation]
|
||||||
data = []
|
data = []
|
||||||
for i in range(len(bone_names)):
|
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]
|
marker = armature.pose_library.pose_markers[index]
|
||||||
frame = marker.frame
|
frame = marker.frame
|
||||||
|
|
@ -245,6 +246,8 @@ def to_bytes(obj):
|
||||||
if type(obj) == str:
|
if type(obj) == str:
|
||||||
b = obj.encode('utf-8')
|
b = obj.encode('utf-8')
|
||||||
return struct.pack('<I', len(b)) + b
|
return struct.pack('<I', len(b)) + b
|
||||||
|
print("Type", type(obj), "not supported")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
SECTION_MESH = 1
|
SECTION_MESH = 1
|
||||||
SECTION_BONES = 2
|
SECTION_BONES = 2
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue