From 9c8271a64bbe1c915a846f971df4a2a5eca31be9 Mon Sep 17 00:00:00 2001 From: OTHGMars Date: Thu, 25 Apr 2019 16:27:46 -0400 Subject: [PATCH] Sanity check for sequence times. If the sequence end time is greater than 1000, millisecond timestamps are automatically assigned. --- Engine/source/ts/assimp/assimpAppSequence.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Engine/source/ts/assimp/assimpAppSequence.cpp b/Engine/source/ts/assimp/assimpAppSequence.cpp index c64e7d068..65a1f4b9e 100644 --- a/Engine/source/ts/assimp/assimpAppSequence.cpp +++ b/Engine/source/ts/assimp/assimpAppSequence.cpp @@ -69,6 +69,12 @@ AssimpAppSequence::AssimpAppSequence(aiAnimation *a) : } else { // Timing specified in seconds or ms depending on format + if (maxEndTime > 1000.0f || mAnim->mDuration > 1000.0f) + { + timeFactor = 1000.0f; // If it's more than 1000 seconds, assume it's ms. + Con::setIntVariable("$Assimp::AnimTiming", 1000); + } + timeFactor = mClamp(timeFactor, 1, 1000); minFrameTime /= (F32)timeFactor; maxEndTime /= (F32)timeFactor;