2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2021-11-05 14:02:42 +00:00
<class name= "Animation" inherits= "Resource" version= "3.5" >
2017-09-12 20:42:36 +00:00
<brief_description >
Contains data used to animate everything in the engine.
</brief_description>
<description >
An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track.
2018-10-03 02:35:59 +00:00
[codeblock]
# This creates an animation that makes the node "Enemy" move to the right by
2020-07-29 08:13:44 +00:00
# 100 pixels in 0.5 seconds.
2018-10-03 02:35:59 +00:00
var animation = Animation.new()
var track_index = animation.add_track(Animation.TYPE_VALUE)
2020-07-29 08:13:44 +00:00
animation.track_set_path(track_index, "Enemy:position:x")
2018-10-03 02:35:59 +00:00
animation.track_insert_key(track_index, 0.0, 0)
animation.track_insert_key(track_index, 0.5, 100)
[/codeblock]
2020-03-03 18:21:21 +00:00
Animations are just data containers, and must be added to nodes such as an [AnimationPlayer] or [AnimationTreePlayer] to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check [enum TrackType] to see available types.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
2021-11-15 16:11:20 +00:00
<link > $DOCS_URL/tutorials/animation/index.html</link>
2017-09-12 20:42:36 +00:00
</tutorials>
<methods >
<method name= "add_track" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
<argument index= "0" name= "type" type= "int" enum= "Animation.TrackType" />
<argument index= "1" name= "at_position" type= "int" default= "-1" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Adds a track to the Animation.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-06-11 16:41:16 +00:00
<method name= "animation_track_get_key_animation" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "String" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Returns the animation name at the key identified by [code]key_idx[/code]. The [code]track_idx[/code] must be the index of an Animation Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "animation_track_insert_key" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time" type= "float" />
<argument index= "2" name= "animation" type= "String" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Inserts a key with value [code]animation[/code] at the given [code]time[/code] (in seconds). The [code]track_idx[/code] must be the index of an Animation Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "animation_track_set_key_animation" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
<argument index= "2" name= "animation" type= "String" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Sets the key identified by [code]key_idx[/code] to value [code]animation[/code]. The [code]track_idx[/code] must be the index of an Animation Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "audio_track_get_key_end_offset" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "float" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Returns the end offset of the key identified by [code]key_idx[/code]. The [code]track_idx[/code] must be the index of an Audio Track.
End offset is the number of seconds cut off at the ending of the audio stream.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "audio_track_get_key_start_offset" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "float" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Returns the start offset of the key identified by [code]key_idx[/code]. The [code]track_idx[/code] must be the index of an Audio Track.
Start offset is the number of seconds cut off at the beginning of the audio stream.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "audio_track_get_key_stream" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Resource" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Returns the audio stream of the key identified by [code]key_idx[/code]. The [code]track_idx[/code] must be the index of an Audio Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "audio_track_insert_key" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time" type= "float" />
<argument index= "2" name= "stream" type= "Resource" />
<argument index= "3" name= "start_offset" type= "float" default= "0" />
<argument index= "4" name= "end_offset" type= "float" default= "0" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Inserts an Audio Track key at the given [code]time[/code] in seconds. The [code]track_idx[/code] must be the index of an Audio Track.
[code]stream[/code] is the [AudioStream] resource to play. [code]start_offset[/code] is the number of seconds cut off at the beginning of the audio stream, while [code]end_offset[/code] is at the ending.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "audio_track_set_key_end_offset" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
<argument index= "2" name= "offset" type= "float" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Sets the end offset of the key identified by [code]key_idx[/code] to value [code]offset[/code]. The [code]track_idx[/code] must be the index of an Audio Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "audio_track_set_key_start_offset" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
<argument index= "2" name= "offset" type= "float" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Sets the start offset of the key identified by [code]key_idx[/code] to value [code]offset[/code]. The [code]track_idx[/code] must be the index of an Audio Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "audio_track_set_key_stream" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
<argument index= "2" name= "stream" type= "Resource" />
2018-06-11 16:41:16 +00:00
<description >
2021-01-12 00:55:14 +00:00
Sets the stream of the key identified by [code]key_idx[/code] to value [code]stream[/code]. The [code]track_idx[/code] must be the index of an Audio Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "bezier_track_get_key_in_handle" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Vector2" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Returns the in handle of the key identified by [code]key_idx[/code]. The [code]track_idx[/code] must be the index of a Bezier Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "bezier_track_get_key_out_handle" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Vector2" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Returns the out handle of the key identified by [code]key_idx[/code]. The [code]track_idx[/code] must be the index of a Bezier Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "bezier_track_get_key_value" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "float" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Returns the value of the key identified by [code]key_idx[/code]. The [code]track_idx[/code] must be the index of a Bezier Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "bezier_track_insert_key" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time" type= "float" />
<argument index= "2" name= "value" type= "float" />
<argument index= "3" name= "in_handle" type= "Vector2" default= "Vector2( 0, 0 )" />
<argument index= "4" name= "out_handle" type= "Vector2" default= "Vector2( 0, 0 )" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Inserts a Bezier Track key at the given [code]time[/code] in seconds. The [code]track_idx[/code] must be the index of a Bezier Track.
[code]in_handle[/code] is the left-side weight of the added Bezier curve point, [code]out_handle[/code] is the right-side one, while [code]value[/code] is the actual value at this point.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "bezier_track_interpolate" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "float" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time" type= "float" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Returns the interpolated value at the given [code]time[/code] (in seconds). The [code]track_idx[/code] must be the index of a Bezier Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "bezier_track_set_key_in_handle" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
<argument index= "2" name= "in_handle" type= "Vector2" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Sets the in handle of the key identified by [code]key_idx[/code] to value [code]in_handle[/code]. The [code]track_idx[/code] must be the index of a Bezier Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "bezier_track_set_key_out_handle" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
<argument index= "2" name= "out_handle" type= "Vector2" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Sets the out handle of the key identified by [code]key_idx[/code] to value [code]out_handle[/code]. The [code]track_idx[/code] must be the index of a Bezier Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
<method name= "bezier_track_set_key_value" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
<argument index= "2" name= "value" type= "float" />
2018-06-11 16:41:16 +00:00
<description >
2020-03-03 18:21:21 +00:00
Sets the value of the key identified by [code]key_idx[/code] to the given value. The [code]track_idx[/code] must be the index of a Bezier Track.
2018-06-11 16:41:16 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "clear" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2017-09-12 20:42:36 +00:00
<description >
Clear the animation (clear all tracks and reset all).
</description>
</method>
2017-12-09 23:43:30 +00:00
<method name= "copy_track" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "to_animation" type= "Animation" />
2017-12-09 23:43:30 +00:00
<description >
2017-12-11 19:05:26 +00:00
Adds a new track that is a copy of the given track from [code]to_animation[/code].
2017-12-09 23:43:30 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "find_track" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
<argument index= "0" name= "path" type= "NodePath" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns the index of the specified track. If the track is not found, return -1.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_track_count" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns the amount of tracks in the animation.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "method_track_get_key_indices" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "PoolIntArray" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time_sec" type= "float" />
<argument index= "2" name= "delta" type= "float" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns all the key indices of a method track, given a position and delta time.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "method_track_get_name" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "String" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns the method name of a method track.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "method_track_get_params" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Array" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns the arguments values to be called on a method track for a given key in a given track.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "remove_track" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Removes a track by specifying the track index.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_find_key" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time" type= "float" />
<argument index= "2" name= "exact" type= "bool" default= "false" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Finds the key index by time in a given track. Optionally, only find it if the exact time is given.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_get_interpolation_loop_wrap" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
<argument index= "0" name= "track_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-29 13:24:23 +00:00
Returns [code]true[/code] if the track at [code]idx[/code] wraps the interpolation loop. New tracks wrap the interpolation loop by default.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_get_interpolation_type" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "Animation.InterpolationType" />
<argument index= "0" name= "track_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Returns the interpolation type of a given track.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_get_key_count" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
<argument index= "0" name= "track_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns the amount of keys in a given track.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_get_key_time" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "float" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns the time at which the key is located.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_get_key_transition" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "float" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Returns the transition curve (easing) for a specific key (see the built-in math function [method @GDScript.ease]).
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_get_key_value" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Variant" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns the value of a given key in a given track.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_get_path" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "NodePath" />
<argument index= "0" name= "track_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Gets the path of a track. For more information on the path format, see [method track_set_path].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_get_type" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "Animation.TrackType" />
<argument index= "0" name= "track_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Gets the type of a track.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_insert_key" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time" type= "float" />
<argument index= "2" name= "key" type= "Variant" />
<argument index= "3" name= "transition" type= "float" default= "1" />
2017-09-12 20:42:36 +00:00
<description >
Insert a generic key in a given track.
</description>
</method>
2017-12-09 23:43:30 +00:00
<method name= "track_is_enabled" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
<argument index= "0" name= "track_idx" type= "int" />
2017-12-09 23:43:30 +00:00
<description >
2017-12-11 19:05:26 +00:00
Returns [code]true[/code] if the track at index [code]idx[/code] is enabled.
2017-12-09 23:43:30 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "track_is_imported" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
<argument index= "0" name= "track_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns [code]true[/code] if the given track is imported. Else, return [code]false[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_move_down" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Moves a track down.
2017-09-12 20:42:36 +00:00
</description>
</method>
2019-05-25 16:01:44 +00:00
<method name= "track_move_to" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "to_idx" type= "int" />
2019-05-25 16:01:44 +00:00
<description >
Changes the index position of track [code]idx[/code] to the one defined in [code]to_idx[/code].
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "track_move_up" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Moves a track up.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_remove_key" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Removes a key by index in a given track.
2017-09-12 20:42:36 +00:00
</description>
</method>
2017-09-10 13:37:49 +00:00
<method name= "track_remove_key_at_position" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "position" type= "float" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Removes a key by position (seconds) in a given track.
2017-09-12 20:42:36 +00:00
</description>
</method>
2017-12-09 23:43:30 +00:00
<method name= "track_set_enabled" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "enabled" type= "bool" />
2017-12-09 23:43:30 +00:00
<description >
2017-12-16 19:34:16 +00:00
Enables/disables the given track. Tracks are enabled by default.
2017-12-09 23:43:30 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "track_set_imported" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "imported" type= "bool" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Sets the given track as imported or not.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_set_interpolation_loop_wrap" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "interpolation" type= "bool" />
2017-09-12 20:42:36 +00:00
<description >
2018-12-20 12:46:54 +00:00
If [code]true[/code], the track at [code]idx[/code] wraps the interpolation loop.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "track_set_interpolation_type" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "interpolation" type= "int" enum= "Animation.InterpolationType" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Sets the interpolation type of a given track.
2017-09-12 20:42:36 +00:00
</description>
</method>
2019-06-01 10:34:29 +00:00
<method name= "track_set_key_time" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
<argument index= "2" name= "time" type= "float" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Sets the time of an existing key.
2017-09-12 20:42:36 +00:00
</description>
</method>
2019-06-01 10:34:29 +00:00
<method name= "track_set_key_transition" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key_idx" type= "int" />
<argument index= "2" name= "transition" type= "float" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Sets the transition curve (easing) for a specific key (see the built-in math function [method @GDScript.ease]).
2017-09-12 20:42:36 +00:00
</description>
</method>
2019-06-01 10:34:29 +00:00
<method name= "track_set_key_value" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "key" type= "int" />
<argument index= "2" name= "value" type= "Variant" />
2019-05-30 22:39:00 +00:00
<description >
2019-06-21 23:04:47 +00:00
Sets the value of an existing key.
2019-05-30 22:39:00 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "track_set_path" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "path" type= "NodePath" />
2017-09-12 20:42:36 +00:00
<description >
2021-07-23 14:24:57 +00:00
Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by [code]":"[/code].
2019-06-21 23:04:47 +00:00
For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-06-11 16:41:16 +00:00
<method name= "track_swap" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "with_idx" type= "int" />
2018-06-11 16:41:16 +00:00
<description >
2019-05-25 16:01:44 +00:00
Swaps the track [code]idx[/code]'s index position with the track [code]with_idx[/code].
2018-06-11 16:41:16 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "transform_track_insert_key" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time" type= "float" />
<argument index= "2" name= "location" type= "Vector3" />
<argument index= "3" name= "rotation" type= "Quat" />
<argument index= "4" name= "scale" type= "Vector3" />
2017-09-12 20:42:36 +00:00
<description >
Insert a transform key for a transform track.
</description>
</method>
<method name= "transform_track_interpolate" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Array" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time_sec" type= "float" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position ([Vector3]), rotation ([Quat]) and scale ([Vector3]).
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "value_track_get_key_indices" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "PoolIntArray" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time_sec" type= "float" />
<argument index= "2" name= "delta" type= "float" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns all the key indices of a value track, given a position and delta time.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "value_track_get_update_mode" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "Animation.UpdateMode" />
<argument index= "0" name= "track_idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-05-24 02:15:43 +00:00
Returns the update mode of a value track.
2017-09-12 20:42:36 +00:00
</description>
</method>
2020-10-19 15:13:30 +00:00
<method name= "value_track_interpolate" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Variant" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "time_sec" type= "float" />
2017-09-12 20:42:36 +00:00
<description >
2020-10-19 15:13:30 +00:00
Returns the interpolated value at the given time (in seconds). The [code]track_idx[/code] must be the index of a value track.
2017-09-12 20:42:36 +00:00
</description>
</method>
2020-10-19 15:13:30 +00:00
<method name= "value_track_set_update_mode" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "track_idx" type= "int" />
<argument index= "1" name= "mode" type= "int" enum= "Animation.UpdateMode" />
2020-03-19 20:08:24 +00:00
<description >
2020-10-19 15:13:30 +00:00
Sets the update mode (see [enum UpdateMode]) of a value track.
2020-03-19 20:08:24 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
</methods>
2018-01-11 22:38:35 +00:00
<members >
2019-06-29 10:38:01 +00:00
<member name= "length" type= "float" setter= "set_length" getter= "get_length" default= "1.0" >
2019-06-21 23:04:47 +00:00
The total length of the animation (in seconds).
[b]Note:[/b] Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping.
2018-01-11 22:38:35 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "loop" type= "bool" setter= "set_loop" getter= "has_loop" default= "false" >
2021-03-18 11:04:28 +00:00
A flag indicating that the animation must loop. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation.
2018-01-11 22:38:35 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "step" type= "float" setter= "set_step" getter= "get_step" default= "0.1" >
2018-01-11 22:38:35 +00:00
The animation step value.
</member>
</members>
2019-02-16 13:40:52 +00:00
<signals >
<signal name= "tracks_changed" >
<description >
2020-03-03 18:21:21 +00:00
Emitted when there's a change in the list of tracks, e.g. tracks are added, moved or have changed paths.
2019-02-16 13:40:52 +00:00
</description>
</signal>
</signals>
2017-09-12 20:42:36 +00:00
<constants >
2017-11-24 22:16:30 +00:00
<constant name= "TYPE_VALUE" value= "0" enum= "TrackType" >
2017-09-12 20:42:36 +00:00
Value tracks set values in node properties, but only those which can be Interpolated.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "TYPE_TRANSFORM" value= "1" enum= "TrackType" >
2019-06-21 23:04:47 +00:00
Transform tracks are used to change node local transforms or skeleton pose bones. Transitions are interpolated.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "TYPE_METHOD" value= "2" enum= "TrackType" >
2017-09-12 20:42:36 +00:00
Method tracks call functions with given arguments per key.
</constant>
2018-06-11 16:41:16 +00:00
<constant name= "TYPE_BEZIER" value= "3" enum= "TrackType" >
2020-03-03 18:21:21 +00:00
Bezier tracks are used to interpolate a value using custom curves. They can also be used to animate sub-properties of vectors and colors (e.g. alpha value of a [Color]).
2018-06-11 16:41:16 +00:00
</constant>
<constant name= "TYPE_AUDIO" value= "4" enum= "TrackType" >
2020-03-03 18:21:21 +00:00
Audio tracks are used to play an audio stream with either type of [AudioStreamPlayer]. The stream can be trimmed and previewed in the animation.
2018-06-11 16:41:16 +00:00
</constant>
<constant name= "TYPE_ANIMATION" value= "5" enum= "TrackType" >
2020-03-03 18:21:21 +00:00
Animation tracks play animations in other [AnimationPlayer] nodes.
2018-06-11 16:41:16 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "INTERPOLATION_NEAREST" value= "0" enum= "InterpolationType" >
2017-09-12 20:42:36 +00:00
No interpolation (nearest value).
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "INTERPOLATION_LINEAR" value= "1" enum= "InterpolationType" >
2017-09-12 20:42:36 +00:00
Linear interpolation.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "INTERPOLATION_CUBIC" value= "2" enum= "InterpolationType" >
2017-09-12 20:42:36 +00:00
Cubic interpolation.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "UPDATE_CONTINUOUS" value= "0" enum= "UpdateMode" >
2017-09-12 20:42:36 +00:00
Update between keyframes.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "UPDATE_DISCRETE" value= "1" enum= "UpdateMode" >
2017-09-12 20:42:36 +00:00
Update at the keyframes and hold the value.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "UPDATE_TRIGGER" value= "2" enum= "UpdateMode" >
2017-09-12 20:42:36 +00:00
Update at the keyframes.
</constant>
2018-06-11 16:41:16 +00:00
<constant name= "UPDATE_CAPTURE" value= "3" enum= "UpdateMode" >
2020-03-03 18:21:21 +00:00
Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds.
2018-06-11 16:41:16 +00:00
</constant>
2017-09-12 20:42:36 +00:00
</constants>
</class>