Skip to content

Commit

Permalink
Quick fix for exporting non-vertex animated nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Five-Damned-Dollarz committed Mar 4, 2021
1 parent 80fe9b8 commit d4353ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def import_model(model, options):
index = 0
processed_frame_count=1 # 1 for neutral_pose
for animation in model.animations:
print("Processing ", animation.name)
print("Processing", animation.name)

index = index + 1
# Create a new action with the animation name
Expand Down
12 changes: 8 additions & 4 deletions src/writer_abc_v6_pc.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,14 @@ def __init__(self, name, data):
index=keyframe_index*node.md_vert_count+md_vert_index
buffer.extend(struct.pack('BBB', int(anim.vertex_deformations[node][index].x*255), int(anim.vertex_deformations[node][index].y*255), int(anim.vertex_deformations[node][index].z*255)))

scale=anim.vertex_deformation_bounds[node][1]-anim.vertex_deformation_bounds[node][0]

buffer.extend(self._vector_to_bytes(scale/255))
buffer.extend(self._vector_to_bytes(anim.vertex_deformation_bounds[node][0]))
scale=Vector((1, 1, 1))
translation=Vector()
if node in anim.vertex_deformation_bounds:
scale=(anim.vertex_deformation_bounds[node][1]-anim.vertex_deformation_bounds[node][0])/255
translation=anim.vertex_deformation_bounds[node][0]

buffer.extend(self._vector_to_bytes(scale))
buffer.extend(self._vector_to_bytes(translation))

sections.append(Section('Animation', bytes(buffer)))

Expand Down

0 comments on commit d4353ec

Please sign in to comment.