Introduction
The optimization is about the animation node Blendlist_Base
, which means all blend list nodes(eg. Blend Pose By Bool
, Blend Pose By Enum
and Blend Pose By Integer
) can benefit from this optimization.
Performance Waste
The key point of this optimization is, in most of the times, only one branch would be evaluated for a blendlist.
But in FAnimNode_BlendListBase::Evaluate_AnyThread
, a FAnimationRuntime::BlendPosesTogether
function would be called even only one branch is evaluated.
1 | for (int32 i = 0; i < PosesToEvaluate.Num(); ++i) |
As a result, BlendPose<ETransformBlendMode::Overwrite>
would be called, and this leads to a per bone blend:
How To Fix
It is fairly easy to fix this issue: We simply Evaluate the branch to the Output
context when only one branch is valid.