UAnimInstance::GetStateMachineInstanceDesc
#include "Animation/AnimInstance.h"
Access: public
Specifiers: ENGINE_APIconst
Description
Returns the baked (compiled) description of the named state machine, including its states, transitions, and entry rules. Useful for inspecting the static structure of a state machine at runtime.
Caveats & Gotchas
- • Returns null if no state machine with the given name exists in the compiled animation blueprint. Always null-check the result.
- • The returned struct describes the compiled graph topology (states, transitions) but not the runtime state (current state, weights). Use GetStateMachineInstance to query runtime state.
Signature
ENGINE_API const FBakedAnimationStateMachine* GetStateMachineInstanceDesc(FName MachineName) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MachineName | FName | The name of the state machine as defined in the animation blueprint graph. | — |
Return Type
const FBakedAnimationStateMachine* Example
Log state names in a machine C++
const FBakedAnimationStateMachine* Desc = AnimInstance->GetStateMachineInstanceDesc(FName("Locomotion"));
if (Desc)
{
for (const FBakedAnimationState& State : Desc->States)
{
UE_LOG(LogAnimation, Log, TEXT("State: %s"), *State.StateName.ToString());
}
} Tags
Version History
Introduced in: 4.11
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?