RealDocs

UAnimInstance::ParallelCanEvaluate

function Engine Since 4.9
#include "Animation/AnimInstance.h"
Access: public Specifiers: virtualENGINE_API

Description

Returns whether this AnimInstance supports evaluation on a worker thread for the given skeletal mesh. The default implementation returns false; override to true only when your custom AnimInstance accesses no game-thread-only state during evaluation.

Caveats & Gotchas

  • Returning true opts the entire evaluation into the parallel animation system. Any game-thread-only access (UObject property reads, Actor queries, etc.) inside NativeUpdateAnimation or the anim graph will cause race conditions or crashes. Use thread-safe accessors and copy data in NativeThreadSafeUpdateAnimation instead.
  • The engine checks this flag each frame; returning a dynamic value based on state is safe, but the transition from false→true mid-play can stall the game thread for one frame while the task is rescheduled.

Signature

ENGINE_API virtual bool ParallelCanEvaluate(const USkeletalMesh* InSkeletalMesh) const;

Parameters

Name Type Description Default
InSkeletalMesh const USkeletalMesh* The skeletal mesh about to be evaluated.

Return Type

bool

Example

Enable parallel evaluation for a simple procedural AnimInstance C++
bool UMyAnimInstance::ParallelCanEvaluate(const USkeletalMesh* InSkeletalMesh) const
{
	// Safe because NativeThreadSafeUpdateAnimation copies all required state
	return true;
}

Version History

Introduced in: 4.9

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.