When BlendRootMotionBasedOnRootBone is true, the code in
FAnimNode_LayeredBoneBlend::Update_AnyThread that calculates the root motion weightings for the sources doesn't appear to account for the possibility of multiple child poses being blended ontop of the base pose. The calculations only work when there is the base pose and a single child pose. The code responsible seems to be:
for (int32 ChildIndex = 0; ChildIndex < BlendPoses.Num(); ++ChildIndex) { const float ChildWeight = BlendWeights[ChildIndex]; if (FAnimWeight::IsRelevant(ChildWeight)) { if (bHasRelevantPoses == false) { // Update cached data now we know we might be valid UpdateCachedBoneData(Context.AnimInstanceProxy->GetRequiredBones(), Context.AnimInstanceProxy->GetSkeleton()); // Update weights FAnimationRuntime::UpdateDesiredBoneWeight(DesiredBoneBlendWeights, CurrentBoneBlendWeights, BlendWeights); bHasRelevantPoses = true; if(bBlendRootMotionBasedOnRootBone && !CurrentBoneBlendWeights.IsEmpty()) { const float NewRootMotionWeight = CurrentBoneBlendWeights[0].BlendWeight; if(NewRootMotionWeight > ZERO_ANIMWEIGHT_THRESH) { RootMotionWeight = NewRootMotionWeight; RootMotionBlendPose = CurrentBoneBlendWeights[0].SourceIndex; } } } const float ThisPoseRootMotionWeight = (ChildIndex == RootMotionBlendPose) ? RootMotionWeight : RootMotionClearWeight; BlendPoses[ChildIndex].Update(Context.FractionalWeightAndRootMotion(ChildWeight, ThisPoseRootMotionWeight)); } }
Because CurrentBoneBlendWeights[0].SourceIndex doesn't change for each child index, ThisPoseRootMotionWeight will be zero for most sources, except for the one source where ChildIndex == RootMotionBlendPose (==CurrentBoneBlendWeights[0].SourceIndex) .
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-187218 in the post.
0 |
Component | UE - Anim - Runtime |
---|
Created | May 27, 2023 |
---|---|
Resolved | May 29, 2023 |
Updated | Jun 5, 2023 |