Description

In the AnimNode_Slot code, It seems that update() and evaluate() should be called by following order because in TickAnimation step, we need to make MontageEvaluateData valid.

  1. SkeletalMeshComponent::Update ( TickAnimation )
  2. SkeletalMeshComponent::Evaluate ( RefreshBoneTransform )

however when using AnimBudgetAllocator, tick can be skipped and

problem occurs when Evaluate() called without update().

 

licensee seems to have solved this problem through the code below. 

AnimInstanceProxy.cpp
---------------------
bool FAnimInstanceProxy::IsInvalidMontageEvaluationData() const
{
	return MontageEvaluationData.ContainsByPredicate([](const FMontageEvaluationState& state){ return state.Montage.IsValid() == false; });
}
 
AnimNode_Slot.cpp
---------------------
FPoseContext SourceContext(Output);
if (WeightData.SourceWeight > ZERO_ANIMWEIGHT_THRESH || Output.AnimInstanceProxy->IsInvalidMontageEvaluationData())
{
	Source.Evaluate(SourceContext);
}

 

Steps to Reproduce

When using AnimBudgetAllocator, during the AnimNode Evaluating stage​, Bone Transform becomes invalid, and it causes a crash at TransformVectorized.h 1240 line

it is reproduced in the following situation

  • SkeletalMeshComponent is not in AlwaysTick state (ex. Ticking every 3 frames)
  • Among the AnimNodes that need to be evaluated, there is AnimNode_Slot (ex. play montage slot)
    • The internal weight values of AnimNode_Slot are: SourceWeight 0, SlotWeight 1
  • Situation where SkeletalMeshComponent tick is disabled and then re-enabled outside of AnimBudgetAllocator ( SetComponentTickEnabled() )

Have Comments or More Details?

There's no existing public thread on this issue, so head over to AnswerHub just mention UE-132403 in the post.

0
Login to Vote

Unresolved
ComponentUE - Anim - Runtime
Affects Versions4.26.2
Target Fix5.1
CreatedOct 21, 2021
UpdatedJan 28, 2022