From 4695d36ea5fc5b60a4bf4edb7649ca7cbce3fb1d Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 5 Jan 2022 08:54:34 +0000 Subject: [PATCH] Fix: Blend node applies both poses at value 1 (#6292) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp index 7720822655..f4f96e6b93 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp @@ -224,6 +224,11 @@ namespace EMotionFX poseIndexB = poseIndexA; *outWeight = 0.0f; } + else if ((*outWeight > 1.0f - MCore::Math::epsilon)) + { + poseIndexA = poseIndexB; + *outWeight = 0.0f; + } // Search complete: the input weight is between m_paramWeights[i] and m_paramWeights[i - 1] // Calculate the blend weight and get the nodes and then return