@@ -1941,11 +1941,11 @@ private void ExportAnimationCurve (FbxNode fbxNode,
1941
1941
// (Meters to Centimetres)
1942
1942
var convertSceneHelper = new UnityToMayaConvertSceneHelper ( uniPropertyName ) ;
1943
1943
1944
- /* if (ModelExporter.ExportSettings.BakeAnimationProperty) {
1944
+ if ( ModelExporter . ExportSettings . BakeAnimationProperty ) {
1945
1945
ExportAnimationSamples ( uniAnimCurve , fbxAnimCurve , frameRate , convertSceneHelper ) ;
1946
- } else {*/
1947
- ExportAnimationKeys ( uniAnimCurve , fbxAnimCurve , convertSceneHelper , uniPropertyName ) ;
1948
- // }
1946
+ } else {
1947
+ ExportAnimationKeys ( uniAnimCurve , fbxAnimCurve , convertSceneHelper , uniPropertyName ) ;
1948
+ }
1949
1949
}
1950
1950
}
1951
1951
@@ -2124,7 +2124,12 @@ private void ExportAnimationClip (AnimationClip uniAnimClip, GameObject uniRoot,
2124
2124
// If this is an euler curve with a prerotation, then need to sample animations to remove the prerotation.
2125
2125
// Otherwise can export normally with tangents.
2126
2126
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
+
2128
2133
RotationCurve rotCurve = GetRotationCurve < EulerCurve > ( uniGO , uniAnimClip . frameRate , ref rotations ) ;
2129
2134
rotCurve . SetCurve ( index , uniAnimCurve ) ;
2130
2135
continue ;
0 commit comments