UE5 - animation redirection

1. What is an animation system

You can take a look at this historical article "The Development of Animation System" and you can get a general understanding of what an animation system is and how it works in computer animation.

Here is a general summary:
1. Static model (Mesh) : a data set composed of a series of vertex (coordinate) information, which can be simply understood as human skin if it is compared to a human being.
insert image description here
2. Skeleton animation :
How to make an animation move, in fact It is to control some points in the static model to move according to a certain predetermined trajectory, but in fact this is unrealistic, because there are tens of thousands of vertices in a model, and it is inconvenient and unscientific to manually set the trajectory of each vertex. The science is reflected in the fact that an animation is different in various parts of the human body.
For this reason, skeletal animation was born. The vertex "attached" to the bone is driven by the bone. As long as the bone moves according to certain rules, the vertex attached to the bone will also move accordingly.
insert image description here

2. Animation Redirection

1. The principle of redirection

Animation Retargeting : is a feature that allows animation to be reused between characters that share the same skeletal asset but have widely different scales. (In fact, as long as the overall skeleton resources are similar, you can use redirection, which will be mentioned later)

Retargeting prevents an animated skeleton from losing scale or deforming unnecessarily when using animations from characters of different shapes. Animation retargeting also makes it possible to share animation between characters using different skeleton assets , provided they use similar bone hierarchies , and use a shared asset called an IK Rig to pass animation data between skeletons.

The following can finally be realized as follows, the two skeleton resources are similar, and the characters with different shapes can achieve the same action
Please add a picture description

2. Why use redirection

Let's say you have multiple characters at this point and want to share animations between the base character, the short and thick character, and the tall and thin character.
insert image description here
Before implementing redirection, if you use the animation of the basic character to play these three characters, you will see the following results, which obviously do not meet expectations
insert image description here

After implementing the redirection, we can see that all three characters are animating as we expected
insert image description here

Most of the above two points are taken from: UE5 animation relocation

3. Skeleton chain

Bone chain : a bone with ik relationship, from the start point to the end point, there is only one pointing bone, that is, there can be no forks! !

The figure below is an example. The human limbs in the figure below are four bone chains. The bones of the human body must be more complicated than the one below.
insert image description here

4、FK和IK

In the animation design software, the kinematics system is divided into two types: forward kinematics FK (Forward Kinematics) and inverse kinematics IK (Inverse Kinematics).

Forward kinematics (FK): For objects with a hierarchical relationship, the action of the parent object will affect the child object, while the action of the child object will not have any impact on the parent object. When the parent object is moved, the child object will also move with it. When the child object moves, the parent object does not move. It can be seen that the action in the forward motion is transmitted from top to bottom. For example arm animation, big arm moves or rotates, forearm and hand move or rotate with it, forearm moves or rotates, hand moves or rotates with it.

Inverse kinematics (IK): Action transmission is bidirectional. When the parent object performs actions such as displacement, rotation, or scaling, its child objects will be affected by these actions. Conversely, the actions of the child object will also affect the parent object. For example, to move a hand over a doorknob, other joints in the arm will also rotate to accommodate the new position of the hand.

3. How to implement animation redirection in UE5

1. Redirection of UE4

The redirection of UE4 is directly integrated into the skeleton editor, and the "redirection source binding" can be performed directly in the skeleton editor through the "redirection manager" .

Redirection source binding: Bind the bone with the redirection source , where the redirection source is the mapping of a set of set model bones, the same data calculation can be performed on the bone nodes mapped to the same source, so that one An action of a character generates a corresponding action of another character.

The above redirection source binding needs to be bound separately under the bones of two different models, namely the source model bone and the target model bone to generate animation

In the above binding, the redirection source we use is the Humanoid binding that comes with UE4 . You can see the selection binding in the figure below, and then bind the "source" to the target. If the redirection source is We are not satisfied, but we can recreate a set of redirection sources through the UE plug-in
Please add a picture description
. After completing the binding of the two bones, we can select one of them as the source target, select its animation, and right-click to generate the animation, as follows Figure
insert image description here
Click the redirection below to generate the corresponding animation
Please add a picture description

The result is as follows: This is the animation exported to the white model from the animation of the Valkyrie
Please add a picture description

2. Two resources (IK binding, IK redirector)

Compared with UE4's redirection, UE5's animation redirection adds two kinds of resource IK binding and IK redirector:
insert image description here

① IK binding

Please add a picture description

IK binding is also the redirection source binding in UE4 , which is to bind the skeleton to the redirection source, but unlike UE4, which needs to set a set of redirection sources, UE5 requires us to manually set the name of each redirection source And the "skeletal chain" mapped to it (to be mentioned later ) is shown in the lower right corner of the above figure. Compared with UE4, its degree of freedom is higher, but it is relatively more complicated

②IK Redirector

Please add a picture description

The IK redirector is a new resource in UE5, which is used to adjust the two redirected resources and try to watch! (Huge improvement!!) One big difference! ! !
When UE5 is redirecting, there are actually two sets of redirection sources , and then through the animation redirection of these two sets of redirection sources!
We can see that in the lower right corner of the above picture, the target chain and source chain in it correspond to the chains set in the two sets of IK bindings we selected in the details window!

3. How to set up the skeleton chain

Please add a picture description

We can select an entire chain in the IK binding and operate as shown above to generate the bone chain, or we can directly create a new bone chain in the lower right corner (no need to set a set of sources in advance! In fact, it is quite convenient of)

4. How to generate new animation through IK redirector export

![Please add a picture description](https://img-blog.csdnimg.cn/089d6cf0969341679b8b5282fb6614f9.jpeg Please add a picture description
As shown in the above picture, select the animation we want to export in the IK redirector, click the above to export selected animation , and you can export
Please add a picture description

Four, digression

Are you familiar with the bone chain below, it is quite interesting to apply it to the game!
Skeletal chain against the cold water

Guess you like

Origin blog.csdn.net/weixin_40301728/article/details/127503414