View on GitHub

ezEngine Documentation

The documentation for ezEngine

Mix Clips 2D Node

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.

This node can generally be used to combine animations that can be thought of as having a position on a 2D plane. For example if you have animations for aiming forwards, to the left, right, up and down, you can use the mix 2D node to generate any pose in between.

Be aware that the poses will be combined linearly, though. If the poses from two clips are too different, the result may not look very good. In this case it is best to create additional clips with in-between poses.

How To Use

You add multiple animation clips and give each clip a position (X and Y). As with the mix clips 1D node, 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, 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.

Properties

See common properties.

Input Pins

See common input pins.

Output Pins

See common output pins.

See Also