W3cubDocs

/Godot 3.2

AnimationTreePlayer

Inherits: Node < Object

Deprecated. Animation player that uses a node graph for blending animations. Superseded by AnimationTree.

Description

Deprecated. A node graph tool for blending multiple animations bound to an AnimationPlayer. Especially useful for animating characters or other skeleton-based rigs. It can combine several animations to form a desired pose.

It takes Animations from an AnimationPlayer node and mixes them depending on the graph.

See AnimationTree for a more full-featured replacement of this node.

Tutorials

Properties

bool active false
NodePath base_path NodePath("..")
NodePath master_player NodePath("")
AnimationProcessMode playback_process_mode 1

Methods

void add_node ( NodeType type, String id )
void advance ( float delta )
Animation animation_node_get_animation ( String id ) const
String animation_node_get_master_animation ( String id ) const
float animation_node_get_position ( String id ) const
void animation_node_set_animation ( String id, Animation animation )
void animation_node_set_filter_path ( String id, NodePath path, bool enable )
void animation_node_set_master_animation ( String id, String source )
bool are_nodes_connected ( String id, String dst_id, int dst_input_idx ) const
float blend2_node_get_amount ( String id ) const
void blend2_node_set_amount ( String id, float blend )
void blend2_node_set_filter_path ( String id, NodePath path, bool enable )
float blend3_node_get_amount ( String id ) const
void blend3_node_set_amount ( String id, float blend )
Vector2 blend4_node_get_amount ( String id ) const
void blend4_node_set_amount ( String id, Vector2 blend )
Error connect_nodes ( String id, String dst_id, int dst_input_idx )
void disconnect_nodes ( String id, int dst_input_idx )
PoolStringArray get_node_list ( )
float mix_node_get_amount ( String id ) const
void mix_node_set_amount ( String id, float ratio )
bool node_exists ( String node ) const
int node_get_input_count ( String id ) const
String node_get_input_source ( String id, int idx ) const
Vector2 node_get_position ( String id ) const
NodeType node_get_type ( String id ) const
Error node_rename ( String node, String new_name )
void node_set_position ( String id, Vector2 screen_position )
float oneshot_node_get_autorestart_delay ( String id ) const
float oneshot_node_get_autorestart_random_delay ( String id ) const
float oneshot_node_get_fadein_time ( String id ) const
float oneshot_node_get_fadeout_time ( String id ) const
bool oneshot_node_has_autorestart ( String id ) const
bool oneshot_node_is_active ( String id ) const
void oneshot_node_set_autorestart ( String id, bool enable )
void oneshot_node_set_autorestart_delay ( String id, float delay_sec )
void oneshot_node_set_autorestart_random_delay ( String id, float rand_sec )
void oneshot_node_set_fadein_time ( String id, float time_sec )
void oneshot_node_set_fadeout_time ( String id, float time_sec )
void oneshot_node_set_filter_path ( String id, NodePath path, bool enable )
void oneshot_node_start ( String id )
void oneshot_node_stop ( String id )
void recompute_caches ( )
void remove_node ( String id )
void reset ( )
float timescale_node_get_scale ( String id ) const
void timescale_node_set_scale ( String id, float scale )
void timeseek_node_seek ( String id, float seconds )
void transition_node_delete_input ( String id, int input_idx )
int transition_node_get_current ( String id ) const
int transition_node_get_input_count ( String id ) const
float transition_node_get_xfade_time ( String id ) const
bool transition_node_has_input_auto_advance ( String id, int input_idx ) const
void transition_node_set_current ( String id, int input_idx )
void transition_node_set_input_auto_advance ( String id, int input_idx, bool enable )
void transition_node_set_input_count ( String id, int count )
void transition_node_set_xfade_time ( String id, float time_sec )

Enumerations

enum NodeType:

  • NODE_OUTPUT = 0 --- Output node.
  • NODE_ANIMATION = 1 --- Animation node.
  • NODE_ONESHOT = 2 --- OneShot node.
  • NODE_MIX = 3 --- Mix node.
  • NODE_BLEND2 = 4 --- Blend2 node.
  • NODE_BLEND3 = 5 --- Blend3 node.
  • NODE_BLEND4 = 6 --- Blend4 node.
  • NODE_TIMESCALE = 7 --- TimeScale node.
  • NODE_TIMESEEK = 8 --- TimeSeek node.
  • NODE_TRANSITION = 9 --- Transition node.

enum AnimationProcessMode:

  • ANIMATION_PROCESS_PHYSICS = 0 --- Process animation during the physics process. This is especially useful when animating physics bodies.
  • ANIMATION_PROCESS_IDLE = 1 --- Process animation during the idle process.

Property Descriptions

bool active

Default false
Setter set_active(value)
Getter is_active()

If true, the AnimationTreePlayer is able to play animations.

NodePath base_path

Default NodePath("..")
Setter set_base_path(value)
Getter get_base_path()

The node from which to relatively access other nodes.

It accesses the bones, so it should point to the same node the AnimationPlayer would point its Root Node at.

NodePath master_player

Default NodePath("")
Setter set_master_player(value)
Getter get_master_player()

The path to the AnimationPlayer from which this AnimationTreePlayer binds animations to animation nodes.

Once set, Animation nodes can be added to the AnimationTreePlayer.

AnimationProcessMode playback_process_mode

Default 1
Setter set_animation_process_mode(value)
Getter get_animation_process_mode()

The thread in which to update animations.

Method Descriptions

void add_node ( NodeType type, String id )

Adds a type node to the graph with name id.

void advance ( float delta )

Shifts position in the animation timeline. delta is the time in seconds to shift. Events between the current frame and delta are handled.

Animation animation_node_get_animation ( String id ) const

Returns the AnimationPlayer's Animation bound to the AnimationTreePlayer's animation node with name id.

String animation_node_get_master_animation ( String id ) const

Returns the name of the master_player's Animation bound to this animation node.

float animation_node_get_position ( String id ) const

Returns the absolute playback timestamp of the animation node with name id.

void animation_node_set_animation ( String id, Animation animation )

Binds a new Animation from the master_player to the AnimationTreePlayer's animation node with name id.

void animation_node_set_filter_path ( String id, NodePath path, bool enable )

If enable is true, the animation node with ID id turns off the track modifying the property at path. The modified node's children continue to animate.

void animation_node_set_master_animation ( String id, String source )

Binds the Animation named source from master_player to the animation node id. Recalculates caches.

bool are_nodes_connected ( String id, String dst_id, int dst_input_idx ) const

Returns whether node id and dst_id are connected at the specified slot.

float blend2_node_get_amount ( String id ) const

Returns the blend amount of a Blend2 node given its name.

void blend2_node_set_amount ( String id, float blend )

Sets the blend amount of a Blend2 node given its name and value.

A Blend2 node blends two animations (A and B) with the amount between 0 and 1.

At 0, output is input A. Towards 1, the influence of A gets lessened, the influence of B gets raised. At 1, output is input B.

void blend2_node_set_filter_path ( String id, NodePath path, bool enable )

If enable is true, the Blend2 node with name id turns off the track modifying the property at path. The modified node's children continue to animate.

float blend3_node_get_amount ( String id ) const

Returns the blend amount of a Blend3 node given its name.

void blend3_node_set_amount ( String id, float blend )

Sets the blend amount of a Blend3 node given its name and value.

A Blend3 Node blends three animations (A, B-, B+) with the amount between -1 and 1.

At -1, output is input B-. From -1 to 0, the influence of B- gets lessened, the influence of A gets raised and the influence of B+ is 0. At 0, output is input A. From 0 to 1, the influence of A gets lessened, the influence of B+ gets raised and the influence of B+ is 0. At 1, output is input B+.

Vector2 blend4_node_get_amount ( String id ) const

Returns the blend amount of a Blend4 node given its name.

void blend4_node_set_amount ( String id, Vector2 blend )

Sets the blend amount of a Blend4 node given its name and value.

A Blend4 Node blends two pairs of animations.

The two pairs are blended like Blend2 and then added together.

Error connect_nodes ( String id, String dst_id, int dst_input_idx )

Connects node id to dst_id at the specified input slot.

void disconnect_nodes ( String id, int dst_input_idx )

Disconnects nodes connected to id at the specified input slot.

PoolStringArray get_node_list ( )

Returns a PoolStringArray containing the name of all nodes.

float mix_node_get_amount ( String id ) const

Returns the mix amount of a Mix node given its name.

void mix_node_set_amount ( String id, float ratio )

Sets the mix amount of a Mix node given its name and value.

A Mix node adds input b to input a by the amount given by ratio.

bool node_exists ( String node ) const

Check if a node exists (by name).

int node_get_input_count ( String id ) const

Returns the input count for a given node. Different types of nodes have different amount of inputs.

String node_get_input_source ( String id, int idx ) const

Returns the input source for a given node input.

Vector2 node_get_position ( String id ) const

Returns position of a node in the graph given its name.

NodeType node_get_type ( String id ) const

Gets the node type, will return from NodeType enum.

Error node_rename ( String node, String new_name )

Renames a node in the graph.

void node_set_position ( String id, Vector2 screen_position )

Sets the position of a node in the graph given its name and position.

float oneshot_node_get_autorestart_delay ( String id ) const

Returns the autostart delay of a OneShot node given its name.

float oneshot_node_get_autorestart_random_delay ( String id ) const

Returns the autostart random delay of a OneShot node given its name.

float oneshot_node_get_fadein_time ( String id ) const

Returns the fade in time of a OneShot node given its name.

float oneshot_node_get_fadeout_time ( String id ) const

Returns the fade out time of a OneShot node given its name.

bool oneshot_node_has_autorestart ( String id ) const

Returns whether a OneShot node will auto restart given its name.

bool oneshot_node_is_active ( String id ) const

Returns whether a OneShot node is active given its name.

void oneshot_node_set_autorestart ( String id, bool enable )

Sets the autorestart property of a OneShot node given its name and value.

void oneshot_node_set_autorestart_delay ( String id, float delay_sec )

Sets the autorestart delay of a OneShot node given its name and value in seconds.

void oneshot_node_set_autorestart_random_delay ( String id, float rand_sec )

Sets the autorestart random delay of a OneShot node given its name and value in seconds.

void oneshot_node_set_fadein_time ( String id, float time_sec )

Sets the fade in time of a OneShot node given its name and value in seconds.

void oneshot_node_set_fadeout_time ( String id, float time_sec )

Sets the fade out time of a OneShot node given its name and value in seconds.

void oneshot_node_set_filter_path ( String id, NodePath path, bool enable )

If enable is true, the OneShot node with ID id turns off the track modifying the property at path. The modified node's children continue to animate.

void oneshot_node_start ( String id )

Starts a OneShot node given its name.

void oneshot_node_stop ( String id )

Stops the OneShot node with name id.

void recompute_caches ( )

Manually recalculates the cache of track information generated from animation nodes. Needed when external sources modify the animation nodes' state.

void remove_node ( String id )

Removes the animation node with name id.

void reset ( )

Resets this AnimationTreePlayer.

float timescale_node_get_scale ( String id ) const

Returns the time scale value of the TimeScale node with name id.

void timescale_node_set_scale ( String id, float scale )

Sets the time scale of the TimeScale node with name id to scale.

The TimeScale node is used to speed Animations up if the scale is above 1 or slow them down if it is below 1.

If applied after a blend or mix, affects all input animations to that blend or mix.

void timeseek_node_seek ( String id, float seconds )

Sets the time seek value of the TimeSeek node with name id to seconds.

This functions as a seek in the Animation or the blend or mix of Animations input in it.

void transition_node_delete_input ( String id, int input_idx )

Deletes the input at input_idx for the transition node with name id.

int transition_node_get_current ( String id ) const

Returns the index of the currently evaluated input for the transition node with name id.

int transition_node_get_input_count ( String id ) const

Returns the number of inputs for the transition node with name id. You can add inputs by right-clicking on the transition node.

float transition_node_get_xfade_time ( String id ) const

Returns the cross fade time for the transition node with name id.

bool transition_node_has_input_auto_advance ( String id, int input_idx ) const

Returns true if the input at input_idx on the transition node with name id is set to automatically advance to the next input upon completion.

void transition_node_set_current ( String id, int input_idx )

The transition node with name id sets its current input at input_idx.

void transition_node_set_input_auto_advance ( String id, int input_idx, bool enable )

The transition node with name id advances to its next input automatically when the input at input_idx completes.

void transition_node_set_input_count ( String id, int count )

Resizes the number of inputs available for the transition node with name id.

void transition_node_set_xfade_time ( String id, float time_sec )

The transition node with name id sets its cross fade time to time_sec.

© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/3.2/classes/class_animationtreeplayer.html