unreal.AnimDatabaseLibrary¶
- class unreal.AnimDatabaseLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibraryA blueprint library providing functions for writing back frame attribute data into an animation database.
This library provides something akin to AnimModifiers, where it becomes possible to write an asset action which can extract some frame attributes and then write these back to the animation data either in the form of AnimNotifies, AnimNotifyStates, Curves, or modifications to bone transforms. This method of AnimModifiers is far more efficient as it can be scripted via blueprints but still perform processing in batch.
C++ Source:
Plugin: AnimDatabase
Module: AnimDatabase
File: AnimDatabase.h
- classmethod add_anim_notifies_to_sequence(anim_sequence, track_name, class_, times) None¶
Adds AnimNotifies of the provided class to a sequence at the given times
- classmethod add_anim_notify_states_to_sequence(anim_sequence, track_name, class_, times, durations) None¶
Adds AnimNotifyStates of the provided class to a sequence at the given times with the given durations
- classmethod database_add_anim_notifies(database, anim_notify_track_names, classes, frames, colors, should_transact=False) None¶
Create AnimNotifies at the provided Frames in the database using the given track names and classes
- Parameters:
database (AnimDatabase)
frames (Array[AnimDatabaseFrames])
colors (Array[LinearColor])
should_transact (bool)
- classmethod database_add_anim_notify(database, anim_notify_track_name, class_, frames, color=[1.000000, 0.000000, 0.000000, 1.000000], should_transact=False) None¶
Create AnimNotifies at the provided Frames in the database using the given track name and class
- Parameters:
database (AnimDatabase)
anim_notify_track_name (Name)
frames (AnimDatabaseFrames)
color (LinearColor)
should_transact (bool)
- classmethod database_add_anim_notify_object(database, track_name, anim_notify, frames, color=[1.000000, 0.000000, 0.000000, 1.000000], should_transact=False) None¶
Create AnimNotifies at the provided Frames from a duplicate of the given AnimNotify
- Parameters:
database (AnimDatabase)
track_name (Name)
anim_notify (AnimNotify)
frames (AnimDatabaseFrames)
color (LinearColor)
should_transact (bool)
- classmethod database_add_anim_notify_objects(database, anim_notify_track_names, anim_notifies, frames, colors, should_transact=False) None¶
Create AnimNotifies at the provided Frames in the database using the given track names and duplicates of the given AnimNotifies
- Parameters:
database (AnimDatabase)
anim_notifies (Array[AnimNotify])
frames (Array[AnimDatabaseFrames])
colors (Array[LinearColor])
should_transact (bool)
- classmethod database_add_anim_notify_state(database, anim_notify_state_track_name, class_, frame_ranges, color=[1.000000, 0.000000, 0.000000, 1.000000], should_transact=False) None¶
Create AnimNotifyStates at the provided FrameRanges in the database using the given track name and class
- Parameters:
database (AnimDatabase)
anim_notify_state_track_name (Name)
frame_ranges (AnimDatabaseFrameRanges)
color (LinearColor)
should_transact (bool)
- classmethod database_add_anim_notify_state_object(database, track_name, anim_notify_state, frame_ranges, color=[1.000000, 0.000000, 0.000000, 1.000000], should_transact=False) None¶
Create AnimNotifyStates at the provided FrameRanges from a duplicate of the given AnimNotifyState
- Parameters:
database (AnimDatabase)
track_name (Name)
anim_notify_state (AnimNotifyState)
frame_ranges (AnimDatabaseFrameRanges)
color (LinearColor)
should_transact (bool)
- classmethod database_add_anim_notify_state_objects(database, anim_notify_state_track_names, anim_notify_states, frame_ranges, colors, should_transact=False) None¶
Create AnimNotifyStates at the provided FrameRanges in the database using the given track names and duplicates of the given AnimNotifyStates
- Parameters:
database (AnimDatabase)
anim_notify_states (Array[AnimNotifyState])
frame_ranges (Array[AnimDatabaseFrameRanges])
colors (Array[LinearColor])
should_transact (bool)
- classmethod database_add_anim_notify_states(database, anim_notify_state_track_names, classes, frame_ranges, colors, should_transact=False) None¶
Create AnimNotifyStates at the provided FrameRanges in the database using the given track names and classes
- Parameters:
database (AnimDatabase)
frame_ranges (Array[AnimDatabaseFrameRanges])
colors (Array[LinearColor])
should_transact (bool)
- classmethod database_add_curve(database, curve_name, float_frame_attribute, color=[1.000000, 0.000000, 0.000000, 1.000000], sparse_keys=False, should_transact=False) None¶
Write the provided float frame attribute back to the animations in the database with the given curve name
- Parameters:
database (AnimDatabase)
curve_name (Name)
float_frame_attribute (AnimDatabaseFrameAttribute)
color (LinearColor)
sparse_keys (bool)
should_transact (bool)
- classmethod database_add_curves(database, curve_names, float_frame_attributes, colors, sparse_keys=False, should_transact=False) None¶
Write the provided float frame attributes back to the animations in the database with the given curve names
- Parameters:
database (AnimDatabase)
float_frame_attributes (Array[AnimDatabaseFrameAttribute])
colors (Array[LinearColor])
sparse_keys (bool)
should_transact (bool)
- classmethod database_add_sync_marker(database, sync_marker_track_name, sync_marker_name, frames, color=[1.000000, 0.000000, 0.000000, 1.000000], should_transact=False) None¶
Create SyncMarkers at the provided Frames in the database using the given track name and sync marker name
- Parameters:
database (AnimDatabase)
sync_marker_track_name (Name)
sync_marker_name (Name)
frames (AnimDatabaseFrames)
color (LinearColor)
should_transact (bool)
- classmethod database_add_sync_markers(database, sync_marker_track_names, sync_marker_names, frames, colors, should_transact=False) None¶
Create SyncMarkers at the provided Frames in the database using the given track names and sync marker names
- Parameters:
database (AnimDatabase)
frames (Array[AnimDatabaseFrames])
colors (Array[LinearColor])
should_transact (bool)
- classmethod database_export_as_anim_sequences(database, frame_ranges, path, asset_name_format_string, export_mirrored, should_transact=False) None¶
Exports the given frame ranges in the database as AnimSequences into the provided path
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
path (DirectoryPath)
asset_name_format_string (str)
export_mirrored (bool)
should_transact (bool)
- classmethod database_export_as_bvh(database, frame_ranges, path, add_root_axes_change_rotation=True, rotation_order=AnimDatabaseRotationOrder.XYZ) None¶
Exports the given frame ranges in the database as BVH files into the provided directory
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
path (DirectoryPath)
add_root_axes_change_rotation (bool)
rotation_order (AnimDatabaseRotationOrder)
- classmethod database_export_notifies(database, frame_ranges, path) None¶
Exports all AnimNotifies and AnimNotifyStates as JSON
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
path (FilePath)
- classmethod database_export_root_motion(database, frame_ranges, path) None¶
Exports the root motion of given frame ranges in the database as a JSON file
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
path (FilePath)
- classmethod database_import_from_bvh(database, import_path, asset_path, remove_root_axes_change_rotation=True, add_to_database=True, ignore_mirrored=False) None¶
Imports all the BVH files from the given ImportPath directory into the AssetPath directory and adds them to the database
- Parameters:
database (AnimDatabase)
import_path (DirectoryPath)
asset_path (DirectoryPath)
remove_root_axes_change_rotation (bool)
add_to_database (bool)
ignore_mirrored (bool)
- classmethod database_import_notifies(database, frame_ranges, path) None¶
Imports AnimNotifies and AnimNotifyStates from a JSON file
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
path (FilePath)
- classmethod database_make_looped(database, frame_ranges, start_end_ratio, blend_in_time, blend_out_time, should_transact=False) None¶
Makes the given ranges looped in the database
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
start_end_ratio (float)
blend_in_time (float)
blend_out_time (float)
should_transact (bool)
- classmethod database_patch_ranges(database, frame_ranges, apply_to_root, bone_indices, should_transact=False) None¶
Patches the given ranges for the provided bones with a simple interpolation
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
apply_to_root (bool)
bone_indices (Array[int32])
should_transact (bool)
- classmethod database_remove_anim_notifies_from_track(database, frame_ranges, anim_notify_track_name, should_transact=False) None¶
Remove all the anim notifies on a given track
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
anim_notify_track_name (Name)
should_transact (bool)
- classmethod database_remove_anim_notifies_from_tracks(database, frame_ranges, anim_notify_track_names, should_transact=False) None¶
Remove all the anim notifies from the given tracks
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
should_transact (bool)
- classmethod database_remove_foot_ground_penetration(database, frame_ranges, left_toe_bone, right_toe_bone, toe_bone_length, pelvis_height_adjustment=-1.000000, left_knee_side_vector=[0.000000, 0.000000, 1.000000], right_knee_side_vector=[0.000000, 0.000000, 1.000000], left_toe_forward_vector=[-1.000000, 0.000000, 0.000000], right_toe_forward_vector=[-1.000000, 0.000000, 0.000000], should_transact=False) None¶
Removes foot ground penetration in the database
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
left_toe_bone (Name)
right_toe_bone (Name)
toe_bone_length (float)
pelvis_height_adjustment (float)
left_knee_side_vector (Vector)
right_knee_side_vector (Vector)
left_toe_forward_vector (Vector)
right_toe_forward_vector (Vector)
should_transact (bool)
- classmethod database_remove_notifies(database, frame_ranges) None¶
Removes all AnimNotifies and AnimNotifyStates from the given frame ranges
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
- classmethod database_remove_sync_marker_from_track(database, frame_ranges, sync_marker_track_name, should_transact=False) None¶
Remove all the sync markers on a given track
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
sync_marker_track_name (Name)
should_transact (bool)
- classmethod database_remove_sync_marker_from_tracks(database, frame_ranges, sync_marker_track_names, should_transact=False) None¶
Remove all the sync markers from the given tracks
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
should_transact (bool)
- classmethod database_reset_bone_transform(database, frame_ranges, bone_name, should_transact=False) None¶
Set the given bone’s local transforms in the database to the reference pose
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
bone_name (Name)
should_transact (bool)
- classmethod database_reset_bone_transforms(database, frame_ranges, bone_names, should_transact=False) None¶
Set the given bones’ local transforms in the database to the reference pose
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
should_transact (bool)
- classmethod database_set_global_bone_transform(database, bone_name, transform_frame_attribute, should_transact=False) None¶
Set the given bone’s global transform in the database at the given transform frame attribute
- Parameters:
database (AnimDatabase)
bone_name (Name)
transform_frame_attribute (AnimDatabaseFrameAttribute)
should_transact (bool)
- classmethod database_set_global_bone_transforms(database, bone_names, transform_frame_attributes, should_transact=False) None¶
Set the given bones’ global transforms in the database at the given transform frame attributes
- Parameters:
database (AnimDatabase)
transform_frame_attributes (Array[AnimDatabaseFrameAttribute])
should_transact (bool)
- classmethod database_set_local_bone_transform(database, bone_name, transform_frame_attribute, should_transact=False) None¶
Set the given bone’s local transform in the database at the given transform frame attribute
- Parameters:
database (AnimDatabase)
bone_name (Name)
transform_frame_attribute (AnimDatabaseFrameAttribute)
should_transact (bool)
- classmethod database_set_local_bone_transforms(database, bone_names, transform_frame_attributes, should_transact=False) None¶
Set the given bones’ local transforms in the database at the given transform frame attributes
- Parameters:
database (AnimDatabase)
transform_frame_attributes (Array[AnimDatabaseFrameAttribute])
should_transact (bool)
- classmethod database_set_to_reference_pose(database, frame_ranges, apply_to_root, ignore_bone_indices, should_transact=False) None¶
Sets the given ranges to the reference pose, with the exception of the provided IgnoreBoneIndices
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
apply_to_root (bool)
ignore_bone_indices (Array[int32])
should_transact (bool)
- classmethod database_strip_unused_bone_tracks(database, frame_ranges, should_transact=False) None¶
Strips unused bone tracks from the data to reduce the file size on disk
- Parameters:
database (AnimDatabase)
frame_ranges (AnimDatabaseFrameRanges)
should_transact (bool)
- classmethod enable_root_motion_and_force_root_lock_on_sequences(sequences) None¶
Enables root motion and force root lock on the given animation sequences
- Parameters:
sequences (Array[AnimSequence])
- classmethod get_anim_sequence_anim_notify_classes(anim_sequence) Array[type(Class)]¶
Gets all the AnimNotify classes present in a given AnimSequence
- Parameters:
anim_sequence (AnimSequence)
- Returns:
out_classes (Array[type(Class)]):
- Return type:
- classmethod get_anim_sequence_anim_notify_state_classes(anim_sequence) Array[type(Class)]¶
Gets all the AnimNotifyState classes present in a given AnimSequence
- Parameters:
anim_sequence (AnimSequence)
- Returns:
out_classes (Array[type(Class)]):
- Return type:
- classmethod get_anim_sequence_anim_notify_state_times_and_durations(class_, anim_sequence) -> (out_times=Array[float], out_durations=Array[float])¶
Gets the times and durations of each AnimNotifyState of the given class, in the given sequence
- Parameters:
anim_sequence (AnimSequence)
- Returns:
out_times (Array[float]):
out_durations (Array[float]):
- Return type:
tuple
- classmethod get_anim_sequence_anim_notify_times(class_, anim_sequence) Array[float]¶
Gets the times of each AnimNotify of the given class, in the given sequence
- Parameters:
anim_sequence (AnimSequence)
- Returns:
out_times (Array[float]):
- Return type:
- classmethod remove_all_anim_notifies_and_anim_notify_states_from_sequence(anim_sequence) None¶
Removes all AnimNotifies and AnimNotifyStates from a sequence
- Parameters:
anim_sequence (AnimSequence)