Class reference
AnimationLibrary
Inherits Resource
Container for Animation resources.
Description
An animation library stores a set of animations accessible through StringName keys, for use with AnimationPlayer nodes.
Methods
int add_animation(StringName name, Animation animation)
int add_animation(StringName name, Animation animation)Adds the animation to the library, accessible by the key name.
Animation get_animation(StringName name) const
Animation get_animation(StringName name) constReturns the Animation with the key name. If the animation does not exist, null is returned and an error is logged.
StringName[] get_animation_list() const
Returns the keys for the Animations stored in the library.
int get_animation_list_size() const
int get_animation_list_size() constReturns the key count for the Animations stored in the library.
bool has_animation(StringName name) const
bool has_animation(StringName name) constReturns true if the library stores an Animation with name as the key.
void remove_animation(StringName name)
StringName name)Removes the Animation with the key name.
void rename_animation(StringName name, StringName newname)
StringName name, StringName newname)Changes the key of the Animation associated with the key name to newname.
Signals
animation_added(StringName name)
StringName name)Emitted when an Animation is added, under the key name.
animation_changed(StringName name)
StringName name)Emitted when there's a change in one of the animations, e.g. tracks are added, moved or have changed paths. name is the key of the animation that was changed. See also Resource.changed, which this acts as a relay for.
animation_removed(StringName name)
StringName name)Emitted when an Animation stored with the key name is removed.
animation_renamed(StringName name, StringName to_name)
StringName name, StringName to_name)Emitted when the key for an Animation is changed, from name to to_name.