Navigation
API > API/Runtime > API/Runtime/Engine
Allows multiple animations to be blended between based on input parameters
| Name | UBlendSpace |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Animation/BlendSpace.h |
| Include Path | #include "Animation/BlendSpace.h" |
Syntax
UCLASS (Config=Engine, HideCategories=Object, MinimalAPI, BlueprintType)
class UBlendSpace :
public UAnimationAsset ,
public IInterpolationIndexProvider
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UAnimationAsset → UBlendSpace
Implements Interfaces
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UBlendSpace
(
const FObjectInitializer& ObjectInitializer |
Animation/BlendSpace.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AnalysisProperties | TObjectPtr< UAnalysisProperties > | Analysis properties for each axis. | Animation/BlendSpace.h |
|
| AnimLength | float | This is the maximum length of any sample in the blendspace. | Animation/BlendSpace.h | |
| bAllowMarkerBasedSync | bool | Whether to allow marker based sync between the samples (it won't force sync if the markers don't exist) | Animation/BlendSpace.h |
|
| bAllowMeshSpaceBlending | bool | If set then blending is performed in mesh space if there are per-bone sample smoothing overrides. | Animation/BlendSpace.h |
|
| bContainsRotationOffsetMeshSpaceSamples | bool | Indicates whether any samples have the flag to apply rotation offsets in mesh space | Animation/BlendSpace.h | |
| bInterpolateUsingGrid | bool | If true then interpolation is done via a grid at runtime. | Animation/BlendSpace.h |
|
| bLoop | bool | The default looping behavior of this blend space. Asset players can override this | Animation/BlendSpace.h |
|
| bShouldMatchSyncPhases | bool | If true, all follower samples will pass the same amount of markers the leader sample has passed to match its sync phase. | Animation/BlendSpace.h |
|
| bTargetWeightInterpolationEaseInOut | bool | If set then this eases in/out the sample weight adjustments, using the speed to determine how much smoothing to apply. | Animation/BlendSpace.h |
|
| CachedAnalysisProperties | TObjectPtr< UCachedAnalysisProperties > | Cached properties used to initialize properties when newly created. | Animation/BlendSpace.h | |
| InterpolationParam | FInterpolationParameter | Input Smoothing parameters for each input axis | Animation/BlendSpace.h |
|
| NotifyTriggerMode | TEnumAsByte< ENotifyTriggerMode::Type > | The current mode used by the BlendSpace to decide which animation notifies to fire. | Animation/BlendSpace.h |
|
| PreferredTriangulationDirection | EPreferredTriangulationDirection | Preferred edge direction when the triangulation has to make an arbitrary choice | Animation/BlendSpace.h |
|
| PreviewBasePose | TObjectPtr< UAnimSequence > | Preview Base pose for additive BlendSpace | Animation/BlendSpace.h |
|
| TargetWeightInterpolationSpeedPerSec | float | If greater than zero, this is the speed at which the sample weights are allowed to change. | Animation/BlendSpace.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| MarkerDataUpdateCounter | int32 | Track whether we have updated markers so cached data can be updated. | Animation/BlendSpace.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 AddSample
(
const FVector& SampleValue |
Add samples | Animation/BlendSpace.h | |
int32 AddSample
(
UAnimSequence* AnimationSequence, |
Animation/BlendSpace.h | ||
float ComputeAxisScaleFactor
(
const FVector& BlendSpacePosition, |
Computes the axis scale factor. See AxisToScaleAnimation. | Animation/BlendSpace.h | |
bool DeleteSample
(
const int32 BlendSampleIndex |
Delete samples | Animation/BlendSpace.h | |
bool DoesAnimationMatchExistingSamples
(
const UAnimSequence* AnimationSequence |
Check if the blend spaces contains samples whos additive type match that of the animation sequence | Animation/BlendSpace.h | |
bool EditSampleValue
(
const int32 BlendSampleIndex, |
Edit samples | Animation/BlendSpace.h | |
void ExpandRangeForSample
(
const FVector& SampleValue |
Animation/BlendSpace.h | ||
FVector FilterInput
(
FBlendFilter* Filter, |
Interpolate BlendInput based on Filter data | Animation/BlendSpace.h | |
void ForEachImmutableSample
(
const TFunctionRef< void(const FBlendSample&)> Func |
Allows the user to iterate through all the data samples available in the blend space. | Animation/BlendSpace.h | |
float GetAnimationLengthFromSampleData
(
const TArray< FBlendSampleData >& SampleDataList |
Utility function to calculate animation length from sample data list | Animation/BlendSpace.h | |
void GetAnimationPose
(
TArray< FBlendSampleData >& BlendSampleDataCache, |
Animation/BlendSpace.h | ||
void GetAnimationPose
(
TArray< FBlendSampleData >& BlendSampleDataCache, |
Animation/BlendSpace.h | ||
void GetAnimationPose
(
TArray< FBlendSampleData >& BlendSampleDataCache, |
Animation/BlendSpace.h | ||
void GetAnimationPose
(
TArray< FBlendSampleData >& BlendSampleDataCache, |
BlendSpace Get Animation Pose function | Animation/BlendSpace.h | |
void GetAnimationPose
(
TArray< FBlendSampleData >& BlendSampleDataCache, |
Animation/BlendSpace.h | ||
const FBlendParameter & GetBlendParameter
(
const int32 Index |
Accessor for blend parameter | Animation/BlendSpace.h | |
const FBlendSample & GetBlendSample
(
const int32 SampleIndex |
Returns the Blend Sample at the given index, will assert on invalid indices | Animation/BlendSpace.h | |
const TArray< struct FBlendSample > & GetBlendSamples() |
Get this blend spaces sample data | Animation/BlendSpace.h | |
const FBlendSpaceData & GetBlendSpaceData() |
Returns the runtime triangulation etc data | Animation/BlendSpace.h | |
FVector GetClampedAndWrappedBlendInput
(
const FVector& BlendInput |
Returns the blend input after clamping and/or wrapping | Animation/BlendSpace.h | |
FVector GetGridPosition
(
int32 GridIndex |
Returns the sample position associated with the elements returned by GetGridSamples | Animation/BlendSpace.h | |
FVector GetGridPosition
(
int32 GridX, |
Returns the sample position associated with the coordinates | Animation/BlendSpace.h | |
const TArray< FEditorElement > & GetGridSamples() |
Return GridSamples from this BlendSpace | Animation/BlendSpace.h | |
int32 GetNumberOfBlendSamples() |
Get the number of sample points for this blend space | Animation/BlendSpace.h | |
bool GetSamplesFromBlendInput
(
const FVector& BlendInput, |
Get Grid Samples from BlendInput It will return all samples that has weight > KINDA_SMALL_NUMBER | Animation/BlendSpace.h | |
void InitializeFilter
(
FBlendFilter* Filter, |
Initialize BlendSpace filtering for runtime. | Animation/BlendSpace.h | |
bool IsAnimationCompatible
(
const UAnimSequence* AnimationSequence |
Check if the animation sequence additive type is compatible with this blend space | Animation/BlendSpace.h | |
bool IsAnimationCompatibleWithSkeleton
(
const UAnimSequence* AnimationSequence |
Check if the animation sequence's skeleton is compatible with this blendspace | Animation/BlendSpace.h | |
bool IsSampleWithinBounds
(
const FVector& SampleValue |
Animation/BlendSpace.h | ||
bool IsTooCloseToExistingSamplePoint
(
const FVector& SampleValue, |
Check if given sample value isn't too close to existing sample point | Animation/BlendSpace.h | |
virtual bool IsValidAdditiveType
(
EAdditiveAnimationType AdditiveType |
Returns whether or not the given additive animation type is compatible with the blendspace type | Animation/BlendSpace.h | |
bool IsValidBlendSampleIndex
(
const int32 SampleIndex |
Check whether or not the sample index is valid in combination with the stored sample data | Animation/BlendSpace.h | |
bool ReplaceSampleAnimation
(
const int32 BlendSampleIndex, |
Update animation on grid sample | Animation/BlendSpace.h | |
void ResampleData() |
Runs triangulation/segmentation to update our grid and BlendSpaceData structures | Animation/BlendSpace.h | |
void ResetBlendSamples
(
TArray< FBlendSampleData >& InOutSampleDataCache, |
Resets a cached set of blend samples to match a given input time. | Animation/BlendSpace.h | |
void RuntimeValidateMarkerData() |
Animation/BlendSpace.h | ||
void SetBlendSpaceData
(
const TArray< FBlendSpaceSegment >& Segments |
Sets up BlendSpaceData based on Line elements | Animation/BlendSpace.h | |
bool ShouldAnimationBeAdditive() |
Check if the the blendspace contains additive samples only | Animation/BlendSpace.h | |
bool UpdateBlendSamples
(
const FVector& InBlendSpacePosition, |
Updates a cached set of blend samples according to internal parameters, blendspace position and a delta time. | Animation/BlendSpace.h | |
void UpdateFilterParams
(
FBlendFilter* Filter |
Update BlendSpace filtering parameters - values that don't require a full initialization | Animation/BlendSpace.h | |
bool UpdateSampleAnimation
(
UAnimSequence* AnimationSequence, |
Animation/BlendSpace.h | ||
bool ValidateAnimationSequence
(
const UAnimSequence* AnimationSequence |
Validate that the given animation sequence and contained blendspace data | Animation/BlendSpace.h | |
void ValidateSampleData() |
Validates the contained data | Animation/BlendSpace.h | |
bool ValidateSampleValue
(
const FVector& SampleValue, |
Validates supplied blend sample against current contents of blendspace | Animation/BlendSpace.h |
Overridden from UAnimationAsset
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool GetAllAnimationSequencesReferred
(
TArray< UAnimationAsset* >& AnimationSequences, |
Retrieve all animations that are used by this asset | Animation/BlendSpace.h | |
virtual int32 GetMarkerUpdateCounter() |
Animation/BlendSpace.h | ||
virtual float GetPlayLength () |
This is used in editor only when used for transition getter this doesn't mean max time. | Animation/BlendSpace.h | |
| Return a list of unique marker names for blending compatibility | Animation/BlendSpace.h | ||
virtual bool IsValidAdditive() |
Return true if this is valid additive animation false otherwise | Animation/BlendSpace.h | |
virtual void ReplaceReferredAnimations
(
const TMap< UAnimationAsset*, UAnimationAsset* >& ReplacementMap |
Replace this assets references to other animations based on ReplacementMap | Animation/BlendSpace.h | |
virtual void TickAssetPlayer
(
FAnimTickRecord& Instance, |
Advances the asset player instance | Animation/BlendSpace.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void GetResourceSizeEx
(
FResourceSizeEx& CumulativeResourceSize |
Animation/BlendSpace.h | ||
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Animation/BlendSpace.h | ||
virtual void PostLoad() |
Animation/BlendSpace.h | ||
virtual void PreEditChange
(
FProperty* PropertyAboutToChange |
Animation/BlendSpace.h | ||
virtual void Serialize
(
FArchive& Ar |
Animation/BlendSpace.h |
Overridden from IInterpolationIndexProvider
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedPtr< IInterpolationIndexProvider::FPerBoneInterpolationData > GetPerBoneInterpolationData
(
const USkeleton* Skeleton |
Sorts the PerBoneBlend data into a form that can be repeatedly used in GetPerBoneInterpolationIndex | Animation/BlendSpace.h | |
virtual int32 GetPerBoneInterpolationIndex
(
const FSkeletonPoseBoneIndex InSkeletonBoneIndex, |
Get PerBoneInterpolationIndex for the input BoneIndex If nothing found, return INDEX_NONE | Animation/BlendSpace.h | |
virtual int32 GetPerBoneInterpolationIndex
(
const FCompactPoseBoneIndex& InCompactPoseBoneIndex, |
Get PerBoneInterpolationIndex for the input BoneIndex If nothing found, return INDEX_NONE | Animation/BlendSpace.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool ContainsMatchingSamples
(
EAdditiveAnimationType AdditiveType |
Returns whether or not all animation set on the blend space samples match the given additive type | Animation/BlendSpace.h | |
bool ContainsNonAdditiveSamples() |
Animation/BlendSpace.h | ||
FVector ConvertBlendInputToGridSpace
(
const FVector& BlendInput |
Translates BlendInput to grid space | Animation/BlendSpace.h | |
virtual EBlendSpaceAxis GetAxisToScale() |
Returns the axis which can be used to scale animation speed. | Animation/BlendSpace.h | |
FVector GetClampedBlendInput
(
const FVector& BlendInput |
Returns the blend input clamped to the valid range, unless that axis has been set to wrap in which case no clamping is done | Animation/BlendSpace.h | |
const FEditorElement * GetGridSampleInternal
(
int32 Index |
Returns the grid element at Index or NULL if Index is not valid | Animation/BlendSpace.h | |
FVector GetNormalizedBlendInput
(
const FVector& BlendInput |
Translates BlendInput to grid space | Animation/BlendSpace.h | |
void GetRawSamplesFromBlendInput
(
const FVector& BlendInput, |
Get Grid Samples from BlendInput, From Input, it will populate OutGridSamples with the closest grid points. | Animation/BlendSpace.h | |
void InitializePerBoneBlend() |
Initialize Per Bone Blend | Animation/BlendSpace.h | |
bool InterpolateWeightOfSampleData
(
float DeltaTime, |
Utility function to interpolate weight of samples from OldSampleDataList to NewSampleDataList and copy back the interpolated result to FinalSampleDataList | Animation/BlendSpace.h | |
bool IsSameSamplePoint
(
const FVector& SamplePointA, |
Checks if the given samples points overlap | Animation/BlendSpace.h | |
void ResetToRefPose
(
FCompactPose& OutPose |
Reset to reference pose. It does apply different refpose based on additive or not | Animation/BlendSpace.h | |
virtual void SnapSamplesToClosestGridPoint() |
If around border, snap to the border to avoid empty hole of data that is not valid | Animation/BlendSpace.h | |
void TickFollowerSamples
(
TArray< FBlendSampleData >& SampleDataList, |
Ticks the samples in SampleDataList apart from the HighestWeightIndex one. | Animation/BlendSpace.h | |
void UpdatePreviewBasePose() |
Animation/BlendSpace.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool IsSingleFrameBlendingIndexInBounds
(
const FBlendSample& BlendSample |
Animation/BlendSpace.h | ||
static void UpdateBlendSpacesUsingAnimSequence
(
UAnimSequenceBase* Sequence |
Validates sample data for blendspaces using the given animation sequence | Animation/BlendSpace.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bRotationBlendInMeshSpace_DEPRECATED | bool | Animation/BlendSpace.h |