classref: Sync with current master branch (44e399e)

This commit is contained in:
Godot Organization
2023-09-30 03:18:42 +00:00
parent 1ea4111adb
commit 60cec73bd7
14 changed files with 1135 additions and 844 deletions

View File

@@ -10,7 +10,7 @@
AnimationPlayer
===============
**Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
**Inherits:** :ref:`AnimationMixer<class_AnimationMixer>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
A node used for animation playback.
@@ -46,35 +46,23 @@ Properties
.. table::
:widths: auto
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` | |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`int<class_int>` | :ref:`audio_max_polyphony<class_AnimationPlayer_property_audio_max_polyphony>` | ``32`` |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`autoplay<class_AnimationPlayer_property_autoplay>` | ``""`` |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`current_animation<class_AnimationPlayer_property_current_animation>` | ``""`` |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`current_animation_length<class_AnimationPlayer_property_current_animation_length>` | |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`current_animation_position<class_AnimationPlayer_property_current_animation_position>` | |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` | :ref:`method_call_mode<class_AnimationPlayer_property_method_call_mode>` | ``0`` |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`movie_quit_on_finish<class_AnimationPlayer_property_movie_quit_on_finish>` | ``false`` |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`playback_active<class_AnimationPlayer_property_playback_active>` | |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`playback_default_blend_time<class_AnimationPlayer_property_playback_default_blend_time>` | ``0.0`` |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` | :ref:`playback_process_mode<class_AnimationPlayer_property_playback_process_mode>` | ``1`` |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`reset_on_save<class_AnimationPlayer_property_reset_on_save>` | ``true`` |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`root_node<class_AnimationPlayer_property_root_node>` | ``NodePath("..")`` |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` | ``1.0`` |
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
+-----------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`String<class_String>` | :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` | |
+-----------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`String<class_String>` | :ref:`autoplay<class_AnimationPlayer_property_autoplay>` | ``""`` |
+-----------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`String<class_String>` | :ref:`current_animation<class_AnimationPlayer_property_current_animation>` | ``""`` |
+-----------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`current_animation_length<class_AnimationPlayer_property_current_animation_length>` | |
+-----------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`current_animation_position<class_AnimationPlayer_property_current_animation_position>` | |
+-----------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`movie_quit_on_finish<class_AnimationPlayer_property_movie_quit_on_finish>` | ``false`` |
+-----------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`playback_default_blend_time<class_AnimationPlayer_property_playback_default_blend_time>` | ``0.0`` |
+-----------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` | ``1.0`` |
+-----------------------------+------------------------------------------------------------------------------------------------+-----------+
.. rst-class:: classref-reftable-group
@@ -84,63 +72,47 @@ Methods
.. table::
:widths: auto
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`_post_process_key_value<class_AnimationPlayer_method__post_process_key_value>` **(** :ref:`Animation<class_Animation>` animation, :ref:`int<class_int>` track, :ref:`Variant<class_Variant>` value, :ref:`Object<class_Object>` object, :ref:`int<class_int>` object_idx **)** |virtual| |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`add_animation_library<class_AnimationPlayer_method_add_animation_library>` **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationLibrary<class_AnimationLibrary>` library **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`advance<class_AnimationPlayer_method_advance>` **(** :ref:`float<class_float>` delta **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`StringName<class_StringName>` | :ref:`animation_get_next<class_AnimationPlayer_method_animation_get_next>` **(** :ref:`StringName<class_StringName>` anim_from **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`animation_set_next<class_AnimationPlayer_method_animation_set_next>` **(** :ref:`StringName<class_StringName>` anim_from, :ref:`StringName<class_StringName>` anim_to **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>` **(** **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_queue<class_AnimationPlayer_method_clear_queue>` **(** **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`StringName<class_StringName>` | :ref:`find_animation<class_AnimationPlayer_method_find_animation>` **(** :ref:`Animation<class_Animation>` animation **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`StringName<class_StringName>` | :ref:`find_animation_library<class_AnimationPlayer_method_find_animation_library>` **(** :ref:`Animation<class_Animation>` animation **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Animation<class_Animation>` | :ref:`get_animation<class_AnimationPlayer_method_get_animation>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationLibrary<class_AnimationLibrary>` | :ref:`get_animation_library<class_AnimationPlayer_method_get_animation_library>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`StringName[]<class_StringName>` | :ref:`get_animation_library_list<class_AnimationPlayer_method_get_animation_library_list>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_animation_list<class_AnimationPlayer_method_get_animation_list>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_blend_time<class_AnimationPlayer_method_get_blend_time>` **(** :ref:`StringName<class_StringName>` anim_from, :ref:`StringName<class_StringName>` anim_to **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playing_speed<class_AnimationPlayer_method_get_playing_speed>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_queue<class_AnimationPlayer_method_get_queue>` **(** **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_animation<class_AnimationPlayer_method_has_animation>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_animation_library<class_AnimationPlayer_method_has_animation_library>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationPlayer_method_is_playing>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`pause<class_AnimationPlayer_method_pause>` **(** **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimationPlayer_method_play>` **(** :ref:`StringName<class_StringName>` name="", :ref:`float<class_float>` custom_blend=-1, :ref:`float<class_float>` custom_speed=1.0, :ref:`bool<class_bool>` from_end=false **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>` **(** :ref:`StringName<class_StringName>` name="", :ref:`float<class_float>` custom_blend=-1 **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`queue<class_AnimationPlayer_method_queue>` **(** :ref:`StringName<class_StringName>` name **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_animation_library<class_AnimationPlayer_method_remove_animation_library>` **(** :ref:`StringName<class_StringName>` name **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_animation_library<class_AnimationPlayer_method_rename_animation_library>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` newname **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AnimationPlayer_method_seek>` **(** :ref:`float<class_float>` seconds, :ref:`bool<class_bool>` update=false **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_time<class_AnimationPlayer_method_set_blend_time>` **(** :ref:`StringName<class_StringName>` anim_from, :ref:`StringName<class_StringName>` anim_to, :ref:`float<class_float>` sec **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimationPlayer_method_stop>` **(** :ref:`bool<class_bool>` keep_state=false **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`StringName<class_StringName>` | :ref:`animation_get_next<class_AnimationPlayer_method_animation_get_next>` **(** :ref:`StringName<class_StringName>` animation_from **)** |const| |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`animation_set_next<class_AnimationPlayer_method_animation_set_next>` **(** :ref:`StringName<class_StringName>` animation_from, :ref:`StringName<class_StringName>` animation_to **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_queue<class_AnimationPlayer_method_clear_queue>` **(** **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_blend_time<class_AnimationPlayer_method_get_blend_time>` **(** :ref:`StringName<class_StringName>` animation_from, :ref:`StringName<class_StringName>` animation_to **)** |const| |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` | :ref:`get_method_call_mode<class_AnimationPlayer_method_get_method_call_mode>` **(** **)** |const| |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playing_speed<class_AnimationPlayer_method_get_playing_speed>` **(** **)** |const| |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` | :ref:`get_process_callback<class_AnimationPlayer_method_get_process_callback>` **(** **)** |const| |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_queue<class_AnimationPlayer_method_get_queue>` **(** **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`get_root<class_AnimationPlayer_method_get_root>` **(** **)** |const| |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationPlayer_method_is_playing>` **(** **)** |const| |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`pause<class_AnimationPlayer_method_pause>` **(** **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimationPlayer_method_play>` **(** :ref:`StringName<class_StringName>` name="", :ref:`float<class_float>` custom_blend=-1, :ref:`float<class_float>` custom_speed=1.0, :ref:`bool<class_bool>` from_end=false **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>` **(** :ref:`StringName<class_StringName>` name="", :ref:`float<class_float>` custom_blend=-1 **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`queue<class_AnimationPlayer_method_queue>` **(** :ref:`StringName<class_StringName>` name **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AnimationPlayer_method_seek>` **(** :ref:`float<class_float>` seconds, :ref:`bool<class_bool>` update=false, :ref:`bool<class_bool>` update_only=false **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_time<class_AnimationPlayer_method_set_blend_time>` **(** :ref:`StringName<class_StringName>` animation_from, :ref:`StringName<class_StringName>` animation_to, :ref:`float<class_float>` sec **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_method_call_mode<class_AnimationPlayer_method_set_method_call_mode>` **(** :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` mode **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_process_callback<class_AnimationPlayer_method_set_process_callback>` **(** :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` mode **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_root<class_AnimationPlayer_method_set_root>` **(** :ref:`NodePath<class_NodePath>` path **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimationPlayer_method_stop>` **(** :ref:`bool<class_bool>` keep_state=false **)** |
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
@@ -157,7 +129,7 @@ Signals
**animation_changed** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` new_name **)**
Emitted when a queued animation plays after the previous animation finished. See :ref:`queue<class_AnimationPlayer_method_queue>`.
Emitted when a queued animation plays after the previous animation finished. See also :ref:`queue<class_AnimationPlayer_method_queue>`.
\ **Note:** The signal is not emitted when the animation is changed via :ref:`play<class_AnimationPlayer_method_play>` or by an :ref:`AnimationTree<class_AnimationTree>`.
@@ -165,63 +137,13 @@ Emitted when a queued animation plays after the previous animation finished. See
----
.. _class_AnimationPlayer_signal_animation_finished:
.. _class_AnimationPlayer_signal_current_animation_changed:
.. rst-class:: classref-signal
**animation_finished** **(** :ref:`StringName<class_StringName>` anim_name **)**
**current_animation_changed** **(** :ref:`String<class_String>` name **)**
Notifies when an animation finished playing.
\ **Note:** This signal is not emitted if an animation is looping.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_signal_animation_libraries_updated:
.. rst-class:: classref-signal
**animation_libraries_updated** **(** **)**
Notifies when the animation libraries have changed.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_signal_animation_list_changed:
.. rst-class:: classref-signal
**animation_list_changed** **(** **)**
Notifies when an animation list is changed.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_signal_animation_started:
.. rst-class:: classref-signal
**animation_started** **(** :ref:`StringName<class_StringName>` anim_name **)**
Notifies when an animation starts playing.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_signal_caches_cleared:
.. rst-class:: classref-signal
**caches_cleared** **(** **)**
Notifies when the caches have been cleared, either automatically, or manually via :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>`.
Emitted when :ref:`current_animation<class_AnimationPlayer_property_current_animation>` changes.
.. rst-class:: classref-section-separator
@@ -244,7 +166,7 @@ enum **AnimationProcessCallback**:
:ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_PHYSICS** = ``0``
Process animation during physics frames (see :ref:`Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_INTERNAL_PHYSICS_PROCESS>`). This is especially useful when animating physics bodies.
For backward compatibility. See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS>`.
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_IDLE:
@@ -252,7 +174,7 @@ Process animation during physics frames (see :ref:`Node.NOTIFICATION_INTERNAL_PH
:ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_IDLE** = ``1``
Process animation during process frames (see :ref:`Node.NOTIFICATION_INTERNAL_PROCESS<class_Node_constant_NOTIFICATION_INTERNAL_PROCESS>`).
For backward compatibility. See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_IDLE>`.
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_MANUAL:
@@ -260,7 +182,7 @@ Process animation during process frames (see :ref:`Node.NOTIFICATION_INTERNAL_PR
:ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_MANUAL** = ``2``
Do not process animation. Use :ref:`advance<class_AnimationPlayer_method_advance>` to process the animation manually.
For backward compatibility. See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_MANUAL>`.
.. rst-class:: classref-item-separator
@@ -278,7 +200,7 @@ enum **AnimationMethodCallMode**:
:ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **ANIMATION_METHOD_CALL_DEFERRED** = ``0``
Batch method calls during the animation process, then do the calls after events are processed. This avoids bugs involving deleting nodes or modifying the AnimationPlayer while playing.
For backward compatibility. See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_DEFERRED<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_METHOD_DEFERRED>`.
.. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_IMMEDIATE:
@@ -286,7 +208,7 @@ Batch method calls during the animation process, then do the calls after events
:ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **ANIMATION_METHOD_CALL_IMMEDIATE** = ``1``
Make method calls immediately when reached in the animation.
For backward compatibility. See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE>`.
.. rst-class:: classref-section-separator
@@ -314,25 +236,6 @@ If playing, the current animation's key, otherwise, the animation last played. W
----
.. _class_AnimationPlayer_property_audio_max_polyphony:
.. rst-class:: classref-property
:ref:`int<class_int>` **audio_max_polyphony** = ``32``
.. rst-class:: classref-property-setget
- void **set_audio_max_polyphony** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_audio_max_polyphony** **(** **)**
The number of possible simultaneous sounds for each of the assigned AudioStreamPlayers.
For example, if this value is ``32`` and the animation has two audio tracks, the two :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`\ s assigned can play simultaneously up to ``32`` voices each.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_autoplay:
.. rst-class:: classref-property
@@ -401,23 +304,6 @@ The position (in seconds) of the currently playing animation.
----
.. _class_AnimationPlayer_property_method_call_mode:
.. rst-class:: classref-property
:ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **method_call_mode** = ``0``
.. rst-class:: classref-property-setget
- void **set_method_call_mode** **(** :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` value **)**
- :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **get_method_call_mode** **(** **)**
The call mode to use for Call Method tracks.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_movie_quit_on_finish:
.. rst-class:: classref-property
@@ -431,24 +317,7 @@ The call mode to use for Call Method tracks.
If ``true`` and the engine is running in Movie Maker mode (see :ref:`MovieWriter<class_MovieWriter>`), exits the engine with :ref:`SceneTree.quit<class_SceneTree_method_quit>` as soon as an animation is done playing in this **AnimationPlayer**. A message is printed when the engine quits for this reason.
\ **Note:** This obeys the same logic as the :ref:`animation_finished<class_AnimationPlayer_signal_animation_finished>` signal, so it will not quit the engine if the animation is set to be looping.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_playback_active:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **playback_active**
.. rst-class:: classref-property-setget
- void **set_active** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_active** **(** **)**
If ``true``, updates animations in response to process-related notifications.
\ **Note:** This obeys the same logic as the :ref:`AnimationMixer.animation_finished<class_AnimationMixer_signal_animation_finished>` signal, so it will not quit the engine if the animation is set to be looping.
.. rst-class:: classref-item-separator
@@ -471,59 +340,6 @@ The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 p
----
.. _class_AnimationPlayer_property_playback_process_mode:
.. rst-class:: classref-property
:ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **playback_process_mode** = ``1``
.. rst-class:: classref-property-setget
- void **set_process_callback** **(** :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` value **)**
- :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **get_process_callback** **(** **)**
The process notification in which to update animations.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_reset_on_save:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **reset_on_save** = ``true``
.. rst-class:: classref-property-setget
- void **set_reset_on_save_enabled** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_reset_on_save_enabled** **(** **)**
This is used by the editor. If set to ``true``, the scene will be saved with the effects of the reset animation (the animation with the key ``"RESET"``) applied as if it had been seeked to time 0, with the editor keeping the values that the scene had before saving.
This makes it more convenient to preview and edit animations in the editor, as changes to the scene will not be saved as long as they are set in the reset animation.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_root_node:
.. rst-class:: classref-property
:ref:`NodePath<class_NodePath>` **root_node** = ``NodePath("..")``
.. rst-class:: classref-property-setget
- void **set_root** **(** :ref:`NodePath<class_NodePath>` value **)**
- :ref:`NodePath<class_NodePath>` **get_root** **(** **)**
The node from which node path references will travel.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_speed_scale:
.. rst-class:: classref-property
@@ -548,49 +364,13 @@ If set to a negative value, the animation is played in reverse. If set to ``0``,
Method Descriptions
-------------------
.. _class_AnimationPlayer_method__post_process_key_value:
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **_post_process_key_value** **(** :ref:`Animation<class_Animation>` animation, :ref:`int<class_int>` track, :ref:`Variant<class_Variant>` value, :ref:`Object<class_Object>` object, :ref:`int<class_int>` object_idx **)** |virtual| |const|
A virtual function for processing after key getting during playback.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_add_animation_library:
.. rst-class:: classref-method
:ref:`Error<enum_@GlobalScope_Error>` **add_animation_library** **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationLibrary<class_AnimationLibrary>` library **)**
Adds ``library`` to the animation player, under the key ``name``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_advance:
.. rst-class:: classref-method
void **advance** **(** :ref:`float<class_float>` delta **)**
Shifts position in the animation timeline and immediately updates the animation. ``delta`` is the time in seconds to shift. Events between the current frame and ``delta`` are handled.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_animation_get_next:
.. rst-class:: classref-method
:ref:`StringName<class_StringName>` **animation_get_next** **(** :ref:`StringName<class_StringName>` anim_from **)** |const|
:ref:`StringName<class_StringName>` **animation_get_next** **(** :ref:`StringName<class_StringName>` animation_from **)** |const|
Returns the key of the animation which is queued to play after the ``anim_from`` animation.
Returns the key of the animation which is queued to play after the ``animation_from`` animation.
.. rst-class:: classref-item-separator
@@ -600,21 +380,9 @@ Returns the key of the animation which is queued to play after the ``anim_from``
.. rst-class:: classref-method
void **animation_set_next** **(** :ref:`StringName<class_StringName>` anim_from, :ref:`StringName<class_StringName>` anim_to **)**
void **animation_set_next** **(** :ref:`StringName<class_StringName>` animation_from, :ref:`StringName<class_StringName>` animation_to **)**
Triggers the ``anim_to`` animation when the ``anim_from`` animation completes.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_clear_caches:
.. rst-class:: classref-method
void **clear_caches** **(** **)**
**AnimationPlayer** caches animated nodes. It may not notice if a node disappears; :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>` forces it to update the cache again.
Triggers the ``animation_to`` animation when the ``animation_from`` animation completes.
.. rst-class:: classref-item-separator
@@ -632,85 +400,11 @@ Clears all queued, unplayed animations.
----
.. _class_AnimationPlayer_method_find_animation:
.. rst-class:: classref-method
:ref:`StringName<class_StringName>` **find_animation** **(** :ref:`Animation<class_Animation>` animation **)** |const|
Returns the key of ``animation`` or an empty :ref:`StringName<class_StringName>` if not found.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_find_animation_library:
.. rst-class:: classref-method
:ref:`StringName<class_StringName>` **find_animation_library** **(** :ref:`Animation<class_Animation>` animation **)** |const|
Returns the key for the :ref:`AnimationLibrary<class_AnimationLibrary>` that contains ``animation`` or an empty :ref:`StringName<class_StringName>` if not found.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_animation:
.. rst-class:: classref-method
:ref:`Animation<class_Animation>` **get_animation** **(** :ref:`StringName<class_StringName>` name **)** |const|
Returns the :ref:`Animation<class_Animation>` with the key ``name``. If the animation does not exist, ``null`` is returned and an error is logged.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_animation_library:
.. rst-class:: classref-method
:ref:`AnimationLibrary<class_AnimationLibrary>` **get_animation_library** **(** :ref:`StringName<class_StringName>` name **)** |const|
Returns the first :ref:`AnimationLibrary<class_AnimationLibrary>` with key ``name`` or ``null`` if not found.
To get the **AnimationPlayer**'s global animation library, use ``get_animation_library("")``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_animation_library_list:
.. rst-class:: classref-method
:ref:`StringName[]<class_StringName>` **get_animation_library_list** **(** **)** |const|
Returns the list of stored library keys.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_animation_list:
.. rst-class:: classref-method
:ref:`PackedStringArray<class_PackedStringArray>` **get_animation_list** **(** **)** |const|
Returns the list of stored animation keys.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_blend_time:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_blend_time** **(** :ref:`StringName<class_StringName>` anim_from, :ref:`StringName<class_StringName>` anim_to **)** |const|
:ref:`float<class_float>` **get_blend_time** **(** :ref:`StringName<class_StringName>` animation_from, :ref:`StringName<class_StringName>` animation_to **)** |const|
Returns the blend time (in seconds) between two animations, referenced by their keys.
@@ -718,6 +412,18 @@ Returns the blend time (in seconds) between two animations, referenced by their
----
.. _class_AnimationPlayer_method_get_method_call_mode:
.. rst-class:: classref-method
:ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **get_method_call_mode** **(** **)** |const|
For backward compatibility. See :ref:`AnimationCallbackModeMethod<enum_AnimationMixer_AnimationCallbackModeMethod>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_playing_speed:
.. rst-class:: classref-method
@@ -732,6 +438,18 @@ Returns a negative value if the current animation is playing backwards.
----
.. _class_AnimationPlayer_method_get_process_callback:
.. rst-class:: classref-method
:ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **get_process_callback** **(** **)** |const|
For backward compatibility. See :ref:`AnimationCallbackModeProcess<enum_AnimationMixer_AnimationCallbackModeProcess>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_queue:
.. rst-class:: classref-method
@@ -744,25 +462,13 @@ Returns a list of the animation keys that are currently queued to play.
----
.. _class_AnimationPlayer_method_has_animation:
.. _class_AnimationPlayer_method_get_root:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_animation** **(** :ref:`StringName<class_StringName>` name **)** |const|
:ref:`NodePath<class_NodePath>` **get_root** **(** **)** |const|
Returns ``true`` if the **AnimationPlayer** stores an :ref:`Animation<class_Animation>` with key ``name``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_has_animation_library:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_animation_library** **(** :ref:`StringName<class_StringName>` name **)** |const|
Returns ``true`` if the **AnimationPlayer** stores an :ref:`AnimationLibrary<class_AnimationLibrary>` with key ``name``.
For backward compatibility. See :ref:`AnimationMixer.root_node<class_AnimationMixer_property_root_node>`.
.. rst-class:: classref-item-separator
@@ -840,39 +546,17 @@ Queues an animation for playback once the current one is done.
----
.. _class_AnimationPlayer_method_remove_animation_library:
.. rst-class:: classref-method
void **remove_animation_library** **(** :ref:`StringName<class_StringName>` name **)**
Removes the :ref:`AnimationLibrary<class_AnimationLibrary>` associated with the key ``name``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_rename_animation_library:
.. rst-class:: classref-method
void **rename_animation_library** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` newname **)**
Moves the :ref:`AnimationLibrary<class_AnimationLibrary>` associated with the key ``name`` to the key ``newname``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_seek:
.. rst-class:: classref-method
void **seek** **(** :ref:`float<class_float>` seconds, :ref:`bool<class_bool>` update=false **)**
void **seek** **(** :ref:`float<class_float>` seconds, :ref:`bool<class_bool>` update=false, :ref:`bool<class_bool>` update_only=false **)**
Seeks the animation to the ``seconds`` point in time (in seconds). If ``update`` is ``true``, the animation updates too, otherwise it updates at process time. Events between the current frame and ``seconds`` are skipped.
\ **Note:** Seeking to the end of the animation doesn't emit :ref:`animation_finished<class_AnimationPlayer_signal_animation_finished>`. If you want to skip animation and emit the signal, use :ref:`advance<class_AnimationPlayer_method_advance>`.
If ``update_only`` is true, the method / audio / animation playback tracks will not be processed.
\ **Note:** Seeking to the end of the animation doesn't emit :ref:`AnimationMixer.animation_finished<class_AnimationMixer_signal_animation_finished>`. If you want to skip animation and emit the signal, use :ref:`AnimationMixer.advance<class_AnimationMixer_method_advance>`.
.. rst-class:: classref-item-separator
@@ -882,7 +566,7 @@ Seeks the animation to the ``seconds`` point in time (in seconds). If ``update``
.. rst-class:: classref-method
void **set_blend_time** **(** :ref:`StringName<class_StringName>` anim_from, :ref:`StringName<class_StringName>` anim_to, :ref:`float<class_float>` sec **)**
void **set_blend_time** **(** :ref:`StringName<class_StringName>` animation_from, :ref:`StringName<class_StringName>` animation_to, :ref:`float<class_float>` sec **)**
Specifies a blend time (in seconds) between two animations, referenced by their keys.
@@ -890,6 +574,42 @@ Specifies a blend time (in seconds) between two animations, referenced by their
----
.. _class_AnimationPlayer_method_set_method_call_mode:
.. rst-class:: classref-method
void **set_method_call_mode** **(** :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` mode **)**
For backward compatibility. See :ref:`AnimationCallbackModeMethod<enum_AnimationMixer_AnimationCallbackModeMethod>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_set_process_callback:
.. rst-class:: classref-method
void **set_process_callback** **(** :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` mode **)**
For backward compatibility. See :ref:`AnimationCallbackModeProcess<enum_AnimationMixer_AnimationCallbackModeProcess>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_set_root:
.. rst-class:: classref-method
void **set_root** **(** :ref:`NodePath<class_NodePath>` path **)**
For backward compatibility. See :ref:`AnimationMixer.root_node<class_AnimationMixer_property_root_node>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_stop:
.. rst-class:: classref-method