unreal.AnimInstance
¶
- class unreal.AnimInstance(outer=None, name='None')¶
Bases:
unreal.Object
Anim Instance
C++ Source:
Module: Engine
File: AnimInstance.h
Editor Properties: (see get_editor_property/set_editor_property)
on_all_montage_instances_ended
(OnAllMontageInstancesEndedMCDelegate): [Read-Write] Called when all Montage instances have ended.on_montage_blending_out
(OnMontageBlendingOutStartedMCDelegate): [Read-Write] Called when a montage starts blending out, whether interrupted or finishedon_montage_ended
(OnMontageEndedMCDelegate): [Read-Write] Called when a montage has ended, whether interrupted or finishedon_montage_started
(OnMontageStartedMCDelegate): [Read-Write] Called when a montage has startedpropagate_notifies_to_linked_instances
(bool): [Read-Write] Whether to propagate notifies to any linked anim instancesreceive_notifies_from_linked_instances
(bool): [Read-Write] Whether to process notifies from any linked anim instancesroot_motion_mode
(RootMotionMode): [Read-Write] Sets where this blueprint pulls Root Motion from
- blueprint_linked_animation_layers_initialized() → None¶
Executed when the all Linked Animation Layers are initialized
- blueprint_update_animation(delta_time_x) → None¶
Executed when the Animation is updated
- Parameters
delta_time_x (float) –
- calculate_direction(velocity, base_rotation) → float¶
Returns degree of the angle betwee velocity and Rotation forward vector The range of return will be from [-180, 180], and this can be used to feed blendspace directional value
- clear_layer_overlay(class_)¶
deprecated: ‘clear_layer_overlay’ was renamed to ‘unlink_anim_class_layers’.
- get_active_curve_names(curve_type)¶
This returns last up-to-date list of active curve names
- Parameters
curve_type (AnimCurveType) –
- Returns
out_names (Array(Name)):
- Return type
- get_all_curve_names()¶
This returns all curve names
- get_current_active_montage() → AnimMontage¶
- Get a current Active Montage in this AnimInstance.
Note that there might be multiple Active at the same time. This will only return the first active one it finds. *
- Returns
- Return type
- get_layer_sub_instance_by_class(class_)¶
deprecated: ‘get_layer_sub_instance_by_class’ was renamed to ‘get_linked_anim_layer_instance_by_class’.
- get_layer_sub_instance_by_group(group)¶
deprecated: ‘get_layer_sub_instance_by_group’ was renamed to ‘get_linked_anim_layer_instance_by_group’.
- get_linked_anim_graph_instance_by_tag(tag) → AnimInstance¶
Runs through all nodes, attempting to find the first linked instance by name/tag
- Parameters
tag (Name) –
- Returns
- Return type
- get_linked_anim_graph_instances_by_tag(tag)¶
Runs through all nodes, attempting to find all linked instances that match the name/tag
- Parameters
tag (Name) –
- Returns
out_linked_instances (Array(AnimInstance)):
- Return type
- get_linked_anim_layer_instance_by_class(class_) → AnimInstance¶
Gets the first layer linked instance corresponding to the specified class
- Parameters
- Returns
- Return type
- get_linked_anim_layer_instance_by_group(group) → AnimInstance¶
Gets the layer linked instance corresponding to the specified group
- Parameters
group (Name) –
- Returns
- Return type
- get_linked_anim_layer_instance_by_group_and_class(group, class_) → AnimInstance¶
Gets layer linked instance that matches group and class
- Parameters
- Returns
- Return type
- get_linked_anim_layer_instances_by_group(group)¶
Runs through all nodes, attempting to find all distinct layer linked instances in the group
- Parameters
group (Name) –
- Returns
out_linked_instances (Array(AnimInstance)):
- Return type
- get_owning_component() → SkeletalMeshComponent¶
Returns the skeletal mesh component that has created this AnimInstance
- Returns
- Return type
- get_propagate_notifies_to_linked_instances() → bool¶
Get whether to propagate notifies to any linked anim instances
- Returns
- Return type
- get_receive_notifies_from_linked_instances() → bool¶
Get whether to process notifies from any linked anim instances
- Returns
- Return type
- get_sub_instance_by_tag(tag)¶
deprecated: ‘get_sub_instance_by_tag’ was renamed to ‘get_linked_anim_graph_instance_by_tag’.
- get_sub_instances_by_tag(tag)¶
deprecated: ‘get_sub_instances_by_tag’ was renamed to ‘get_linked_anim_graph_instances_by_tag’.
- get_sync_group_position(sync_group_name) → MarkerSyncAnimPosition¶
Get Sync Group Position
- Parameters
sync_group_name (Name) –
- Returns
- Return type
- get_time_to_closest_marker(sync_group, marker_name) → float or None¶
— AI communication end —
- is_any_montage_playing() → bool¶
Returns true if any montage is playing currently. Doesn’t mean it’s active though, it could be blending out.
- Returns
- Return type
- is_playing_slot_animation(asset, slot_node_name) → bool¶
Return true if it’s playing the slot animation
- Parameters
asset (AnimSequenceBase) –
slot_node_name (Name) –
- Returns
- Return type
- is_sync_group_between_markers(sync_group_name, previous_marker, next_marker, respect_marker_order=True) → bool¶
Is Sync Group Between Markers
- kismet_initialize_animation()¶
deprecated: ‘kismet_initialize_animation’ was renamed to ‘blueprint_initialize_animation’.
- kismet_update_animation(delta_time_x)¶
deprecated: ‘kismet_update_animation’ was renamed to ‘blueprint_update_animation’.
- link_anim_class_layers(class_) → None¶
Runs through all layer nodes, attempting to find layer nodes that are implemented by the specified class, then sets up a linked instance of the class for each. Allocates one linked instance to run each of the groups specified in the class, so state is shared. If a layer is not grouped (ie. NAME_None), then state is not shared and a separate linked instance is allocated for each layer node. If InClass is null, then all layers are reset to their defaults.
- link_anim_graph_by_tag(tag, class_) → None¶
Runs through all nodes, attempting to find a linked instance by name/tag, then sets the class of each node if the tag matches
- lock_ai_resources(lock_movement, lock_ai_logic) → None¶
- locks indicated AI resources of animated pawn
DEPRECATED. Use LockAIResourcesWithAnimation instead
deprecated: Use LockAIResourcesWithAnimation instead
- montage_get_blend_time(montage) → float¶
- Get the current blend time of the Montage.
If Montage reference is NULL, it will return the current blend time on the first active Montage found.
- Parameters
montage (AnimMontage) –
- Returns
- Return type
- montage_get_current_section(montage=None) → Name¶
Returns the name of the current animation montage section.
- Parameters
montage (AnimMontage) –
- Returns
- Return type
- montage_get_is_stopped(montage) → bool¶
return true if Montage is not currently active. (not valid or blending out)
- Parameters
montage (AnimMontage) –
- Returns
- Return type
- montage_get_play_rate(montage) → float¶
- Get PlayRate for Montage.
If Montage reference is NULL, PlayRate for any Active Montage will be returned. If Montage is not playing, 0 is returned.
- Parameters
montage (AnimMontage) –
- Returns
- Return type
- montage_get_position(montage) → float¶
Get Current Montage Position
- Parameters
montage (AnimMontage) –
- Returns
- Return type
- montage_is_active(montage) → bool¶
Returns true if the animation montage is active. If the Montage reference is NULL, it will return true if any Montage is active.
- Parameters
montage (AnimMontage) –
- Returns
- Return type
- montage_is_playing(montage) → bool¶
- Returns true if the animation montage is currently active and playing.
If reference is NULL, it will return true is ANY montage is currently active and playing.
- Parameters
montage (AnimMontage) –
- Returns
- Return type
- montage_jump_to_section(section_name, montage=None) → None¶
Makes a montage jump to a named section. If Montage reference is NULL, it will do that to all active montages.
- Parameters
section_name (Name) –
montage (AnimMontage) –
- montage_jump_to_sections_end(section_name, montage=None) → None¶
Makes a montage jump to the end of a named section. If Montage reference is NULL, it will do that to all active montages.
- Parameters
section_name (Name) –
montage (AnimMontage) –
- montage_pause(montage=None) → None¶
Pauses the animation montage. If reference is NULL, it will pause ALL active montages.
- Parameters
montage (AnimMontage) –
- montage_play(montage_to_play, play_rate=1.0, return_value_type=MontagePlayReturnType.MONTAGE_LENGTH, time_to_start_montage_at=0.0, stop_all_montages=True) → float¶
Plays an animation montage. Returns the length of the animation montage in seconds. Returns 0.f if failed to play.
- Parameters
montage_to_play (AnimMontage) –
play_rate (float) –
return_value_type (MontagePlayReturnType) –
time_to_start_montage_at (float) –
stop_all_montages (bool) –
- Returns
- Return type
- montage_resume(montage) → None¶
Resumes a paused animation montage. If reference is NULL, it will resume ALL active montages.
- Parameters
montage (AnimMontage) –
- montage_set_next_section(section_name_to_change, next_section, montage=None) → None¶
- Relink new next section AFTER SectionNameToChange in run-time
You can link section order the way you like in editor, but in run-time if you’d like to change it dynamically, use this function to relink the next section For example, you can have Start->Loop->Loop->Loop…. but when you want it to end, you can relink next section of Loop to be End to finish the montage, in which case, it stops looping by Loop->End.
- Parameters
section_name_to_change (Name) – : This should be the name of the Montage Section after which you want to insert a new next section
next_section (Name) – : new next section
montage (AnimMontage) –
- montage_set_play_rate(montage, new_play_rate=1.0) → None¶
Change AnimMontage play rate. NewPlayRate = 1.0 is the default playback rate.
- Parameters
montage (AnimMontage) –
new_play_rate (float) –
- montage_set_position(montage, new_position) → None¶
Set position.
- Parameters
montage (AnimMontage) –
new_position (float) –
- montage_stop(blend_out_time, montage=None) → None¶
Stops the animation montage. If reference is NULL, it will stop ALL active montages.
- Parameters
blend_out_time (float) –
montage (AnimMontage) –
- montage_stop_group_by_name(blend_out_time, group_name) → None¶
Stops all active montages belonging to a group.
- property on_all_montage_instances_ended¶
[Read-Write] Called when all Montage instances have ended.
- property on_montage_blending_out¶
[Read-Write] Called when a montage starts blending out, whether interrupted or finished
- property on_montage_ended¶
[Read-Write] Called when a montage has ended, whether interrupted or finished
- Type
- property on_montage_started¶
[Read-Write] Called when a montage has started
- Type
- play_slot_animation(asset, slot_node_name, blend_in_time=0.25, blend_out_time=0.25, play_rate=1.0, loop_count=1) → float¶
Play Slot Animation
- play_slot_animation_as_dynamic_montage(asset, slot_node_name, blend_in_time=0.25, blend_out_time=0.25, play_rate=1.0, loop_count=1, blend_out_trigger_time=- 1.0, time_to_start_montage_at=0.0) → AnimMontage¶
Play normal animation asset on the slot node by creating a dynamic UAnimMontage. You can only play one asset (whether montage or animsequence) at a time per SlotGroup.
- Parameters
- Returns
- Return type
- reset_dynamics(teleport_type) → None¶
Reset any dynamics running simulation-style updates (e.g. on teleport, time skip etc.)
- Parameters
teleport_type (TeleportType) –
- save_pose_snapshot(snapshot_name) → None¶
Takes a snapshot of the current skeletal mesh component pose & saves it internally. This snapshot can then be retrieved by name in the animation blueprint for blending. The snapshot is taken at the current LOD, so if for example you took the snapshot at LOD1 and then used it at LOD0 any bones not in LOD1 will use the reference pose
- Parameters
snapshot_name (Name) –
- set_layer_overlay(class_)¶
deprecated: ‘set_layer_overlay’ was renamed to ‘link_anim_class_layers’.
- set_propagate_notifies_to_linked_instances(set) → None¶
Set whether to propagate notifies to any linked anim instances
- Parameters
set (bool) –
- set_receive_notifies_from_linked_instances(set) → None¶
Set whether to process notifies from any linked anim instances
- Parameters
set (bool) –
- set_root_motion_mode(value) → None¶
Set RootMotionMode
- Parameters
value (RootMotionMode) –
- set_sub_instance_class_by_tag(tag, class_)¶
deprecated: ‘set_sub_instance_class_by_tag’ was renamed to ‘link_anim_graph_by_tag’.
- snapshot_pose(snapshot) → PoseSnapshot¶
Takes a snapshot of the current skeletal mesh component pose and saves it to the specified snapshot. The snapshot is taken at the current LOD, so if for example you took the snapshot at LOD1 and then used it at LOD0 any bones not in LOD1 will use the reference pose
- Parameters
snapshot (PoseSnapshot) –
- Returns
snapshot (PoseSnapshot):
- Return type
- stop_slot_animation(blend_out_time=0.25, slot_node_name='None') → None¶
Stops currently playing slot animation slot or all
- unlink_anim_class_layers(class_) → None¶
Runs through all layer nodes, attempting to find layer nodes that are currently running the specified class, then resets each to its default value. State sharing rules are as with SetLayerOverlay. If InClass is null, does nothing.