Skip to content

Commit a3adda6

Browse files
committed
glTF export produced nan/inf max value for time track when Seq.Rate is 0
1 parent 6d95fc7 commit a3adda6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Exporters/ExportGLTF.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,8 @@ static void ExportAnimations(GLTFExportContext& Context, FArchive& Ar)
738738
BufferData& TimeBuf = Context.Data[TimeBufIndex];
739739
TimeBuf.Setup(NumKeys, "SCALAR", BufferData::FLOAT, sizeof(float));
740740

741-
float RateScale = 1.0f / Seq.Rate;
741+
// Compute RateScale. Take care of null Rate - this might be valid if animation has just 1 frame (pose)
742+
float RateScale = (Seq.Rate > 0.001f) ? 1.0f / Seq.Rate : 1.0f;
742743
float LastFrameTime = 0;
743744
if (TimeArray->Num() == 0 || NumKeys == 1)
744745
{

umodel.exe

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)