struct
AnimatorComponent
- Module
- Animation
- Header
#include "Animation/Components/AnimatorComponent.h"- Namespace
Mowo- Reflection
- Reflected by MowoHeaderTool
Properties
| Type | Name | Description |
|---|---|---|
bool | enabled | Default true. |
bool | playing | Default true. |
bool | loop | Default true. |
float | speed | Default 1.0f. |
float | currentTime | Default 0.0f. |
int32_t | currentAnimation | Current animation index (-1 = none) Default 0. |
Ref<Skeleton> | skeleton | Shared skeleton (owned by ModelResource, multiple entities can share) |
std::vector<Ref<AnimationClip>> | clips | Available animation clips (owned by ModelResource) |
std::vector<Mat4> | boneMatrices | Computed bone matrices for GPU upload (final skinning matrices) Updated by AnimationSystem each frame |
ESkinningMethod | skinningMethod | Rides every skinned draw this animator submits; the renderer converts the palette on upload, so the CPU pose stays matrices either way. Default ESkinningMethod::Linear. |
EntityID | leaderPoseEntity | Leader-pose (UE's master pose): when set, this animator does not evaluate at all — after the frame's evaluation it COPIES the leader entity's final palette/pose. Modular characters (head/torso/legs sharing one skeleton) pay one evaluation instead of one per part. Skeleton bone counts must match; a mismatch skips the copy with a one-time warning. Default INVALID_ENTITY. |
bool | leaderPoseWarned | Default false. |
std::vector<Mat4> | globalPose | The final GLOBAL (mesh-space) pose behind boneMatrices — what socket queries and gameplay bone lookups read. Reconstructing it from the palette would need inverse bind matrices, which procedurally-built skeletons don't always carry. |
std::string | modelPath | Model path for serialization |
Ref<AnimationController> | controller | Optional state machine controller for advanced transitions When set, overrides basic currentAnimation/currentTime playback |
std::string | controllerPath | Authored .animgraph controller asset, resolved once by AnimationSystem into controller above so every hydration path picks it up. |
bool | controllerResolveAttempted | Default false. |
FAnimGraphInstance | graphInstance | Per-entity runtime state for the controller's pose graph (clip clocks, bool-blend state, cached-pose slots) — never shared across entities even when the controller asset is. |
std::unordered_map<std::string, std::shared_ptr<const FAnimGraph>> | linkedLayers | Graphs linked into named layers (UE linked anim layers): a Linked Anim Layer node in the controller's graph runs the one linked under its name, so carrying a torch, an injury or a two-handed object swaps a whole locomotion sub-graph instead of bloating one graph with bool switches. |
float | prevTimeTicks | Animation events. Previous time in ticks (for event detection between frames) Default 0.0f. |
int32_t | prevNotifyClipIndex | The clip prevTimeTicks was measured on. When the playing clip's identity changes (state switch, blend-space representative change), the interval [prevTimeTicks, now] spans two unrelated timelines — firing it would replay the new clip's whole notify backlog, and a shorter new clip reads as a loop wrap. Event detection re-anchors instead. Default -1. |
std::unordered_map<std::string, AnimEventCallback> | eventCallbacks | Event callbacks: name -> callback. |
AnimEventCallback | globalEventCallback | Global callback for all events (useful for scripting dispatch) |
float | lodAccumDt | Update-rate LOD — banked dt + frame counter while the AnimationSystem skips this animator (far from the LOD focus). Default 0.0f. |
uint32_t | lodFrameCounter | Default 0. |
uint32_t | animLod | Which per-LOD required-bone set the skeleton should apply this frame (Skeleton::SetLodBonesToRemove). AnimationSystem writes it from the same distance/significance tier that picks the update rate — a rig far enough to sample every 16th frame is also far enough to stop animating its fingers. A skeleton with no authored masks ignores it entirely. Default 0. |
uint64_t | lastRenderedSerial | The AnimationSystem update serial at which the scene last drew this animator inside the camera frustum (AnimationSystem::NoteRendered), and how many frames in a row the budget has deferred it — the input to a.OffscreenInterval and the starvation guard of a.BudgetMs. Default 0. |
uint32_t | budgetDeferredFrames | Default 0. |
bool | rootMotionEnabled | Root motion. Deltas are FRAME-TO-FRAME (UE5 semantics), so delta / dt is a velocity. Loop wraps and clip changes are compensated in ExtractRootMotion; the prev* fields are its running state, not an output. Default false. |
bool | rootMotionIncludeVertical | Keep the authored vertical in the DELTA (vault/jump/mantle clips move the capsule up) instead of leaving it in the pose and zeroing the delta's Y. Off by default: idle/walk clips bob the root, and without this flag that bob stays cosmetic in the pose. Default false. |
bool | rootMotionFromMontagesOnly | UE's RootMotionFromMontagesOnly: the delta comes from the montage playhead alone (weight-scaled), so locomotion blends can never feed the capsule — montage-driven attacks/dodges still do. Slot montages are not sourced, only the main montage player. Default false. |
Vec3 | rootMotionDeltaPosition | |
Quat | rootMotionDeltaRotation | Default Quat::Identity(). |
bool | rootMotionHasPrev | Default false. |
Vec3 | rootMotionPrevPosition | |
Quat | rootMotionPrevRotation | Default Quat::Identity(). |
std::unordered_map<std::string, float> | animCurves | Named curve values evaluated THIS frame from the playing clips — blend-space weighted like the pose, montage-lerped like the pose. Consumers (material param routing, gameplay) read GetCurveValue. |
std::vector<FAnimPoseClipContribution> | poseClipContributions | What composed THIS frame's pose, with the same weights and per-clip (phase-matched) times the pose blend used. Base entries first, montage overlays after, in application order. Empty when the animator was not evaluated this frame. |
std::vector<AnimationLayer> | layers | Animation layers (additive blending). |
MontagePlayer | montage | Montage — one-shot sectioned clip blended over the base pose. |
std::shared_ptr<Montage> | ownedMontage | MontagePlayer keeps a raw Montage* it does not own. A transient driver (behaviour-tree task, gameplay ability) hands its data over through PlayOwnedMontage so the description outlives the driver rather than the player pointing into freed storage when the driver goes away. |
std::unordered_map<std::string, FMontageSlot> | montageSlots | |
std::vector<std::string> | montageAssets | Montage ASSETS (.montage) this animator can play by name. Authored on the component so a designer wires the attack montages onto a character without a line of C++; FMontageDocument::ResolveForAnimator loads each one once, after the model's clips are in, because a montage names its sections' clips by name and cannot be built before they exist. |
std::unordered_map<std::string, std::shared_ptr<Montage>> | montageAssetInstances | Built descriptions, keyed by the montage's own name — its stable identity, which is also what replication hashes into a montage id. |
bool | montageAssetsResolved | Default false. |
FInertializer | transitionInertializer | State-machine transition inertialization. A controller transition captures the outgoing pose here and decays the per-bone offset to zero over the transition window, so state changes are pop-free (C0/C1 continuous) and can be interrupted mid-blend by a higher priority transition. lastPose/prevPose are the on-screen pose from the previous two frames — the inertializer's source + source velocity. |
std::vector<Mat4> | lastPose | |
std::vector<Mat4> | prevPose | |
std::string | transitionBlendProfileName | A transition's blend profile resolved against THIS entity's skeleton (per-bone blend windows). Cached by name because a locomotion graph fires the same handful of transitions over and over, and never on the shared controller asset because animation evaluates on job workers. |
FBlendProfileResolved | transitionBlendProfile | |
std::vector<float> | transitionBoneBlendTimes | |
std::unordered_map<std::string, FMotionWarpTarget> | motionWarpTargets | Motion warping — gameplay-set targets keyed by name, matched against a clip's authored warp windows. During a window the root-motion delta is redistributed so the accumulated motion lands the character exactly on the target's world transform at the window's end. |
bool | warpWindowActive | Warp runtime state, captured on window entry and streamed each frame. Default false. |
int32_t | warpActiveClipIndex | Default -1. |
std::string | warpActiveWindowName | |
bool | warpHasTargetRotation | Default false. |
Vec3 | warpLocalTargetPos | |
Quat | warpLocalTargetRot | Default Quat::Identity(). |
Vec3 | warpClipTotal | |
Quat | warpClipRotTotal | Default Quat::Identity(). |
Vec3 | warpClipConsumed | |
Quat | warpClipRotConsumed | Default Quat::Identity(). |
Vec3 | warpEmittedTransl | |
Quat | warpEmittedRot | Default Quat::Identity(). |
Public functions
| Returns | Name | Description |
|---|---|---|
float | GetCurveValue | |
const Montage* | FindMontageAsset | |
bool | PlayMontageAsset | Play a resolved montage asset by name. |
void | PlayOwnedMontage | |
void | PlayMontageOnSlot | |
void | PlayMontage | Routes by the montage's own authored slotName, so the asset decides where it plays instead of every call site restating (or contradicting) it. |
void | StopMontageSlot | |
void | SetMontageSlotBoneMask | |
MontagePlayer* | GetMontageSlot | |
void | LinkAnimLayer | A null graph unlinks; the layer node then passes its input through. |
void | UnlinkAnimLayer | |
void | SetMotionWarpTarget | |
void | SetMotionWarpTarget | |
void | RemoveMotionWarpTarget | |
void | ClearMotionWarpTargets |
Function details
GetCurveValue
C++
float GetCurveValue(const std::string& curveName, float fallback = 0.0f) constFindMontageAsset
C++
const Montage* FindMontageAsset(const std::string& montageName) constPlayMontageAsset
C++
bool PlayMontageAsset(const std::string& montageName, const std::string& startSection = "")Play a resolved montage asset by name. Routes through PlayMontage, so the asset's own slotName decides where it lands.
PlayOwnedMontage
C++
void PlayOwnedMontage(std::shared_ptr<Montage> montageData, const std::string& startSection = "")PlayMontageOnSlot
C++
void PlayMontageOnSlot(const std::string& slot, const Montage* montageData, const std::string& startSection = "")PlayMontage
C++
void PlayMontage(const Montage* montageData, const std::string& startSection = "")Routes by the montage's own authored slotName, so the asset decides where it plays instead of every call site restating (or contradicting) it. PlayMontageOnSlot stays as the explicit override.
StopMontageSlot
C++
void StopMontageSlot(const std::string& slot, float blendOut = -1.0f)SetMontageSlotBoneMask
C++
void SetMontageSlotBoneMask(const std::string& slot, const std::unordered_set<uint32_t>& mask)GetMontageSlot
C++
MontagePlayer* GetMontageSlot(const std::string& slot)LinkAnimLayer
C++
void LinkAnimLayer(const std::string& layer, std::shared_ptr<const FAnimGraph> graph)A null graph unlinks; the layer node then passes its input through.
UnlinkAnimLayer
C++
void UnlinkAnimLayer(const std::string& layer)SetMotionWarpTarget
C++
void SetMotionWarpTarget(const std::string& name, const Vec3& position, const Quat& rotation)SetMotionWarpTarget
C++
void SetMotionWarpTarget(const std::string& name, const Vec3& position)RemoveMotionWarpTarget
C++
void RemoveMotionWarpTarget(const std::string& name)ClearMotionWarpTargets
C++
void ClearMotionWarpTargets()Generated from Animation/Components/AnimatorComponent.h via animation.json · Oct 26, 2026Version 1.0.0