使用MotionMatching时发现动画节点BlendStack会使根运动提取最终权重之和不为一

动画蓝图开启RootMotionFromEverything,使用Motion Matching节点,当BlendStack中的AnimPlayers数量大于1时,且动画处于blend的状态,会出现肉眼可见的滑步现象(位移过慢)。

跟进了代码怀疑是bug(也可能是设计如此),先前在github上提了一份pr兼issues,里面包含了分析过程和示例日志,担心等待回复太久因此在这里请求支持。

https://github.com/EpicGames/UnrealEngine/pull/13083

Hi,

Thanks for reporting this issue. It does look like this is a bug in the Blend Stack node.

The fix described in the pull request appears to be correct. However, I would go with a slightly different implementation.

Existing code:

`const float BlendInPercentage = bIsLastAnimPlayers ? 1.f : AnimPlayer.GetBlendInWeight();
const float AnimPlayerBlendWeight = CurrentWeightMultiplier * BlendInPercentage;

FAnimationUpdateContext AnimPlayerContext = Context.FractionalWeightAndRootMotion(AnimPlayerBlendWeight, AnimPlayerBlendWeight);
UpdateSample((AnimPlayerIndex == 0) ? AnimPlayerContext : AnimPlayerContext.AsInactive(), AnimPlayerIndex);
CurrentWeightMultiplier *= (1.f - BlendInPercentage);`Fixed code:

`const float BlendInPercentage = bIsLastAnimPlayers ? 1.f : AnimPlayer.GetBlendInWeight();
const float AnimPlayerBlendWeight = CurrentWeightMultiplier * BlendInPercentage;

FAnimationUpdateContext AnimPlayerContext = Context.FractionalWeight(AnimPlayerBlendWeight);
UpdateSample((AnimPlayerIndex == 0) ? AnimPlayerContext : AnimPlayerContext.AsInactive(), AnimPlayerIndex);
CurrentWeightMultiplier *= (1.f - BlendInPercentage);`This effectively does the same thing as mentioned in the pull request.

I’ll discuss with the dev team about getting this change integrated.