Skip to content

Commit 5a1b98c

Browse files
committed
use function to convert to Euler instead of creating FbxAMatrix
1 parent e2876a2 commit 5a1b98c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

com.unity.formats.fbx/Editor/FbxExporter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -957,11 +957,11 @@ SkinnedMeshRenderer unitySkin
957957
fbxPreRotationQuaternion.Inverse();
958958

959959
// Multiply LclRotation by pre-rotation inverse to get the LclRotation without pre-rotation applied
960-
var fbxFinalQuat = fbxPreRotationQuaternion * EulerToQuaternion(new FbxVector4(fbxBone.LclRotation.Get()));
960+
var finalLclRotationQuat = fbxPreRotationQuaternion * EulerToQuaternion(new FbxVector4(fbxBone.LclRotation.Get()));
961961

962-
var quatToEulerMatrix = new FbxAMatrix();
963-
quatToEulerMatrix.SetQ(fbxFinalQuat);
964-
fbxBone.LclRotation.Set(ToFbxDouble3(quatToEulerMatrix.GetR()));
962+
// Convert to Euler without axis conversion (Pre-rotation and LclRotation were already in Maya axis)
963+
// and update LclRotation
964+
fbxBone.LclRotation.Set(ToFbxDouble3(QuaternionToEuler(finalLclRotationQuat)));
965965
}
966966
}
967967

0 commit comments

Comments
 (0)