Skip to content

Commit 040549a

Browse files
committed
fix merge issues
- added some code that used the previous conversion methods. Updated to work with DeepConvert
1 parent e6ab2c8 commit 040549a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -972,16 +972,16 @@ SkinnedMeshRenderer unitySkin
972972
// Get prerotation
973973
var fbxPreRotationEuler = fbxBone.GetPreRotation(FbxNode.EPivotSet.eSourcePivot);
974974
// Convert the prerotation to a Quaternion
975-
var fbxPreRotationQuaternion = EulerToQuaternion(fbxPreRotationEuler);
975+
var fbxPreRotationQuaternion = EulerToQuaternionXYZ(fbxPreRotationEuler);
976976
// Inverse of the prerotation
977977
fbxPreRotationQuaternion.Inverse();
978978

979979
// Multiply LclRotation by pre-rotation inverse to get the LclRotation without pre-rotation applied
980-
var finalLclRotationQuat = fbxPreRotationQuaternion * EulerToQuaternion(new FbxVector4(fbxBone.LclRotation.Get()));
980+
var finalLclRotationQuat = fbxPreRotationQuaternion * EulerToQuaternionZXY(bone.localEulerAngles);
981981

982-
// Convert to Euler without axis conversion (Pre-rotation and LclRotation were already in Maya axis)
983-
// and update LclRotation
984-
fbxBone.LclRotation.Set(ToFbxDouble3(QuaternionToEuler(finalLclRotationQuat)));
982+
// Convert to Euler with Unity axis system and update LclRotation
983+
var finalUnityQuat = new Quaternion((float)finalLclRotationQuat.X, (float)finalLclRotationQuat.Y, (float)finalLclRotationQuat.Z, (float)finalLclRotationQuat.W);
984+
fbxBone.LclRotation.Set(ToFbxDouble3(finalUnityQuat.eulerAngles));
985985
}
986986
else
987987
{

0 commit comments

Comments
 (0)