Skip to content

Commit 530e9af

Browse files
authored
Merge pull request #384 from Unity-Technologies/UT-484-last-keyframe-missing-on-anim-export
UT-484 make sure no keyframes are ignored when exporting animation curves
2 parents 0597da2 + 5385fee commit 530e9af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,8 +1434,8 @@ public static HashSet<float> GetSampleTimes(AnimationCurve[] animCurves, double
14341434
lastTime = System.Math.Max(lastTime, ac[ac.length-1].time);
14351435
}
14361436

1437-
int firstframe = (int)(firstTime * sampleRate);
1438-
int lastframe = (int)(lastTime * sampleRate);
1437+
int firstframe = (int)System.Math.Floor(firstTime * sampleRate);
1438+
int lastframe = (int)System.Math.Ceiling(lastTime * sampleRate);
14391439
for (int i = firstframe; i <= lastframe; i++) {
14401440
keyTimes.Add ((float)(i * fs));
14411441
}

0 commit comments

Comments
 (0)