惯性化过渡导致BlendWeight没有更新 Inertialtransition caused BlendWeight not updated

screenshots

void FAnimNode_StateMachine::UpdateTransitionStates(const FAnimationUpdateContext& Context, FAnimationActiveTransitionEntry& Transition)
{
	if (Transition.bActive)
	{
		switch (Transition.LogicType)
		{
		case ETransitionLogicType::TLT_StandardBlend:
			{
				...
			}
			break;

		case ETransitionLogicType::TLT_Inertialization:
			{
				UE::Anim::TScopedGraphMessage<UE::Anim::FAnimInertializationSyncScope> InertializationSync(Context);
// 在这里并未Update初始State,导致初始State中的所有SequencePlayer等节点的BlendWeight都未更新
// The initial state was not updated here, resulting in the BlendWeight of all SequencePlayer and other nodes in the initial state not being updated


				// update target state
				UpdateState(Transition.NextState, (Transition.NextState == CurrentState) ? Context : Context.AsInactive());
			}
			break;

所以,当调用FAnimNode_AssetPlayerRelevancyBase::GetCachedBlendWeight时,获取到的BlendWeight都是过渡之前的Weight, 则依赖这个函数的GetRelevantAnimTimeRemaining ,GetRelevantAnimTime获取到的始终都是源状态中AssetPlayerAnimTime,而不是新状态的

So, when calling FAnimNode_ AssetPlayer Elevation Base:: GetCheedBlend Weight, the BlendWeight obtained is the weight before the transition. Therefore, if we rely on this function, the ∝leventAnimTimeRemaining function will always obtain the AnimTime of AssetPlayer in the source state, rather than the AnimTime of the new state

下图为调用GetRelevantAnimTimeRemaining 时打印的调试,PlayerIdx 15为惯性化过渡之后SequencePlayer的Idx ,PlayerIdx 13 为惯性化过渡之前的SequencePlayer的Index,发现这两个的权重都为1

The following figure shows the debugging of printing when calling ptr leveantAnimTimeRemaining. PlayerIdx 15 is the Idx of SequencePlayer after inertia transition, and PlayerIdx 13 is the Index of SequencePlayer before inertia transition. It was found that the weights of both are 1

image