FAnimGraph
- Module
- Animation
- Header
#include "Animation/AnimGraph.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
std::vector<FAnimGraphNode> | nodes | |
std::vector<FAnimGraphLink> | links | |
uint64_t | nextId | Default 1. |
uint64_t | structureVersion | Bumped by every mutator here (and by Deserialize / CopyFrom). An instance's compiled wiring is keyed on it, so an editor that edits nodes / links directly must call MarkStructureDirty() — a bone name changed in place would otherwise keep resolving to the old index. Default 1. |
Public functions
| Returns | Name | Description |
|---|---|---|
void | MarkStructureDirty | |
bool | IsEmpty | |
bool | HasWork | True when evaluating would change the pose: an Output node exists and its input chain is more than a bare StateMachine node. |
uint64_t | AddNode | |
void | RemoveNode | |
FAnimGraphNode* | Find | |
const FAnimGraphNode* | Find | |
uint64_t | OutputNodeId | |
uint64_t | Connect | Replaces any existing link into (toNode, toSlot). |
void | Disconnect | |
uint32_t | InputCount | |
const char* | NodeTypeName | |
void | PrimePoseAssets | Pulls every .pose this graph names into FPoseAssetLibrary. |
uint32_t | BindClipIds | Fills every clip reference's package id (Clip, Sequence Evaluator, Random Player candidates, additive reference, blend-space samples) from the clip its name resolves to, and leaves an id that already resolves alone. |
bool | Evaluate | Evaluate the graph into out (local transforms, skeleton bone order). |
void | Serialize | MDF <-> graph, as "GraphNode"/"GraphLink" children of the given parent (the .animgraph AnimationController root). |
bool | Deserialize | |
void | CopyFrom |
Function details
MarkStructureDirty
void MarkStructureDirty()IsEmpty
bool IsEmpty() constHasWork
bool HasWork() constTrue when evaluating would change the pose: an Output node exists and its input chain is more than a bare StateMachine node.
AddNode
uint64_t AddNode(EAnimGraphNodeType type, const Vec2& pos)RemoveNode
void RemoveNode(uint64_t id)Find
FAnimGraphNode* Find(uint64_t id)Find
const FAnimGraphNode* Find(uint64_t id) constOutputNodeId
uint64_t OutputNodeId() constConnect
uint64_t Connect(uint64_t fromNode, uint64_t toNode, uint32_t toSlot)Replaces any existing link into (toNode, toSlot). Returns the link id.
Disconnect
void Disconnect(uint64_t linkId)InputCount
static uint32_t InputCount(EAnimGraphNodeType type)NodeTypeName
static const char* NodeTypeName(EAnimGraphNodeType type)PrimePoseAssets
void PrimePoseAssets() constPulls every .pose this graph names into FPoseAssetLibrary. Call it from the game thread before evaluating: the evaluator will load one itself, but it runs on job workers and the first touch would be a file read inside the parallel phase.
BindClipIds
uint32_t BindClipIds(const std::vector<Ref<AnimationClip>>& clips)Fills every clip reference's package id (Clip, Sequence Evaluator, Random Player candidates, additive reference, blend-space samples) from the clip its name resolves to, and leaves an id that already resolves alone. Game thread, like the controller's own ResolveClips: a saved graph then carries the ids forward. Returns how many ids it wrote.
Evaluate
bool Evaluate(const FAnimGraphContext& ctx, std::vector<Mat4>& out) constEvaluate the graph into out (local transforms, skeleton bone order). Nodes are memoized per call, so a node feeding two inputs evaluates — and advances its clock — exactly once per frame. Returns false when there is nothing to evaluate (no skeleton / no output node).
Serialize
void Serialize(MdfNode& parent) constMDF <-> graph, as "GraphNode"/"GraphLink" children of the given parent (the .animgraph AnimationController root).
Deserialize
bool Deserialize(const MdfNode& parent)CopyFrom
void CopyFrom(const FAnimGraph& other)