unreal.AnimDatabase¶
- class unreal.AnimDatabase(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
DataAssetAnimation 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.
C++ Source:
Plugin: AnimDatabase
Module: AnimDatabase
File: AnimDatabase.h
Editor Properties: (see get_editor_property/set_editor_property)
curve_sampler(AnimDatabaseSampler): [Read-Write] Interpolation method used for sampling curves in the database.entries(Array[AnimSequence]): [Read-Write] List of Animations in Databaseframe_rate(FrameRate): [Read-Write] FrameRate to use for sampling the database. This should generally set to the target frame rate of your game.mirror_data_table(MirrorDataTable): [Read-Write] Mirror Data Table. Leave as null if you don’t want to include mirrored animations in the database.pose_sampler(AnimDatabaseSampler): [Read-Write] Interpolation method used for sampling poses in the database.skeleton(Skeleton): [Read-Write] Skeleton structure for Animation Sequences
- find_bone_index(bone_name) int32¶
Finds the bone index for a given bone name in the database skeleton
- Parameters:
bone_name (Name)
- Return type:
int32
- find_bone_indices(bone_names) Array[int32]¶
Finds the bone indices associated with the given bone names in the database skeleton
- find_sequence_index(anim_sequence, is_mirrored) int32¶
Finds the sequence index associated with a given animation
- Parameters:
anim_sequence (AnimSequence)
is_mirrored (bool)
- Return type:
int32
- get_anim_sequence(sequence_idx) AnimSequence¶
Gets a pointer for the animation corresponding to a particular sequence index
- Parameters:
sequence_idx (int32)
- Return type:
- get_bone_name(bone_index) Name¶
Gets the bone name for the given bone index in the database skeleton
- Parameters:
bone_index (int32)
- Return type:
- get_bone_num() int32¶
Gets the number of bones in the database skeleton
- Return type:
int32
- get_bone_parent(bone_index) int32¶
Gets the parent bone index
- Parameters:
bone_index (int32)
- Return type:
int32
- get_bone_parents() Array[int32]¶
Gets the array of bone parent indices for the database skeleton
- Returns:
out_parents (Array[int32]):
- Return type:
Array[int32]
- get_bone_reference_location(bone_idx) Vector¶
Gets the bone location in the reference skeleton
- Parameters:
bone_idx (int32)
- Return type:
- get_bone_reference_rotation(bone_idx) Quat¶
Gets the bone rotation in the reference skeleton
- Parameters:
bone_idx (int32)
- Return type:
- get_bone_reference_scale(bone_idx) Vector¶
Gets the bone scale in the reference skeleton
- Parameters:
bone_idx (int32)
- Return type:
- get_closest_frame_from_sequence_time(sequence_idx, sequence_time) int32¶
Gets the closest frame associated with a sequence time
- Parameters:
sequence_idx (int32)
sequence_time (float)
- Return type:
int32
- get_content_hash() int32¶
Gets a hash value which can be used to test if the underlying content in the database, or database properties have changed. This hash should not be relied on for detecting changes with certainty, and so should only be used for non-critical purposes (e.g. UI updates).
- Return type:
int32
- get_is_mirrored(sequence_idx) bool¶
Returns if a given sequence index is for a mirrored animation or not
- Parameters:
sequence_idx (int32)
- Return type:
- get_mirror_data_table() MirrorDataTable¶
Get a pointer to the database mirror table
- Return type:
- get_sequence_asset_name(sequence_idx) str¶
Gets the asset name for a sequence index
- Parameters:
sequence_idx (int32)
- Return type:
- get_sequence_duration(sequence_idx) float¶
Returns the duration of a sequence in seconds
- Parameters:
sequence_idx (int32)
- Return type:
- get_sequence_frame_num(sequence_idx) int32¶
Gets the number of frames in a sequence
- Parameters:
sequence_idx (int32)
- Return type:
int32
- get_sequence_num() int32¶
Gets the number of sequences in the database. This will be two times the number of entries when a mirror table is provided.
- Return type:
int32
- get_sequence_path_string(sequence_idx) str¶
Gets the path string for a sequence index
- Parameters:
sequence_idx (int32)
- Return type:
- get_sequence_time_from_frame(sequence_idx, frame_idx) float¶
Gets the sequence time for the start of a given frame
- Parameters:
sequence_idx (int32)
frame_idx (int32)
- Return type:
- get_total_frame_num() int32¶
Gets the total number of frames across all sequences
- Return type:
int32