Skip to content

Commit

Permalink
Anim graph rename and TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
jankrassnigg committed Nov 5, 2023
1 parent 405a283 commit 3c3397b
Show file tree
Hide file tree
Showing 27 changed files with 204 additions and 197 deletions.
2 changes: 1 addition & 1 deletion pages/docs/Miscellaneous/global-blackboard-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ By adding a global blackboard component to a scene or prefab, you can ensure tha
* [Blackboards](blackboards.md)
* [Blackboard Template Asset](blackboard-template-asset.md)
* [Local Blackboard Component](local-blackboard-component.md)
* [Animation Controller](../animation/skeletal-animation/animation-controller/animation-controller-overview.md)
* [Animation Graph (TODO)](../animation/skeletal-animation/animation-controller/animation-graph-overview.md)
4 changes: 2 additions & 2 deletions pages/docs/Miscellaneous/local-blackboard-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The *local blackboard component* contains a [blackboard](blackboards.md). The co

If a system requires a blackboard, it will typically search for a blackboard component by traversing its own object structure upwards (in C++ you can use `ezBlackboardComponent::FindBlackboard()` to do so).

For example the [animation controller](../animation/skeletal-animation/animation-controller/animation-controller-overview.md) is controlled by modifying blackboard entries, which the controller reads. You can modify the entries through [custom code](../custom-code/custom-code-overview.md). For this, the blackboard component has to be attached either to the same object, or a parent object.
For example the [animation graph (TODO)](../animation/skeletal-animation/animation-controller/animation-graph-overview.md) is controlled by modifying blackboard entries, which the controller reads. You can modify the entries through [custom code](../custom-code/custom-code-overview.md). For this, the blackboard component has to be attached either to the same object, or a parent object.

## Component Properties

Expand All @@ -23,4 +23,4 @@ For example the [animation controller](../animation/skeletal-animation/animation
* [Blackboards](blackboards.md)
* [Blackboard Template Asset](blackboard-template-asset.md)
* [Global Blackboard Component](global-blackboard-component.md)
* [Animation Controller](../animation/skeletal-animation/animation-controller/animation-controller-overview.md)
* [Animation Graph (TODO)](../animation/skeletal-animation/animation-controller/animation-graph-overview.md)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The *animation clip asset* is used to import a single animation for an [animated

<video src="../media/anim-clip.webm" width="800" height="600" autoplay loop></video>

An animation clip represents a single motion, such as a walk cycle, a jump or other action. Simple animations can be played on a mesh using a [simple animation component](simple-animation-component.md). For complex behavior you will need to use multiple clips and fade from one to the other at the right times. Use an [animation controller](animation-controller/animation-controller-overview.md) for that.
An animation clip represents a single motion, such as a walk cycle, a jump or other action. Simple animations can be played on a mesh using a [simple animation component](simple-animation-component.md). For complex behavior you will need to use multiple clips and fade from one to the other at the right times. Use an [animation graph (TODO)](animation-controller/animation-graph-overview.md) for that.

## Asset Properties

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Blackboard Nodes

<!-- PAGE IS TODO -->
<!-- TODO THIS PAGE IS OUTDATED -->

The animation controller provides nodes to read and write values from and to a [blackboard](../../../Miscellaneous/blackboards.md). For this, the [game object](../../../runtime/world/game-objects.md) on which the [animation controller component](animation-controller-component.md) is attached, also needs to hold a blackboard component.

> **Note:**
Expand Down Expand Up @@ -55,5 +58,5 @@ This node outputs the value of a specific blackboard entry. The number value can

## See Also

* [Animation Controller](animation-controller-overview.md)
* [Animation Graph (TODO)](animation-graph-overview.md)
* [Skeletal Animations](../skeletal-animation-overview.md)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Bone Weight Nodes

<!-- PAGE IS TODO -->
<!-- TODO THIS PAGE IS OUTDATED -->

Bone weight nodes are used to generate a weight mask. The mask defines how strongly an animation clip will influence different parts of the skeleton. This is frequently used to apply an animation only to certain parts of a character, for example only the upper or lower body, or even only the left or right arm.

For example it is common to play a walking animation only on the bones below the hip, whereas on the spine and upwards one would want to play an attack animation.
Expand All @@ -12,7 +15,7 @@ Bone weights are often in the range of zero to one, with zero meaning that that
>
> Not all animations will work correctly when they are layered on top of each other. If one animation rotates a bone into one direction, and another animation rotates the same bone very differently, it is possible for the interpolation of the rotations to result in an invalid value. This will manifest as jerking or jumping bones at specific points in the animation. If that happens, you have to use an inverse bone mask to fully filter out the base animation, such that in the end only one of the animations really influences those bones.
Bone weights are typically connected directly to an animation clip sampling node, and the information that this animation clip shall only influence a part of the skeleton is passed along until it reaches a [combine poses node](anim-nodes-combine-poses.md) where the result is baked into one pose. Without such a node in the graph, the bone weights won't have an effect.
Bone weights are typically connected directly to an animation clip sampling node, and the information that this animation clip shall only influence a part of the skeleton is passed along until it reaches a [combine poses node (TODO)](anim-nodes-combine-poses.md) where the result is baked into one pose. Without such a node in the graph, the bone weights won't have an effect.

## Bone Weight Config Node

Expand All @@ -30,9 +33,7 @@ This node creates a mask for every bone in the skeleton. By default, the mask is

* **InverseWeights**: If this pin is connected, the node generates the inverse mask as well. So for example, if the node would generate a mask that only affects the head, then the inverse mask will affect everything but the head.


## See Also


* [Animation Controller](animation-controller-overview.md)
* [Animation Graph (TODO)](animation-graph-overview.md)
* [Skeletal Animations](../skeletal-animation-overview.md)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Combine Poses Nodes

<!-- PAGE IS TODO -->
<!-- TODO THIS PAGE IS OUTDATED -->

An animation controller typically samples more than one animation. For example you may want to play a walking animation on the lower part of a character, and an aim weapon animation on the upper part. These animations are generally independent of each other, but have to be combined at some point, to form the final single animation pose.

Certain nodes in the animation controller graph allow you to accomplish this.
Expand All @@ -18,21 +21,20 @@ This is used to clamp the maximum performance cost of the animation blending.

### Input Pins

* **LocalPoses**: This is a single input pin that allows an unlimited number of connections. Each incoming pose carries not only the bone transformations, but also the *bone weights*. These are typically determined by the animation clip sampling nodes and the [bone weight nodes](anim-nodes-bone-weights.md). All poses are mixed together according to their overall weight.
* **LocalPoses**: This is a single input pin that allows an unlimited number of connections. Each incoming pose carries not only the bone transformations, but also the *bone weights*. These are typically determined by the animation clip sampling nodes and the [bone weight nodes (TODO)](anim-nodes-bone-weights.md). All poses are mixed together according to their overall weight.

In practice that means that two animations that don't use custom [bone weights](anim-nodes-bone-weights.md) will be blended 50:50.
In practice that means that two animations that don't use custom [bone weights (TODO)](anim-nodes-bone-weights.md) will be blended 50:50.

### Output Pins

* **LocalPose**: The single combined pose in *local space*. It is common to pass this directly on to a [Local To Model Pose node](anim-nodes-modelspace.md).
* **LocalPose**: The single combined pose in *local space*. It is common to pass this directly on to a Local To Model Pose node.

### Performance Considerations

You can use multiple nodes to combine many poses in several steps. However, for best performance prefer to use only a single node to combine many poses and make use of [bone weights](anim-nodes-bone-weights.md) to control each ones overall influence.
You can use multiple nodes to combine many poses in several steps. However, for best performance prefer to use only a single node to combine many poses and make use of [bone weights (TODO)](anim-nodes-bone-weights.md) to control each ones overall influence.


## See Also


* [Animation Controller](animation-controller-overview.md)
* [Animation Graph (TODO)](animation-graph-overview.md)
* [Skeletal Animations](../skeletal-animation-overview.md)
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# Debug Nodes

These animation controller nodes can be used to find problems.
These animation graph nodes are used to find problems.

## Log Node
## Log Nodes

The *log node* simply prints a *dev* string to the [log](../../../debugging/logging.md) whenever it gets activated.
The `Log Info` and `Log Error` nodes print a string to the [log](../../../debugging/logging.md) whenever they get activated.

### Node Properties

* `Text`: The text to print. This may include placeholders for the input values. Use `{0}` to `{3}` to embed the values from `Input0` to `Input3` respectively.
* `Text`: The text to print. This may include placeholders for the input values. Use `{0}`, `{1}`, `{2}`, etc to embed the value from the respective `In Numbers[]` pin.

* `Number Count`: Specifies how many number input pins the node should have.

### Input Pins

* `Active`: Every frame in which this pin is triggered, the node will log `Text` as a *Dev* message to the [log](../../../debugging/logging.md).
* `In Activate`: Every frame in which this pin gets triggered, the node will log `Text` to the [log](../../../debugging/logging.md).

* `Input0` to `Input3`: These pins allow you to pass in values that can be printed to the log.
* `In Numbers[]`: These pins allow you to pass in number values for embedding in the output text.

## See Also


* [Animation Controller](animation-controller-overview.md)
* [Animation Graph (TODO)](animation-graph-overview.md)
* [Skeletal Animations](../skeletal-animation-overview.md)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Event Nodes

<!-- PAGE IS TODO -->
<!-- TODO THIS PAGE IS OUTDATED -->

Event nodes are used to broadcast [event messages](../../../runtime/world/world-messaging.md#event-messages) on the [game object](../../../runtime/world/game-objects.md) on which the animation controller is running. This allows other code to react at the right moment to things like an animation being finished.

Event nodes allow you to broadcast custom events under exactly defined conditions. Additionally, every time an [animation clip](../animation-clip-asset.md) is played, and actively contributes to the final pose, events that are defined on that clip will automatically be broadcast on the associated game object.
Expand All @@ -20,6 +23,5 @@ When this node is triggered, it broadcasts an `ezMsgGenericEvent` with `Message`

## See Also


* [Animation Controller](animation-controller-overview.md)
* [Animation Graph (TODO)](animation-graph-overview.md)
* [Skeletal Animations](../skeletal-animation-overview.md)
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Input Nodes

<!-- PAGE IS TODO -->
<!-- TODO THIS PAGE IS OUTDATED -->

Input nodes expose the state of input devices to the animation controller. Input nodes are mainly provided for convenience during prototyping, as they may circumvent key mappings and general game state (e.g. whether the player is even allowed to move a character at all, at the moment).

For a proper game, it is better to use an [input component](../../../input/input-component.md) to forward input state to [custom code](../../../custom-code/custom-code-overview.md) and then decide their which animation shall get played. Then you can forward that state to the animation controller, through a [blackboard](../../../Miscellaneous/blackboards.md). The animation controller itself would retrieve what it shall do through the [blackboard nodes](anim-nodes-blackboard.md).
For a proper game, it is better to use an [input component](../../../input/input-component.md) to forward input state to [custom code](../../../custom-code/custom-code-overview.md) and then decide their which animation shall get played. Then you can forward that state to the animation controller, through a [blackboard](../../../Miscellaneous/blackboards.md). The animation controller itself would retrieve what it shall do through the [blackboard nodes (TODO)](anim-nodes-blackboard.md).

## XBox Controller Input Node

Expand All @@ -12,10 +15,9 @@ This node completely ignores any kind of button mapping. It is purely meant for

### Output Pins

* This node has one output pin for every button and stick direction. If you need to turn an analog signal into a trigger value, use the [Compare Number node](anim-nodes-logic-math.md).
* This node has one output pin for every button and stick direction. If you need to turn an analog signal into a trigger value, use the [Compare Number node (TODO)](anim-nodes-logic-math.md).

## See Also


* [Animation Controller](animation-controller-overview.md)
* [Animation Graph (TODO)](animation-graph-overview.md)
* [Skeletal Animations](../skeletal-animation-overview.md)
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Logic and Math Nodes

The animation controller provides a couple of nodes to evaluate basic arithmatic and logic. This is meant for very simple use cases and for quick prototyping. Often animation logic requires much more complex rules than what would be feasible to express in the animation controller graph. Instead use [custom code](../../../custom-code/custom-code-overview.md) to decide which animation should run under which circumstances, and pass the result to the animation controller via a [blackboard](../../../Miscellaneous/blackboards.md). The animation controller can then simply read the state for each animation using the [blackboard nodes](anim-nodes-blackboard.md).
<!-- PAGE IS TODO -->
<!-- TODO THIS PAGE IS OUTDATED -->

The animation controller provides a couple of nodes to evaluate basic arithmatic and logic. This is meant for very simple use cases and for quick prototyping. Often animation logic requires much more complex rules than what would be feasible to express in the animation controller graph. Instead use [custom code](../../../custom-code/custom-code-overview.md) to decide which animation should run under which circumstances, and pass the result to the animation controller via a [blackboard](../../../Miscellaneous/blackboards.md). The animation controller can then simply read the state for each animation using the [blackboard nodes (TODO)](anim-nodes-blackboard.md).

## Logic AND Node

Expand Down Expand Up @@ -73,6 +76,5 @@ The expression must be syntactically correct, otherwise the node prints an error

## See Also


* [Animation Controller](animation-controller-overview.md)
* [Animation Graph (TODO)](animation-graph-overview.md)
* [Skeletal Animations](../skeletal-animation-overview.md)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Mix Clips 1D Node

<!-- PAGE IS TODO -->
<!-- TODO THIS PAGE IS OUTDATED -->

The *Mix Clips 1D* animation controller node is used to linearly interpolate between a fixed set of animations.

<video src="../../media/anim-mix1d.webm" width="500" height="500" autoplay loop></video>
Expand Down Expand Up @@ -34,8 +37,7 @@ See [common output pins](anim-nodes-playclip.md#common-output-pins).

## See Also


* [Animation Controller](animation-controller-overview.md)
* [Animation Graph (TODO)](animation-graph-overview.md)
* [Skeletal Animations](../skeletal-animation-overview.md)
* [Mix Clips 2D Node](anim-nodes-mix2d.md)
* [Play Single Clip Nodes](anim-nodes-playclip.md)
* [Mix Clips 2D Node (TODO)](anim-nodes-mix2d.md)
* [Play Single Clip Nodes (TODO)](anim-nodes-playclip.md)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Mix Clips 2D Node

<!-- PAGE IS TODO -->
<!-- TODO THIS PAGE IS OUTDATED -->

The *Mix Clips 2D* animation controller node is used to interpolate between a set of animations which are positioned in 2D space. You give it a 2D coordinate, and it will determine which animation clips are relevant and mix them together with proper weights depending on how close the coordinate is to each clip.

The purpose of this node is to generate a continuous animation space from just a few discrete clips. This is often used for locomotion, where you only have animation clips for walking into a fixed number of directions and at certain speeds, but you'd like to be able to move a character into any direction and at any speed in between.
Expand All @@ -12,11 +15,11 @@ Be aware that the poses will be combined linearly, though. If the poses from two

## How To Use

You add multiple animation clips and give each clip a position (`X` and `Y`). As with the [mix clips 1D node](anim-nodes-mix1d.md), the playback of all clips is synchronized, meaning that the length of each clip may differ, but they will be played back such that they start and end in unison. That means your clips must be authored accordingly, so for example for locomotion all clips should start with the left foot forwards, then move the right foot forwards, then the left again. From that point on the clips will be looped.
You add multiple animation clips and give each clip a position (`X` and `Y`). As with the [mix clips 1D node (TODO)](anim-nodes-mix1d.md), the playback of all clips is synchronized, meaning that the length of each clip may differ, but they will be played back such that they start and end in unison. That means your clips must be authored accordingly, so for example for locomotion all clips should start with the left foot forwards, then move the right foot forwards, then the left again. From that point on the clips will be looped.

What the coordinates represent is up to you. For locomotion you could say that `X` represents left/right movement and `Y` forwards/backwards. You would then position a *walk left* clip at `(-1, 0)` a *walk right* clip at `(+1, 0)` a *walk forward* clip at `(0, +1)` and a *run forward* clip at `(0, +2)`.

Through the `X` and `Y` input pins you provide a 2D coordinate. During testing you may hook this up directly to an [input node](anim-nodes-input.md), though later you'll probably need more control.
Through the `X` and `Y` input pins you provide a 2D coordinate. During testing you may hook this up directly to an [input node (TODO)](anim-nodes-input.md), though later you'll probably need more control.

The node will then take that input coordinate to decide which clips should be used with what influence, and mix them together to a single output pose.

Expand All @@ -42,8 +45,7 @@ See [common output pins](anim-nodes-playclip.md#common-output-pins).

## See Also


* [Animation Controller](animation-controller-overview.md)
* [Animation Graph (TODO)](animation-graph-overview.md)
* [Skeletal Animations](../skeletal-animation-overview.md)
* [Mix Clips 1D Node](anim-nodes-mix1d.md)
* [Play Single Clip Nodes](anim-nodes-playclip.md)
* [Mix Clips 1D Node (TODO)](anim-nodes-mix1d.md)
* [Play Single Clip Nodes (TODO)](anim-nodes-playclip.md)
Loading

0 comments on commit 3c3397b

Please sign in to comment.