Fix missing call to OnAnimationUpdated when using custom skeleton pose

This commit is contained in:
Wojtek Figat
2021-05-13 13:15:09 +02:00
parent e00e9d1552
commit 899e749d2d
2 changed files with 18 additions and 14 deletions

View File

@@ -70,22 +70,8 @@ void AnimationManagerService::Update()
// Evaluate animated nodes pose
graph->GraphExecutor.Update(animatedModel->GraphInstance, dt);
// Calculate the final bones transformations
{
ANIM_GRAPH_PROFILE_EVENT("Final Pose");
auto& skeleton = animatedModel->SkinnedModel->Skeleton;
UpdateBones.Resize(skeleton.Bones.Count(), false);
for (int32 boneIndex = 0; boneIndex < skeleton.Bones.Count(); boneIndex++)
{
auto& bone = skeleton.Bones[boneIndex];
UpdateBones[boneIndex] = bone.OffsetMatrix * animatedModel->GraphInstance.NodesPose[bone.NodeIndex];
}
}
// Update gameplay
const bool usePrevFrameBones = animatedModel->PerBoneMotionBlur;
animatedModel->_skinningData.SetData(UpdateBones.Get(), !usePrevFrameBones);
animatedModel->OnAnimationUpdated();
}
}