AnimGraph
The AnimGraph is used to evaluate a final pose for the SkeletalMesh for the current frame. By default, each Animation Blueprint has an AnimGraph which can have animation nodes placed within it to sample AnimationSequences, perform animation blends, or control bone transforms using SkeletalControls. The resulting pose is then applied to the SkeletalMesh each frame.
Inside the AnimGraph you can use values calculated in the EventGraph or elsewhere, likely in code, and use those as inputs for BlendSpaces or other blend nodes. Of course, you can also just sample AnimationSequences directly without any special blending. The AnimGraph also allows for the use of SkeletalControls to modify bone positions, rotations, and scales directly.
Execution Flow
All graphs have a flow of execution shown as pulsing links between exec pins on the graph's nodes. For regular graphs, such as the EventGraph of a Blueprint, this flow is visualized during play as it is dependent on the firing of events. The AnimGraph is different in that it displays the flow of execution at all times since it is not event-based and is being evaluated each frame.
In the AnimGraph, the flow of execution represents poses being passed from one node to another. Some nodes, such as blends, have multiple inputs and make a decision internally on which input is currently part of the flow of execution. This determination is usually dependent on some external input, like the value passed to a data pin.
In the example below, the same blend node from above switched the execution flow between its inputs based on the value of its Alpha pin (the value is being manually set for simplicity):
Blend with Alpha of 1.0 - Input B is used
Working with the AnimGraph
The AnimGraph works by evaluating a graph of nodes. Some of these nodes perform some specific operation on one or more input poses, while others are used to access or sample other types of assets, such as AnimationSequences, BlendSpaces, or AnimMontages. These assets and nodes, as well as how they fit into the AnimGraph, are described below.
AnimationSequences
Playback of Animation Sequences can be performed through code, but is generally handled within an instance of an Animation Blueprint applied to a SkeletalMeshComponent. All of the Animation Sequences for the Skeleton the Animation Blueprint was created from are available to be sampled within the AnimGraph. These can be placed as sequence player nodes whose output is a pose generated by sampling the Animation Sequences.
See the Animation Sequence User Guide for more details.
Blendspaces
Blend Spaces are used by placing nodes in the AnimGraphs of Animation Blueprints. These nodes take in value data that is used to drive which animations the Blend Space uses to create the final blended pose.
See Using Blend Spaces for more details.
Animation Nodes
Animation Blueprints make use of various nodes within their graphs to perform operations on input poses, such as blending, direct bone manipulation, and more. There are a few distinct types of animation nodes provided in the engine including events, blend nodes, skeletal controllers, space nodes, and conversion nodes.
See Animation Node Reference for more descriptions of all available nodes.
Animation Blending
Blend Nodes are used to blend multiple animations together. These nodes are only available to be placed in the Anim Graph of a Animation Blueprint. Each blend node takes in multiple poses and an alpha or weight value that is used to calculate the weighting for each pose in the final output. Some blend nodes may be more complex than others and require additional data to be input as well.
See Blend Nodes for more information on the space conversion nodes.
Skeletal Controls
SkeletalControls (also called SkelControls) allow direct control of bones within a Skeleton. These can be used within Animation Blueprints to control an individual bone, create IK chains, and more. This direct control of the underlying Skeleton provides the ability to create procedural, dynamically-driven animation. The Transform of one bone can be used to drive another or traces can be used to conform the feet of a character to the ground while playing a generic walk animation. Any sort of modification can be used to tweak or completely override the bone Transforms applied by AnimationSequences.
See Skeletal Controls for more information on the various types of SkeletalControls available.
Space Conversion
Poses can either be in local-space or component-space. The Convert Spaces nodes available in the AnimGraph of Animation Blueprints provide the ability to convert poses between local and component space. Local space assumes the transform of a bone to be relative to that bone. Component space assumes the bone's transform to be relative to the SkeletalMeshComponent.
Generally, when working with poses in an Animation Blueprint, they will be in local-space. However, certain blend nodes and all SkeletalControls operate in component-space. This means that the input pose needs to be transformed prior to being passed in to one of these types of nodes. If the input pose is coming from a node that outputs a local space pose, the pose must be converted to the correct space before a SkeletalControl can perform operations on it. The resulting pose, after the SkeletalControl have performed the operations, then must be converted back to local space for input to additional blends or the Result pin.
See Convert Spaces Nodes for more information on the space conversion nodes.
Sync Groups
Sync Groups are to keep related animations that may have different lengths synchronized. For example, you may have a walk cycle and a run cycle that you would like to blend together so that the character can smoothly accelerate or decelerate. But what if these animations were different lengths, such as the walk being significantly longer than the run? In such a case, directly blending from one to the other would have unnatural results, an unsightly "beat" as the foot animation switches.
Sync Groups solve this problem by allowing one primary animation node to serve as the Leader, and all other related animations will simply scale their time length to match. Typically, the leader is the node with the greatest blend weight. As the weight blends and the follower's weight exceeds the leader, the follower becomes the leader. In this way, the two animations can work smoothly together offering a seamless transition from one motion to the next.
It should be noted, however, that since the time of the animations is shifting, certain animation considerations become apparent. For instance, in the example of blending between different walk and run cycles, you would want to make sure your animations all started and ended on the same foot. Establishing these standards early will help everything blend much more smoothly!
See Sync Groups for more information on Sync Group usage and additional details.