Contains data used to animate everything in the engine.
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.
[codeblock]
# This creates an animation that makes the node "Enemy" move to the right by
# 100 pixels in 1 second.
var animation = Animation.new()
var track_index = animation.add_track(Animation.TYPE_VALUE)
animation.track_set_path(track_index, "Enemy:position.x")
animation.track_insert_key(track_index, 0.0, 0)
animation.track_insert_key(track_index, 0.5, 100)
[/codeblock]
Animations are just data containers, and must be added to nodes such as an [AnimationPlayer] or [AnimationTreePlayer] to be played back.
https://docs.godotengine.org/en/3.1/tutorials/animation/index.html
Add a track to the Animation. The track type must be specified as any of the values in the TYPE_* enumeration.
Clear the animation (clear all tracks and reset all).
Adds a new track that is a copy of the given track from [code]to_animation[/code].
Return the index of the specified track. If the track is not found, return -1.
Return the amount of tracks in the animation.
Return all the key indices of a method track, given a position and delta time.
Return the method name of a method track.
Return the arguments values to be called on a method track for a given key in a given track.
Remove a track by specifying the track index.
Find the key index by time in a given track. Optionally, only find it if the exact time is given.
Returns [code]true[/code] if the track at [code]idx[/code] wraps the interpolation loop. Default value: [code]true[/code].
Return the interpolation type of a given track, from the INTERPOLATION_* enum.
Return the amount of keys in a given track.
Return the time at which the key is located.
Return the transition curve (easing) for a specific key (see built-in math function "ease").
Return the value of a given key in a given track.
Get the path of a track. for more information on the path format, see [method track_set_path]
Get the type of a track.
Insert a generic key in a given track.
Returns [code]true[/code] if the track at index [code]idx[/code] is enabled.
Return [code]true[/code] if the given track is imported. Else, return [code]false[/code].
Move a track down.
Move a track up.
Remove a key by index in a given track.
Remove a key by position (seconds) in a given track.
Enables/disables the given track. Tracks are enabled by default.
Set the given track as imported or not.
If [code]true[/code], the track at [code]idx[/code] wraps the interpolation loop.
Set the interpolation type of a given track, from the INTERPOLATION_* enum.
Set the transition curve (easing) for a specific key (see built-in math function "ease").
Set the value of an existing key.
Set 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 ":".
[b]Example:[/b] "character/skeleton:ankle" or "character/mesh:transform/local".
Insert a transform key for a transform track.
Return 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]).
Return all the key indices of a value track, given a position and delta time.
Return the update mode of a value track.
Set the update mode (UPDATE_*) of a value track.
The total length of the animation (in seconds). Note that length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping.
A flag indicating that the animation must loop. This is uses for correct interpolation of animation cycles, and for hinting the player that it must restart the animation.
The animation step value.
Value tracks set values in node properties, but only those which can be Interpolated.
Transform tracks are used to change node local transforms or skeleton pose bones. Transitions are Interpolated.
Method tracks call functions with given arguments per key.
No interpolation (nearest value).
Linear interpolation.
Cubic interpolation.
Update between keyframes.
Update at the keyframes and hold the value.
Update at the keyframes.