Skip to content

Commit c5aaa53

Browse files
committed
set rotation order to Unity order (ZXY)
1 parent b12fb5b commit c5aaa53

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
@@ -277,6 +277,12 @@ protected int ExportComponents (GameObject unityGo, FbxScene fbxScene, FbxNode
277277
return -1;
278278
}
279279

280+
// Fbx rotation order is XYZ, but Unity rotation order is ZXY.
281+
// This causes issues when converting euler to quaternion, causing the final
282+
// rotation to be slighlty off.
283+
// Fixed if we set the rotation order to the Unity rotation order in the FBX.
284+
fbxNode.SetRotationOrder (FbxNode.EPivotSet.eSourcePivot, FbxEuler.EOrder.eOrderZXY);
285+
280286
ExportTransform ( unityGo.transform, fbxNode);
281287
ExportMesh (GetMeshInfo( unityGo ), fbxNode, fbxScene);
282288

0 commit comments

Comments
 (0)