Hi,
I found a new bug in 4.23: if a skinned mesh has both SubAnimInstances in its animation blueprint AND a postprocess blueprint, the sub instances are ticked twice each frame, effectively playing any animation at double speed. (imagine sg like “Benny Hill mode”)
The reson i have found so far is that in 4.23, UAnimInstance::ParallelUpdateAnimation() has a new loop that ticks the skeletal mesh component’s subInstances (note that they are in the skeletalmeshcomponent and NOT in the AnimInstance!), and USkeletalMeshComponent::PerformAnimationProcessing, that calls it, calls ParallelUpdateAnimation on BOTH the main blueprint (InAnimInstance) and on PostProcessAnimInstance, right one after the other. (see SkeletalMeshComponent, lines 1857 and 1863)
I diffed AnimInstance.cpp, this loop did not exist in 4.22.
So if the skeletal mesh has not only a main blueprint but also a postProcess, each subInstance gets ticked TWICE, once from AnimInstance and once from PostProcessAnimInstance.
For now i managed to eliminate the problem by adding a check in UAnimInstance::ParallelUpdateAnimation() to skip the loop if we are in the postprocessaniminstance:
const USkeletalMeshComponent* skel = GetSkelMeshComponent();
if (this != skel->PostProcessAnimInstance)
{// ...but ONLY if i'm NOT the postprocess, otherwise they would be double-ticked
for (UAnimInstance* SubInstance : skel->SubInstances)
{
SubInstance->GetProxyOnAnyThread<FAnimInstanceProxy>().TickAssetPlayerInstances();
}
}
Can somebody please confirm if this is a proper fix? It does work for us but i didn’t test it in absolutely every case (although arguably the change in 4.23 also was not tested for this particular case of a skeletalmesh having both subInstances and postprocess)
Thanks,