UE advanced motion system (ALSv4) deconstruction (02) advanced knowledge

1. Animation notification

There are two kinds of notifications, Notify and Notify State , which are similar to Trigger and Repeater of UI animation. Notify is sent in an instant, while Notify State lasts for a while.
At the same time, Notify can be divided into three implementation methods: Skeleton Notify, AnimNotify, and native methods.
(1) Skeleton Notify is a pure event that can be obtained in the animation blueprint.

insert image description here

insert image description here

Note: Skeleton Notify is special and cannot be reused . It is only for this kind of animation blueprint, and different animation blueprints cannot be shared.

(2) Create the AnimNotify blueprint class, write the logic by overloading the method, and this way can achieve the purpose of reuse.

insert image description here

insert image description here

insert image description here

2. Root Movement

The root motion refers to animation to control the motion of the character skeleton. Even if the normal motion rolls forward, the root node of the skeleton is always in place . Root motion can be turned on in animation properties.

insert image description here

Note: Root motion is generally only used when playing montages.

3. State machine and transition rules

The state machine is used to control under what conditions, what state the character should enter, and what animation to play.

insert image description here

insert image description here

Transition rules are the conditions that control the execution of the state machine . There are multiple attributes that we can set, and we will introduce them in turn.

(1) Transition column

insert image description here

Blend Logic : Standard Blend (when the transition rule is reached, the state of the transition rule is entered after a state is played), Inertialization (inertialization, you need to add an Inertialization node in the animation blueprint, you can transition directly, without waiting for the previous one to finish playing).

insert image description here

Transition Rule Sharing : You can click Promote To Shared to create a share, and the rule will turn orange at the same time. Other transition rules can be set for this share, and the settings can be consistent without resetting.

Automatic Rule Based on Sequence Player in State : After checking, the next state will be automatically played after the state is played, which is equivalent to the logic in the figure below.

insert image description here

(2) Blend Settings column

insert image description here

Duration : The switching time, if it is not 0, the animation of the two states will be mixed.
Mode : During the transition, the transition function used is directly calculated by the CPU.
Custom Blend Curve : Same as Mode, you need to select Custom in the Mode column to use this curve. When transitioning, use the custom curve and use the memory to read the curve.
Blend Profile : Blending configuration, we can configure the blending weight of each bone, we can configure this item in the skeleton interface.
Transition Crossfade Sharing : Sharing, but the Blend Profile item cannot be set synchronously.

insert image description here
Note: The bone weight value in the above picture cannot be 0, because the calculation of the source code is that 1/权重值if it is 0, it will crash.

(3) Notifications column

insert image description here
The event in Notifications, like the bone notification in animation, is essentially an event. We fill in the custom event name, and we can call the event in the animation blueprint.

insert image description here

insert image description here

Note: To use this custom notification event, the state machine containing the event must be connected, otherwise there will be no such event.

4. Pipeline

A pipeline is a special state that does not require time to execute and only contains a judgment condition.

insert image description here

insert image description here

The role of the pipeline is to add one more judgment, which can carry out secondary control of the state.

5. Save the pose

Saving a pose is equivalent to caching the pose. First save the state pose, and then modify different attributes in different state machines to achieve the effect of saving the original pose . Use New Save cached pose…to save the pose, and use Use cached pose “XXX”to extract the saved pose.

insert image description here

6. Animation layer and animation interface

(1) Animation layer
The animation layer is similar to the functions in the animation, which can greatly simplify the logic and improve the encapsulation.

insert image description here

Use Linked Anim Layer: XXXto use animation layers you create yourself.

insert image description here

(2) Animation layer interface
The animation layer interface is similar to the function interface.

insert image description here

We can find the animation layer interface we created in the settings of the animation blueprint.

insert image description here

Functions in the interface appear automatically after adding.

insert image description here

(3) The associated use of different implementations of the animation layer interface
is due to the interface. If two animation blueprint classes inherit from the same animation layer interface, but their respective animation layer implementations are different, we can use the character Mesh to switch between the different implementations of the animation layer of the animation blueprint class Link Anim Class Layers.

insert image description here

Note: The animation layer can be used to process the interaction logic, instead of writing two sets of logic, in different animation blueprints, use different animation layer interface implementations, just switch animation blueprints directly.

7. Animation Modifier

insert image description here

There are two overloaded functions in the animation modifier, on resume and on apply.

insert image description here

The animation modifier is used as follows

insert image description here

insert image description here

Note: The animation modifier is equivalent to an Editor Utility, just to help you modify the curves, bone positions and other things in the edited animation.

8. Camera Shake

Client Start Camera ShakeWe choose to use functions and MatineeCameraShakeblueprint classes to achieve camera vibration .

insert image description here

insert image description here

Call this method by creating an animation notification class (AnimNotify) , and configure the created MatineeCameraShake class to use camera shake in the running animation.

insert image description here

Guess you like

Origin blog.csdn.net/qq_45617648/article/details/131112362