From ec303a3b8a6da4ef7c4775a584500ab7b359601f Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Tue, 31 Oct 2017 15:09:25 -0700 Subject: [PATCH] Tiny but critical logic oops. --- src/Fbx2Raw.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Fbx2Raw.cpp b/src/Fbx2Raw.cpp index 5f884fc..2c25296 100644 --- a/src/Fbx2Raw.cpp +++ b/src/Fbx2Raw.cpp @@ -1131,7 +1131,7 @@ static void ReadAnimations(RawModel &raw, FbxScene *pScene) for (size_t channelIx = 0; channelIx < blendShapes.GetChannelCount(); channelIx++) { auto curve = blendShapes.GetAnimation(channelIx, animIx); - float influence = curve->Evaluate(pTime); // 0-100 + float influence = (curve != nullptr) ? curve->Evaluate(pTime) : 0; // 0-100 int targetCount = static_cast(blendShapes.GetTargetShapeCount(channelIx)); @@ -1164,7 +1164,7 @@ static void ReadAnimations(RawModel &raw, FbxScene *pScene) hasMorphs = true; continue; } - if (targetIx > 0) { + if (targetIx != targetCount-1) { result = findInInterval(influence, targetIx); if (!isnan(result)) { // we're transitioning AWAY from targetIx