Skip to content

Commit 79343c1

Browse files
committed
Uni-35752-animation-unroll-filter
1 parent 00c7506 commit 79343c1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,14 +1788,16 @@ public void Animate(Transform unityTransform, FbxNode fbxNode, FbxAnimLayer fbxA
17881788
fbxAnimCurveZ.KeySet(i, key.time, (float)key.euler.Z);
17891789
}
17901790

1791-
// Uni-35616 unroll curves to preserve continuous rotations
1792-
FbxAnimCurveFilterUnroll fbxAnimUnrollFilter = new FbxAnimCurveFilterUnroll();
1793-
fbxAnimUnrollFilter.Apply(new []{fbxAnimCurveX,fbxAnimCurveY,fbxAnimCurveZ});
1794-
17951791
fbxAnimCurveZ.KeyModifyEnd();
17961792
fbxAnimCurveY.KeyModifyEnd();
17971793
fbxAnimCurveX.KeyModifyEnd();
17981794

1795+
// Uni-35616 unroll curves to preserve continuous rotations
1796+
var fbxCurveNode = fbxNode.LclRotation.GetCurveNode(fbxAnimLayer, false /*should already exist*/);
1797+
1798+
FbxAnimCurveFilterUnroll fbxAnimUnrollFilter = new FbxAnimCurveFilterUnroll();
1799+
fbxAnimUnrollFilter.Apply(fbxCurveNode);
1800+
17991801
if (Verbose) {
18001802
Debug.Log("Exported rotation animation for " + fbxNode.GetName());
18011803
}

0 commit comments

Comments
 (0)