Skip to content

Commit 5860a7f

Browse files
committed
remove unroll filter
- not unrolling properly now that we are using ZXY rotation order
1 parent 3f1ede8 commit 5860a7f

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,9 +1158,9 @@ internal static FbxVector4 ToFbxVector4(FbxDouble3 v)
11581158
/// </summary>
11591159
/// <returns>a quaternion.</returns>
11601160
/// <param name="euler">Euler.</param>
1161-
internal static FbxQuaternion EulerToQuaternion(FbxVector4 euler)
1161+
internal static FbxQuaternion EulerToQuaternionZXY(Vector3 euler)
11621162
{
1163-
var unityQuat = Quaternion.Euler(new Vector3((float)euler.X, (float)euler.Y, (float)euler.Z));
1163+
var unityQuat = Quaternion.Euler(euler);
11641164
return new FbxQuaternion(unityQuat.x, unityQuat.y, unityQuat.z, unityQuat.w);
11651165
}
11661166

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ public void Animate(Transform unityTransform, FbxNode fbxNode, FbxAnimLayer fbxA
123123
// Uni-35616 unroll curves to preserve continuous rotations
124124
var fbxCurveNode = fbxNode.LclRotation.GetCurveNode(fbxAnimLayer, false /*should already exist*/);
125125

126-
FbxAnimCurveFilterUnroll fbxAnimUnrollFilter = new FbxAnimCurveFilterUnroll();
127-
fbxAnimUnrollFilter.Apply(fbxCurveNode);
128-
129126
if (Verbose) {
130127
Debug.Log("Exported rotation animation for " + fbxNode.GetName());
131128
}
@@ -179,9 +176,8 @@ protected override FbxQuaternion GetConvertedQuaternionRotation (float seconds,
179176
);
180177

181178
// convert the final animation to righthanded coords
182-
var finalEuler = ModelExporter.ToFbxDouble3(unityFinalAnimation);
183179

184-
return ModelExporter.EulerToQuaternion (new FbxVector4(finalEuler));
180+
return ModelExporter.EulerToQuaternionZXY (unityFinalAnimation);
185181
}
186182
}
187183

0 commit comments

Comments
 (0)