From 0e6478c0d406c6a2f6720edfeff0b5854563da93 Mon Sep 17 00:00:00 2001 From: Theak Date: Sun, 22 Sep 2019 09:59:58 +0100 Subject: [PATCH 1/2] Fix: Wrong aiAnimation::mTicksPerSecond for gltf2 imports (fixes #2662) --- code/glTF2/glTF2Importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/glTF2/glTF2Importer.cpp b/code/glTF2/glTF2Importer.cpp index d1871ce0e..d0befe2f7 100644 --- a/code/glTF2/glTF2Importer.cpp +++ b/code/glTF2/glTF2Importer.cpp @@ -1177,7 +1177,7 @@ void glTF2Importer::ImportAnimations(glTF2::Asset& r) } } ai_anim->mDuration = maxDuration; - ai_anim->mTicksPerSecond = (maxNumberOfKeys > 0 && maxDuration > 0) ? (maxNumberOfKeys / (maxDuration/1000)) : 30; + ai_anim->mTicksPerSecond = 0.001; mScene->mAnimations[i] = ai_anim; } From 7a8b7ba88d6d84dde7fd43419ac2b022c9887856 Mon Sep 17 00:00:00 2001 From: Theak Date: Sun, 29 Sep 2019 10:09:53 +0100 Subject: [PATCH 2/2] aiAnimation::mTicksPerSecond for gltf2 imports - should always be 1000.0 --- code/glTF2/glTF2Importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/glTF2/glTF2Importer.cpp b/code/glTF2/glTF2Importer.cpp index fe52e9f28..f8e52ae66 100644 --- a/code/glTF2/glTF2Importer.cpp +++ b/code/glTF2/glTF2Importer.cpp @@ -1176,7 +1176,7 @@ void glTF2Importer::ImportAnimations(glTF2::Asset& r) } } ai_anim->mDuration = maxDuration; - ai_anim->mTicksPerSecond = 0.001; + ai_anim->mTicksPerSecond = 1000.0; mScene->mAnimations[i] = ai_anim; }