Skip to content

Commit

Permalink
Merge pull request Fast-64#298 from Lilaa3/fix-animation-trans
Browse files Browse the repository at this point in the history
[SM64] - Fix animation translation
  • Loading branch information
jesusyoshi54 authored Jan 19, 2024
2 parents 37aacff + dc80817 commit cf9f536
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fast64_internal/sm64/sm64_anim.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,10 @@ def convertAnimationData(anim, armatureObj, *, frame_start, frame_count):
currentFrame = bpy.context.scene.frame_current
for frame in range(frame_start, frame_start + frame_count):
bpy.context.scene.frame_set(frame)
rootBone = armatureObj.data.bones[animBones[0]]
rootPoseBone = armatureObj.pose.bones[animBones[0]]

# Hacky solution to handle Z-up to Y-up conversion
translation = (
rootBone.matrix.to_4x4().inverted()
@ mathutils.Matrix.Scale(bpy.context.scene.blenderToSM64Scale, 4)
@ rootPoseBone.matrix
mathutils.Matrix.Scale(bpy.context.scene.blenderToSM64Scale, 4) @ rootPoseBone.matrix_basis
).decompose()[0]
saveTranslationFrame(translationData, translation)

Expand Down

0 comments on commit cf9f536

Please sign in to comment.