Navigation
API > API/Plugins > API/Plugins/UAFAnimGraph
Blend Two Keyframes Task
This pops the top two keyframes from the VM keyframe stack, it blends/interpolates them, and pushes back the result onto the stack. Let B be the input keyframe at the top of the stack and A be the second from the top. Then we have: Result = Interpolate(A, B, Alpha) Top = Interpolate(Top-1, Top, Alpha) An Alpha of 0.0 returns A while 1.0 returns B
Internally, this breaks down into the following tasks:
- FAnimNextBlendOverwriteKeyframeWithScaleTask(1.0 - InterpolationAlpha) // todo clarify alpha
- FAnimNextBlendAddKeyframeWithScaleTask(InterpolationAlpha)
- FAnimNextNormalizeKeyframeRotationsTask
In order to blend more than two keyframes together, simply add more FAnimNextBlendAddKeyframeWithScaleTask tasks each with its corresponding weight before normalizing rotations.
| Name | FAnimNextBlendTwoKeyframesTask |
| Type | struct |
| Header File | /Engine/Plugins/Experimental/UAF/UAFAnimGraph/Source/UAFAnimGraph/Public/EvaluationVM/Tasks/BlendKeyframes.h |
| Include Path | #include "EvaluationVM/Tasks/BlendKeyframes.h" |
Syntax
USTRUCT ()
struct FAnimNextBlendTwoKeyframesTask : public FAnimNextEvaluationTask
Inheritance Hierarchy
- FAnimNextEvaluationTask → FAnimNextBlendTwoKeyframesTask
Derived Classes
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AlphaCurveInputIndex | int8 | EvaluationVM/Tasks/BlendKeyframes.h | ||
| AlphaSourceCurveName | FName | The curve to evaluate and extract the interpolation alpha between the two input keyframes. | EvaluationVM/Tasks/BlendKeyframes.h | |
| InputScaleBiasClampFn | TFunction< float(float)> | EvaluationVM/Tasks/BlendKeyframes.h | ||
| InterpolationAlpha | float | The interpolation alpha between the two input keyframes. | EvaluationVM/Tasks/BlendKeyframes.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
float GetInterpolationAlpha
(
const UE::UAF::FKeyframeState* KeyframeA, |
Compute the current alpha value for curves or return the interpolation alpha otherwise. | EvaluationVM/Tasks/BlendKeyframes.h |
Overridden from FAnimNextEvaluationTask
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Execute
(
UE::UAF::FEvaluationVM& VM |
Task entry point. | EvaluationVM/Tasks/BlendKeyframes.h | |
virtual const UScriptStruct * GetStruct() |
Returns the derived type for the task. | EvaluationVM/Tasks/BlendKeyframes.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FAnimNextBlendTwoKeyframesTask Make
(
float InterpolationAlpha |
EvaluationVM/Tasks/BlendKeyframes.h | ||
static FAnimNextBlendTwoKeyframesTask Make
(
const FName& AlphaSourceCurveName, |
EvaluationVM/Tasks/BlendKeyframes.h |