Skip to content

Commit f78d013

Browse files
committed
use the bake animation property but initialize it to false
1 parent 1f10a22 commit f78d013

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ public bool HideSendToUnityMenuProperty
460460
}
461461

462462
[SerializeField]
463-
private bool BakeAnimation = true;
463+
private bool BakeAnimation = false;
464464
internal bool BakeAnimationProperty
465465
{
466466
get { return BakeAnimation; }

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,11 +1941,11 @@ private void ExportAnimationCurve (FbxNode fbxNode,
19411941
// (Meters to Centimetres)
19421942
var convertSceneHelper = new UnityToMayaConvertSceneHelper (uniPropertyName);
19431943

1944-
/*if (ModelExporter.ExportSettings.BakeAnimationProperty) {
1944+
if (ModelExporter.ExportSettings.BakeAnimationProperty) {
19451945
ExportAnimationSamples (uniAnimCurve, fbxAnimCurve, frameRate, convertSceneHelper);
1946-
} else {*/
1947-
ExportAnimationKeys (uniAnimCurve, fbxAnimCurve, convertSceneHelper, uniPropertyName);
1948-
// }
1946+
} else {
1947+
ExportAnimationKeys (uniAnimCurve, fbxAnimCurve, convertSceneHelper, uniPropertyName);
1948+
}
19491949
}
19501950
}
19511951

@@ -2124,7 +2124,12 @@ private void ExportAnimationClip (AnimationClip uniAnimClip, GameObject uniRoot,
21242124
// If this is an euler curve with a prerotation, then need to sample animations to remove the prerotation.
21252125
// Otherwise can export normally with tangents.
21262126
index = EulerCurve.GetEulerIndex (propertyName);
2127-
if (index >= 0 && fbxNode.GetPreRotation(FbxNode.EPivotSet.eSourcePivot).Distance(new FbxVector4()) > 0) {
2127+
if (index >= 0 &&
2128+
// still need to sample euler curves if baking is specified
2129+
(ModelExporter.ExportSettings.BakeAnimationProperty ||
2130+
// also need to make sure to sample if there is a prerotation, as this is baked into the Unity curves
2131+
fbxNode.GetPreRotation(FbxNode.EPivotSet.eSourcePivot).Distance(new FbxVector4()) > 0)) {
2132+
21282133
RotationCurve rotCurve = GetRotationCurve<EulerCurve> (uniGO, uniAnimClip.frameRate, ref rotations);
21292134
rotCurve.SetCurve (index, uniAnimCurve);
21302135
continue;

0 commit comments

Comments
 (0)