Skip to content

Commit 1e1ba52

Browse files
committed
fix zero length anim curve creating key at super negative value when sampling
1 parent ed5149e commit 1e1ba52

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,13 @@ internal static HashSet<float> GetSampleTimes(AnimationCurve[] animCurves, doubl
17151715
lastTime = System.Math.Max(lastTime, ac[ac.length-1].time);
17161716
}
17171717

1718+
// if these values didn't get set there were no valid anim curves,
1719+
// so don't return any keys
1720+
if(firstTime == double.MaxValue || lastTime == double.MinValue)
1721+
{
1722+
return keyTimes;
1723+
}
1724+
17181725
int firstframe = (int)System.Math.Floor(firstTime * sampleRate);
17191726
int lastframe = (int)System.Math.Ceiling(lastTime * sampleRate);
17201727
for (int i = firstframe; i <= lastframe; i++) {

0 commit comments

Comments
 (0)