Skip to content

Commit deefa21

Browse files
authored
Merge pull request #11 from Unity-Technologies/UNI-20809-add-set-rotation-order
UNI-20809 set rotation order to Unity order (ZXY)
2 parents 91da80c + 0df8743 commit deefa21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,12 @@ meshInfo.Vertices [v].z
392392
// get a fbxNode's global default position.
393393
protected void ExportTransform (UnityEngine.Transform unityTransform, FbxNode fbxNode)
394394
{
395+
// Fbx rotation order is XYZ, but Unity rotation order is ZXY.
396+
// This causes issues when converting euler to quaternion, causing the final
397+
// rotation to be slighlty off.
398+
// Fixed if we set the rotation order to the Unity rotation order in the FBX.
399+
fbxNode.SetRotationOrder (FbxNode.EPivotSet.eSourcePivot, FbxEuler.EOrder.eOrderZXY);
400+
395401
// get local position of fbxNode (from Unity)
396402
UnityEngine.Vector3 unityTranslate = unityTransform.localPosition;
397403
UnityEngine.Vector3 unityRotate = unityTransform.localRotation.eulerAngles;

0 commit comments

Comments
 (0)