[UE4]Animation Blending Notes
keywords:UE4、Animation Blending Nodes、Examples
Offical Docs
Blend Nodes
Specifications of Animation Blend Nodes:Blend Nodes
https://docs.unrealengine.com/en-us/Engine/Animation/NodeReference/Blend
Examples
Layered blend per bone (upper body blending)
Reference of Animation Blending Example:
EpicSurvivalGameSeries\SurvivalGame\Content\AnimStarterPack\Player_AnimBP
Logic achieved in this Blueprint: Rotate Aiming direction to the camera view direction
Site: https://github.com/tomlooman/EpicSurvivalGameSeries
APIs in Common
Blend Option
AlphaBlend.h
UENUM()
enum class EAlphaBlendOption : uint8
{
// Linear interpolation
Linear = 0,
// Cubic-in interpolation
Cubic,
// Hermite-Cubic
HermiteCubic,
// Sinusoidal interpolation
Sinusoidal,
// Quadratic in-out interpolation
QuadraticInOut,
// Cubic in-out interpolation
CubicInOut,
// Quartic in-out interpolation
QuarticInOut,
// Quintic in-out interpolation
QuinticInOut,
// Circular-in interpolation
CircularIn,
// Circular-out interpolation
CircularOut,
// Circular in-out interpolation
CircularInOut,
// Exponential-in interpolation
ExpIn,
// Exponential-Out interpolation
ExpOut,
// Exponential in-out interpolation
ExpInOut,
// Custom interpolation, will use custom curve inside an FAlphaBlend or linear if none has been set
Custom,
};
Explanation:
- ExpOut: Speed down first then speed up when playing animation.
- ExpIn: Speed up first then speed down when playing animation.
Animation Blend Modes
https://docs.unrealengine.com/en-us/Engine/Animation/NonLinearBlends
Usages
How to switch Animation Rotate Space when Montage Blending
Issue:
If want to blend shooting animation when character is moving, by default the shoot animation would rotate using the Space of moving animation(blend using DefaultSlot
), but it may cause the shooting animation(blend using UpperBody
) rotate to the wrong direction when blend per bone
.
Solution:
Check Mesh Space Rotation Blend
in Layered blend per bone
How to keep in sync when using Layered blend per bone
Issue:
When using Layered blend per bone
, lower body animation would be reset when play upper body animation.
Solution:
Set the same Sync Group
in BlendSpace of movement.
How to keep in sync when using Layered blend per bone
https://forums.unrealengine.com/development-discussion/animation/1403030-how-to-keep-in-sync-when-using-layered-blend-per-bone
How to use Blend Depth?
Reference
What does the ‘Blend Depth’ parameter in ‘Layered Blend Per Bone’ do?
https://answers.unrealengine.com/questions/387906/what-does-the-blend-depth-parameter-in-layered-ble.html
[Documentation]How to use Blend Depth in Layered blend per bone node?
https://answers.unrealengine.com/questions/336798/how-to-use-blend-depth-in-layered-blend-per-bone-n.html
How to execute Transform (Modify) Bone and Layered Blend and PlayAnimMontage at the same time
Just execute Transform (Modify) Bone
and Layered Blend
before Final Animation Pose
node, then bone’s transform would stack to pose of PlayAnimMontage
.
Issues
Blending didn’t work properly in Animation Blueprint
Issue:
Blending didn’t work properly in Animation Blueprint.
May be caused by:
It’s issue of engine: Animation Blueprint was create in engine at low version, and then you update engine to the higher version.
Solution:
Create Animation Blueprint in higher version of UE4Editor.
Switch Animation Blueprint at run-time
If want to switch AnimInstance class at run-time, it should to clean previous animation cache by setting anim class to null, otherwise there’re some issues on blending.
if(NewAnimClass)
{
SKMesh->SetAnimInstanceClass(nullptr);
SKMesh->SetAnimInstanceClass(NewAnimClass);
}
有作用者器宇定是不凡,有智慧者才情决然不露。----弘一法师