UBlendSpaceBase

Allows multiple animations to be blended between based on input parameters

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Animation/BlendSpaceBase.h

Include

#include "Animation/BlendSpaceBase.h"

Syntax

class UBlendSpaceBase :
    public UAnimationAsset,
    public IInterpolationIndexProvider

Remarks

Allows multiple animations to be blended between based on input parameters

Variables

Name Description

Public variable

float

 

AnimLength

This animation length changes based on current input (resulting in different blend time)

Protected variable

FBlendParameter...

 

BlendParameters

Blend Parameters for each axis.

Public variable

bool

 

bRotationBlendInMeshSpace

When you use blend per bone, allows rotation to blend in mesh space.

Protected variable

TArray< struct ...

 

GridSamples

Grid samples, indexing scheme imposed by subclass

Public variable

FInterpolationP...

 

InterpolationParam

Input interpolation parameter for all 3 axis, for each axis input, decide how you'd like to interpolate input to

Public variable

TEnumAsByte< EN...

 

NotifyTriggerMode

The current mode used by the blendspace to decide which animation notifies to fire.

Protected variable

TArray< FPerBon...

 

PerBoneBlend

Define target weight interpolation per bone.

Public variable

UAnimSequence &...

 

PreviewBasePose

Preview Base pose for additive BlendSpace

Protected variable

FVector[3]

 

PreviousAxisMinMaxValues

Protected variable

TArray< struct ...

 

SampleData

Sample animation data

Protected variable

int32

 

SampleIndexWithMarkers

Track index to get marker data from.

Public variable

float

 

TargetWeightInterpolationSpeedPerSec

Target weight interpolation.

Constructors

Name Description

Public function

UBlendSpaceBase

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

bool

 

AddSample

(
    UAnimSequence* AnimationSequen...,
    const FVector& SampleValue
)

Add samples

Protected function Const

FVector

 

ClampBlendInput

(
    const FVector& BlendInput
)

Clamp blend input to valid point

Protected function Const

bool

 

ContainsMatchingSamples

(
    EAdditiveAnimationType AdditiveType
)

Returns whether or not all animation set on the blend space samples match the given additive type

Protected function Const

bool

 

ContainsNonAdditiveSamples()

Public function

bool

 

DeleteSample

(
    const int32 BlendSampleIndex
)

Delete samples

Public function Const

bool

 

DoesAnimationMatchExistingSamples

(
    const UAnimSequence* Animation...
)

Check if the blend spaces contains samples whos additive type match that of the animation sequence

Public function

bool

 

EditSampleValue

(
    const int32 BlendSampleIndex,
    const FVector& NewValue,
    bool bSnap
)

Edit samples

Public function

void

 

EmptyGridElements()

Public function

void

 

FillupGridElements

(
    const TArray< int32 >& PointListTo...,
    const TArray< FEditorElement >& Gr...
)

Fill up local GridElements from the grid elements that are created using the sorted points This will map back to original index for result

Protected function Const

FVector

 

FilterInput

(
    FBlendFilter* Filter,
    const FVector& BlendInput,
    float DeltaTime
)

Interpolate BlendInput based on Filter data

Protected function Const

float

 

GetAnimationLengthFromSampleData

(
    const TArray< FBlendSampleData >& ...
)

Utility function to calculate animation length from sample data list

Public function

void

 

GetAnimationPose

(
    TArray< FBlendSampleData >& BlendS...,
    FCompactPose& OutPose,
    FBlendedCurve& OutCurve
)

BlendSpace Get Animation Pose function

Protected function Virtual Const

EBlendSpaceA...

 

GetAxisToScale()

Let derived blend space decided how to handle scaling

Public function Const

const FBlend...

 

GetBlendParameter

(
    const int32 Index
)

Accessor for blend parameter

Public function Const

const FBlend...

 

GetBlendSample

(
    const int32 SampleIndex
)

Returns the Blend Sample at the given index, will assert on invalid indices

Public function Const

const TArray...

 

GetBlendSamples()

Get this blend spaces sample data

Protected function Const

const FEdito...

 

GetGridSampleInternal

(
    int32 Index
)

Returns the grid element at Index or NULL if Index is not valid

Public function Const

const TArray...

 

GetGridSamples()

Return GridSamples from this BlendSpace

Protected function Const

FVector

 

GetNormalizedBlendInput

(
    const FVector& BlendInput
)

Translates BlendInput to grid space

Public function Const

int32

 

GetNumberOfBlendSamples()

Get the number of sample points for this blend space

Protected function Virtual Const

void

 

GetRawSamplesFromBlendInput

(
    const FVector& BlendInput,
    TArray< FGridBlendSample, TInlineAl...
)

Get Grid Samples from BlendInput, From Input, it will populate OutGridSamples with the closest grid points.

Public function Const

bool

 

GetSamplesFromBlendInput

(
    const FVector& BlendInput,
    TArray< FBlendSampleData >& OutSam...
)

Get Grid Samples from BlendInput It will return all samples that has weight > KINDA_SMALL_NUMBER

Public function Const

void

 

InitializeFilter

(
    FBlendFilter* Filter
)

Initialize BlendSpace for runtime. It needs certain data to be reinitialized per instsance

Protected function

void

 

InitializePerBoneBlend()

Initialize Per Bone Blend

Protected function Const

bool

 

InterpolateWeightOfSampleData

(
    float DeltaTime,
    const TArray< FBlendSampleData >& ...,
    const TArray< FBlendSampleData >& ...,
    TArray< FBlendSampleData >& FinalS...
)

Utility function to interpolate weight of samples from OldSampleDataList to NewSampleDataList and copy back the interpolated result to FinalSampleDataList

Public function Const

bool

 

IsAnimationCompatible

(
    const UAnimSequence* Animation...
)

Check if the animation sequence additive type is compatible with this blend space

Public function Const

bool

 

IsAnimationCompatibleWithSkeleton

(
    const UAnimSequence* Animation...
)

Check if the animation sequence's skeleton is compatible with this blendspace

Protected function Virtual Const

bool

 

IsSameSamplePoint

(
    const FVector& SamplePointA,
    const FVector& SamplePointB
)

Checks if the given samples points overlap

Public function Const

bool

 

IsSampleWithinBounds

(
    const FVector& SampleValue
)

Public function Const

bool

 

IsTooCloseToExistingSamplePoint

(
    const FVector& SampleValue,
    int32 OriginalIndex
)

Check if given sample value isn't too close to existing sample point

Public function Virtual Const

bool

 

IsValidAdditiveType

(
    EAdditiveAnimationType AdditiveType
)

Returns whether or not the given additive animation type is compatible with the blendspace type

Public function Const

bool

 

IsValidBlendSampleIndex

(
    const int32 SampleIndex
)

Check whether or not the sample index is valid in combination with the stored sample data

Protected function Virtual

void

 

RemapSamplesToNewAxisRange()

Protected function

void

 

ResetToRefPose

(
    FCompactPose& OutPose
)

Reset to reference pose. It does apply different refpose based on additive or not

Public function

void

 

RuntimeValidateMarkerData()

Public function Const

bool

 

ShouldAnimationBeAdditive()

Check if the the blendspace contains additive samples only

Protected function Virtual

void

 

SnapSamplesToClosestGridPoint()

If around border, snap to the border to avoid empty hole of data that is not valid

Protected function Const

void

 

TickFollowerSamples

(
    TArray< FBlendSampleData >& Sample...,
    const int32 HighestWeightIndex,
    FAnimAssetTickContext& Context,
    bool bResetMarkerDataOnFollowers
)

Public function Static

void

 

UpdateBlendSpacesUsingAnimSequence

(
    UAnimSequenceBase* Sequence
)

Validates sample data for blendspaces using the given animation sequence

Protected function

void

 

UpdatePreviewBasePose()

Public function

bool

 

UpdateSampleAnimation

(
    UAnimSequence* AnimationSequen...,
    const FVector& SampleValue
)

Update animation on grid sample

Public function Const

bool

 

ValidateAnimationSequence

(
    const UAnimSequence* Animation...
)

Validate that the given animation sequence and contained blendspace data

Public function

void

 

ValidateSampleData()

Validates the contained data

Public function Const

bool

 

ValidateSampleValue

(
    const FVector& SampleValue,
    int32 OriginalIndex
)

Validates supplied blend sample against current contents of blendspace

Overridden from UAnimationAsset

Name Description

Public function Virtual

bool

 

GetAllAnimationSequencesReferred

(
    TArray< UAnimationAsset* >& A...,
    bool bRecursive
)

Retrieve all animations that are used by this asset

Public function Virtual Const

int32

 

GetMarkerUpdateCounter()

Public function Virtual

float

 

GetMaxCurrentTime()

This is used in editor only when used for transition getter this doesn't mean max time.

Public function Virtual

TArray< FNam...

 

GetUniqueMarkerNames()

Return a list of unique marker names for blending compatibility

Public function Virtual Const

bool

 

IsValidAdditive()

Return true if this is valid additive animation false otherwise

Public function Virtual

void

 

ReplaceReferredAnimations

(
    const TMap< UAnimationAsset*, ...
)

Replace this assets references to other animations based on ReplacementMap

Public function Virtual Const

void

 

TickAssetPlayer

(
    FAnimTickRecord& Instance,
    FAnimNotifyQueue& NotifyQueue,
    FAnimAssetTickContext& Context
)

Advances the asset player instance

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

PreEditChange

(
    UProperty* PropertyAboutToChan...
)

This is called when a property is about to be modified externally

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from IInterpolationIndexProvider

Name Description

Public function Virtual Const

int32

 

GetPerBoneInterpolationIndex

(
    int32 BoneIndex,
    const FBoneContainer& RequiredBone...
)

Get PerBoneInterpolationIndex for the input BoneIndex If nothing found, return INDEX_NONE

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback