-
Notifications
You must be signed in to change notification settings - Fork 2
Blend Graphs
NAF blend graphs allow you to dynamically combine together multiple animations at runtime, as well as utilize advanced features such as inverse kinematics & spring physics. To create & edit blend graphs, you'll first need to get the Blend Graph Editor, which can either be downloaded from NexusMods under "Optional Files" or built from the source available on GitHub.
When you first open the Blend Graph Editor, you'll find one of the simplest blend graphs already partially set up for you - an animation and an actor. The Actor node is where a blend graph's final output goes to, so to simply play an animation, you can enter the animation's file name in the "File" text box on the Full Animation node, then click and drag its Output Pose to the Actor's Input Pose. You can then select File -> Save As...
and you'll have a working blend graph that simply plays the corresponding animation.
Of course, we can play an animation without a blend graph, so next we'll get into what we can put between the animation and the actor.
To create a new node, click and drag the Full Animation's Output Pose and drop it onto an empty space. This will bring up a menu with all possible nodes that can be created. For this example, we'll choose Pose Modifiers -> Blend Space 1D
.
A Blend Space 1D node is one of the primary ways blend graphs can modify animations. As its name implies, it blends between the two inputs it's given and outputs the result. The Value Input determines the ratio of the blend (0.0 being all Pose 1 and 1.0 being all Pose 2).
Now that you know how to connect and create nodes, go ahead and connect the Blend Space 1D's Output Pose to the Actor's Input Pose. Then, we'll create two more nodes connected to the Blend Space 1D. First, create a Pose Creators -> Base Game Pose
connected to Pose 2, then create a Value Creators -> Fixed Value
connected to Value Input. Then, on the newly created Fixed Value node, set the Value to 0.5
This blend graph will now constantly produce a 50/50 mix between the Full Animation and the Base Game's animation state (walking, running, shooting, etc.) This is more than what a standard animation can do, but it's still not very dynamic. Next we'll cover Variables, which will allow your blend graphs to become much more active.
To start, select the Fixed Value node we created earlier and press the Delete
key on your keyboard to get rid of it. Then, click and drag on the Blend Space 1D's Value Input to create a new Value Creators -> Variable
. For this example, we'll set the Variable's "Name" to ratio, and set its Default Value to 0.5
Now this will produce a 50/50 mix, same as before, but the ratio of the mix can be changed at any time via the console or Papyrus (Starfield's scripting language). Important: Every Variable node within a single blend graph must have a unique name. If there are Variable nodes with the same name, you will only be able to change the value of one of them.
Now that you have the basics down pat, feel free to explore all of the other node types available within the Blend Graph Editor. There are just a few other important bullet points to know before jumping in:
- While the Blend Graph Editor can edit any blend graph, NAF will only load a blend graph in-game if all nodes are fully connected. This means all node inputs must be connected to something, unless the input is marked as
(Optional)
. - All blend graphs must have exactly one Actor node. If there is more than one or less than one, NAF will not load it.
- Try not to exceed more than 5 Full Animation nodes within a single blend graph. Full Animation nodes are relatively heavy on RAM and CPU usage compared to other nodes. If you want to blend in a non-moving pose, it's highly recommended to use a Static Pose node for that instead.
Plays the animation stored in <File>
. The path starts from the folder the blend graph is in. i.e. if your blend graph is in Starfield/Data/NAF/MyUsername/
, and your animation is at Starfield/Data/NAF/MyUsername/CustomAnim.glb
you would just put CustomAnim.glb
The <Sync ID>
is used when multiple actors are synchronized using NAF's sync command or the SyncAnimations
function. For example, if a Full Animation in one graph has a <Sync ID>
of 2, and a Full Animation in another graph has a <Sync ID>
of 2, those two animations will have their times synchronized when NAF's sync command/SyncAnimations
function is used.
<Speed Modifier (Optional)>
allows you to modify the playback speed of this animation. A value of 0.0 would be normal speed, 1.0 would be double speed, -1.0 would pause the animation, and values less than -1.0 would play it in reverse.
Generates a random value between 0.0 and 1.0 every <Delay>
seconds, smoothly transitioning from one value to the next over <Smooth Duration>
seconds. The new value is always within <Differential>
of the old value.
It will try to keep the value away from the edges (0.0 and 1.0) to avoid getting stuck at one end. The <Edge Threshold>
determines how "bouncy" the edges are. A high <Edge Threshold>
will push the value away from the edges more aggressively.
The <Sync ID>
is used when multiple actors are synchronized using NAF's sync command or the SyncAnimations
function. For example, if a Smoothed Random Value in one graph has a <Sync ID>
of 2, and a Smoothed Random Value in another graph has a <Sync ID>
of 2, those two will have their output values synchronized when NAF's sync command/SyncAnimations
function is used.
Note: <Delay>
and <Smooth Duration>
do not overlap. The <Delay>
will only start once <Smooth Duration>
has finished.
Blends together <Pose 1>
and <Pose 2>
, using <Value Input>
to determine the ratio of the blend. A ratio of 0.0 would only output <Pose 1>
, while a ratio of 1.0 would only output <Pose 2>
.
Blends <Additive Pose>
into <Full Pose>
additively, using <Value Input>
to determine the strength of the blend. A strength of 0.0 would only output <Full Pose>
, while a strength of 1.0 would output <Additive Pose>
added completely to <Full Pose>
.
An additive pose comes from an animation that was exported from Blender with the "Additive Animation" option enabled. Additive animations are relative to the skeleton rest pose, and only work properly when blended in using an Additive Blend node.
i.e. if you have a T-Pose and move the head forward slightly and export that as an Additive Animation, if you then additively blend that into any full pose with a strength of 1.0, the head will be moved forward that same amount.
This is useful for adding variety to an animation without having to edit the base animation itself.
Always outputs <Value>
.
This is a special node that allows you to change values in your Blend Graph from in-game Papyrus scripts. By default, this will output the <Default Value>
until modified by a Papyrus script. <Name>
is case-insensitive, and has to be unique (two Variable nodes in the same graph cannot have the same <Name>
, or else they won't work properly.)
The <Name>
also doubles as this node's <Sync ID>
. It will automatically sync to Variable nodes with the same name on other actors when using the sync command or SyncAnimations
function.
Limits the rate-of-change of <Value Input>
using <Rate-of-Change/s>
. i.e. if <Value Input>
is at 10, then changes to 100, and <Rate-of-Change/s>
is set to 30, this node's <Value Output>
will smoothly transition from 10 to 100 over 3 seconds.
Transforms the range of <Value Input>
from <Old Min>
- <Old Max>
to <New Min>
- <New Max>
. i.e. if <Value Input>
is 0.5, <Old Min>
is 0, <Old Max>
is 1, <New Min>
is 0, and <New Max>
is 100, then <Value Output>
will be 50.
<Value Output>
is clamped, so the result will never be smaller than <New Min>
or larger than <New Max>
This is what you should connect your final result to. The <Input Pose>
given to this node will be outputted to the actor. Every blend graph must have exactly one Actor node.