Navigation
API > API/Plugins > API/Plugins/AnimDatabase
Animation Database Asset
This asset contains an array of animations, as well as a skeleton, and a mirror table. It is assumed that all added animations should match the provided skeleton. As well as providing a hook for a custom UI and tooling, this asset provides functions for sampling animation data at a single uniform framerate and in the pose representation used by the database.
The number of "Sequences" in this database (as returned by GetSequenceNum()) will be two times the number of entries in "Entries" when the mirror data table is present and valid, otherwise it will be the same as the number of entries.
| Name | UAnimDatabase |
| Type | class |
| Header File | /Engine/Plugins/Experimental/Animation/AnimDatabase/Source/AnimDatabase/Public/AnimDatabase.h |
| Include Path | #include "AnimDatabase.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType, Category="Animation", Meta=(DisplayName="Animation Database"))
class UAnimDatabase : public UDataAsset
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UDataAsset → UAnimDatabase
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UAnimDatabase
(
const FObjectInitializer& ObjectInitializer |
AnimDatabase.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CurveSampler | EAnimDatabaseSampler | Interpolation method used for sampling curves in the database. | AnimDatabase.h |
|
| Entries | TArray< TObjectPtr< UAnimSequence > > | List of Animations in Database | AnimDatabase.h |
|
| FrameRate | FFrameRate | FrameRate to use for sampling the database. | AnimDatabase.h |
|
| MirrorDataTable | TObjectPtr< UMirrorDataTable > | Mirror Data Table. Leave as null if you don't want to include mirrored animations in the database. | AnimDatabase.h |
|
| OnSkeletonChanged | FAnimDatabaseOnSkeletonChanged | Callback to fire when the skeleton is changed | AnimDatabase.h | |
| PoseSampler | EAnimDatabaseSampler | Interpolation method used for sampling poses in the database. | AnimDatabase.h |
|
| Query | TObjectPtr< UAnimDatabaseQuery > | Editor-only object containing the query state for the editor window | AnimDatabase.h |
|
| Skeleton | TObjectPtr< USkeleton > | Skeleton structure for Animation Sequences | AnimDatabase.h |
|
| ViewportSettings | TObjectPtr< UAnimDatabaseViewportSettings > | Editor-only object containing the viewport settings for the editor window | AnimDatabase.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 FindBoneIndex
(
const FName BoneName |
Finds the bone index for a given bone name in the database skeleton | AnimDatabase.h |
|
| Finds the bone indices associated with the given bone names in the database skeleton | AnimDatabase.h |
|
|
void FindBoneIndicesFromArrayViews
(
const TArrayView< int32 > OutBoneIndices, |
AnimDatabase.h |
|
|
int32 FindSequenceIndex
(
UAnimSequence* AnimSequence, |
Finds the sequence index associated with a given animation | AnimDatabase.h |
|
UAnimSequence * GetAnimSequence
(
const int32 SequenceIdx |
Gets a pointer for the animation corresponding to a particular sequence index | AnimDatabase.h |
|
void GetAttributeData
(
const UE::AnimDatabase::FPoseAttributeDataView& OutAttributeData, |
Gets a number of frames of attribute data for a given sequence and frame range | AnimDatabase.h | |
FName GetBoneName
(
const int32 BoneIndex |
Gets the bone name for the given bone index in the database skeleton | AnimDatabase.h |
|
| Gets the bone names for all bones on the skeleton | AnimDatabase.h |
|
|
void GetBoneNamesToArrayView
(
TArrayView< FName > OutBoneNames |
AnimDatabase.h |
|
|
int32 GetBoneNum() |
Gets the number of bones in the database skeleton | AnimDatabase.h |
|
int32 GetBoneParent
(
const int32 BoneIndex |
Gets the parent bone index | AnimDatabase.h |
|
void GetBoneParents
(
TArray< int32 >& OutParents |
Gets the array of bone parent indices for the database skeleton | AnimDatabase.h |
|
void GetBoneParentsToArrayView
(
const TArrayView< int32 > OutParents |
AnimDatabase.h |
|
|
FVector GetBoneReferenceLocation
(
const int32 BoneIdx |
Gets the bone location in the reference skeleton | AnimDatabase.h |
|
void GetBoneReferenceLocations
(
TArray< FVector >& OutReferenceLocations |
Gets the bone locations in the reference skeleton | AnimDatabase.h |
|
void GetBoneReferenceLocationsToArrayView
(
TArrayView< FVector > OutReferenceLocations |
AnimDatabase.h |
|
|
FQuat GetBoneReferenceRotation
(
const int32 BoneIdx |
Gets the bone rotation in the reference skeleton | AnimDatabase.h |
|
void GetBoneReferenceRotations
(
TArray< FQuat >& OutReferenceRotations |
Gets the bone rotations in the reference skeleton | AnimDatabase.h |
|
void GetBoneReferenceRotationsToArrayView
(
TArrayView< FQuat > OutReferenceRotations |
AnimDatabase.h |
|
|
FVector GetBoneReferenceScale
(
const int32 BoneIdx |
Gets the bone scale in the reference skeleton | AnimDatabase.h |
|
int32 GetClosestFrameFromSequenceTime
(
const int32 SequenceIdx, |
Gets the closest frame associated with a sequence time | AnimDatabase.h |
|
int32 GetContentHash () |
Gets a hash value which can be used to test if the underlying content in the database, or database properties have changed. | AnimDatabase.h |
|
void GetCurveActiveData
(
const TLearningArrayView< 2, bool > OutCurveActive, |
Gets if the given curves are active for a given sequence and frame range | AnimDatabase.h | |
void GetCurveData
(
const TLearningArrayView< 2, float > OutCurveValues, |
Gets curve data for a given sequence and frame range | AnimDatabase.h | |
FFrameRate GetFrameRate() |
Get the database frame rate | AnimDatabase.h |
|
bool GetIsMirrored
(
const int32 SequenceIdx |
Returns if a given sequence index is for a mirrored animation or not | AnimDatabase.h |
|
UMirrorDataTable * GetMirrorDataTable() |
Get a pointer to the database mirror table | AnimDatabase.h |
|
void GetPoseData
(
const UE::AnimDatabase::FPoseDataView& OutPoseData, |
Gets a number of frames of pose data for a given sequence and frame range | AnimDatabase.h | |
void GetPoseLocalBoneData
(
const UE::AnimDatabase::FPoseLocalBoneDataView& OutPoseLocalBoneData, |
Gets a number of frames of local bone data for a given sequence and frame range | AnimDatabase.h | |
void GetPoseLocalBoneSubsetData
(
const UE::AnimDatabase::FPoseLocalBoneDataView& OutPoseLocalBoneData, |
Gets a number of frames of local bone data for a given sequence and frame range, and a subset of bones | AnimDatabase.h | |
void GetPoseRootData
(
const UE::AnimDatabase::FPoseRootDataView& OutPoseRootData, |
Get a number of frames of root data for a given sequence and frame range | AnimDatabase.h | |
void GetPoseSubsetData
(
const UE::AnimDatabase::FPoseDataView& OutPoseData, |
Gets a number of frames of pose data for a given sequence and frame range, and a subset of bones | AnimDatabase.h | |
void GetRootAngularVelocity
(
const TLearningArrayView< 1, FVector3f > OutAngularVelocities, |
Gets the root angular velocity for a given sequence and start frame | AnimDatabase.h | |
void GetRootDirection
(
const TLearningArrayView< 1, FVector3f > OutDirections, |
Gets the root direction for a given sequence and start frame | AnimDatabase.h | |
void GetRootLinearVelocity
(
const TLearningArrayView< 1, FVector3f > OutLinearVelocities, |
Gets the root linear velocity for a given sequence and start frame | AnimDatabase.h | |
void GetRootLocation
(
const TLearningArrayView< 1, FVector > OutLocations, |
Gets the root location for a given sequence and start frame | AnimDatabase.h | |
void GetRootRotation
(
const TLearningArrayView< 1, FQuat4f > OutRotations, |
Gets the root rotation for a given sequence and start frame | AnimDatabase.h | |
void GetRootTransform
(
const TLearningArrayView< 1, FTransform > OutTransforms, |
Gets the root transform for a given sequence and start frame | AnimDatabase.h | |
FString GetSequenceAssetName
(
const int32 SequenceIdx |
Gets the asset name for a sequence index | AnimDatabase.h |
|
float GetSequenceDuration
(
const int32 SequenceIdx |
Returns the duration of a sequence in seconds | AnimDatabase.h |
|
int32 GetSequenceFrameNum
(
const int32 SequenceIdx |
Gets the number of frames in a sequence | AnimDatabase.h |
|
int32 GetSequenceNum () |
Gets the number of sequences in the database. | AnimDatabase.h |
|
FString GetSequencePathString
(
const int32 SequenceIdx |
Gets the path string for a sequence index | AnimDatabase.h |
|
float GetSequenceTimeFromFrame
(
const int32 SequenceIdx, |
Gets the sequence time for the start of a given frame | AnimDatabase.h |
|
USkeleton * GetSkeleton() |
Get a pointer to the database skeleton | AnimDatabase.h |
|
float GetTotalDuration() |
Gets the total duration of all sequences | AnimDatabase.h |
|
int32 GetTotalFrameNum() |
Gets the total number of frames across all sequences | AnimDatabase.h |
|
void SampleAttributeData
(
const UE::AnimDatabase::FPoseAttributeDataView& OutAttributeData, |
Samples attribute data for the given sequences and times in those sequences. | AnimDatabase.h | |
void SampleCurveActiveData
(
const TLearningArrayView< 2, bool > OutCurveActive, |
Samples if curve are active for the given sequences and times in those sequences. | AnimDatabase.h | |
void SampleCurveData
(
const TLearningArrayView< 2, float > OutCurveValues, |
Samples curve data for the given sequences and times in those sequences. | AnimDatabase.h | |
void SamplePoseData
(
const UE::AnimDatabase::FPoseDataView& OutPoseData, |
Samples pose data for the given sequences and times in those sequences. | AnimDatabase.h | |
void SamplePoseLocalBoneData
(
const UE::AnimDatabase::FPoseLocalBoneDataView& OutPoseLocalBoneData, |
Samples local bone data for the given sequences and times in those sequences | AnimDatabase.h | |
void SamplePoseLocalBoneSubsetData
(
const UE::AnimDatabase::FPoseLocalBoneDataView& OutPoseLocalBoneData, |
Samples local bone data for the given sequences and times in those sequences, and a subset of bones. | AnimDatabase.h | |
void SamplePoseRootData
(
const UE::AnimDatabase::FPoseRootDataView& OutPoseRootData, |
Samples root data for the given sequences and times in those sequences | AnimDatabase.h | |
void SamplePoseSubsetData
(
const UE::AnimDatabase::FPoseDataView& OutPoseData, |
Samples pose data for the given sequences and times in those sequences, for a subset of bones. | AnimDatabase.h | |
FVector3f SampleRootDirection
(
const int32 SequenceIdx, |
Samples the root direction for a given sequence and sequence time | AnimDatabase.h | |
FVector3f SampleRootLinearVelocity
(
const int32 SequenceIdx, |
Samples the root linear velocity for a given sequence and sequence time | AnimDatabase.h | |
FVector SampleRootLocation
(
const int32 SequenceIdx, |
Samples the root location for a given sequence and sequence time | AnimDatabase.h | |
FQuat4f SampleRootRotation
(
const int32 SequenceIdx, |
Samples the root rotation for a given sequence and sequence time | AnimDatabase.h | |
FTransform SampleRootTransform
(
const int32 SequenceIdx, |
Samples the root transform for a given sequence and sequence time | AnimDatabase.h | |
void WaitForCompressionOnAll() |
AnimDatabase.h | ||
void WaitForCompressionOnAnimSequence
(
const int32 SequenceIdx |
Waits for the animation compression to complete for the given sequence. | AnimDatabase.h |
|
void WaitForCompressionOnAnimSequences
(
const TArray< int32 >& SequenceIndices |
Waits for the animation compression to complete for the given sequences. | AnimDatabase.h |
|
void WaitForCompressionOnAnimSequencesFromArrayView
(
const TArrayView< const int32 > SequenceIndices |
AnimDatabase.h |
|
Public Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& Event |
We use this to ensure that entries added have a matching skeleton | AnimDatabase.h |