Module machine

Module machine 

Source
Expand description

Animation blending state machine.

Machine is used to blend multiple animation as well as perform automatic “smooth transition between states. See Machine docs for more info and examples.

Modules§

event
State machine could produces a fixed set of events during its work, this module contains all the stuff needed to works with such events.
layer
Layer is a separate state graph that usually animates only a part of nodes from animations. See docs of MachineLayer for more info.
mask
Layer mask is a sort of blacklist that prevents layer from animating certain nodes. See LayerMask docs for more info.
node
Node is a part of animation blending tree, that backs a state with animation data. See PoseNode docs for more info.
parameter
Parameter is a name variable of a fixed type. See Parameter docs for more info.
state
State is a final “container” for animation pose. See State docs for more info.
transition
Transition is a connection between two states with a rule that defines possibility of actual transition with blending.

Structs§

BlendAnimations
Animation blend node. It takes multiple input poses and mixes them together into single pose with specified weights. Could be used to mix hit and run animations for example - once your character got hit, you set some significant weight for hit animation (0.8 for example) and lower weight for run animation (0.2) and it will look like your character got wounded while it still running (probably you should decrease speed here too). Weights can be parametrized, which means that you can dynamically change them in runtime. In our example we can decrease weight of hit animation over time and increase weight of run animation, so character will recover from his wounds.
BlendAnimationsByIndex
A node that switches between given animations using index and smoothly blends from one animation to another while switching. It is very useful for situations when you need to switch between different animations. For example you could have an aim state, it is suitable for any weapon (you don’t need to create a ton of states like aim_rifle, aim_pistol, etc), but actual weapon holding animation should be different based on actual weapon a character is holding. In this case you create a BlendAnimationsByIndex node, add a few inputs where each input uses different weapon holding animation and in your game all you need to do is to set an index parameter in the machine parameters. The node will automatically perform smooth transition between different animations.
BlendPose
Weighted proxy for animation pose. It has an input pose source and a weight, that tells in which proportion the pose should be blended into final pose.
IndexedBlendInput
An animation pose with specific blend time. Blend time tells the engine how many time it should use to perform blending to this pose.
LayerMask
Layer mask is a sort of blacklist that prevents layer from animating certain nodes. Its main use case is to disable animation on animation layers for specific body parts of humanoid (but not only) characters. The mask holds handles of nodes that will not be animated.
Machine
Animation blending state machine is used to blend multiple animation as well as perform automatic smooth transitions between states.
MachineLayer
Layer is a separate state graph. Layers mainly used to animate different parts of humanoid (but not only) characters. For example there could a layer for upper body and a layer for lower body. Upper body layer could contain animations for aiming, melee attacks while lower body layer could contain animations for standing, running, crouching, etc. This gives you an ability to have running character that could aim or melee attack, or crouching and aiming, and so on with any combination. Both layers use the same set of parameters, so a change in a parameter will affect all layers that use it.
ParameterContainer
A container for all parameters used by a state machine. Parameters are shared across multiple animation layers.
PlayAnimation
A simplest pose node that extracts pose from a specific animation and prepares it for further use. Animation handle should point to an animation in some animation container see AnimationContainer docs for more info.
State
State is a final “container” for animation pose. It has backing pose node which provides a set of values. States can be connected with each other using transitions, states with transitions form a state graph.
Transition
Transition is a connection between two states with a rule that defines possibility of actual transition with blending.

Enums§

Event
Specific state machine event.
Parameter
Machine parameter is a named variable of a fixed type. Machine uses various parameters for specific actions. For example Rule parameter is used to check where transition from a state to state is possible, Weight parameters are used to be a source real numbers that are used to calculate blend weights, etc.
PoseNode
Specialized node that provides animation pose. See documentation for each variant.
PoseWeight
Specific animation pose weight.

Traits§

AnimationPoseSource
A trait that responsible for animation pose evaluation.