class_animationplayer.rst 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationPlayer.xml.
  6. .. _class_AnimationPlayer:
  7. AnimationPlayer
  8. ===============
  9. **Inherits:** :ref:`AnimationMixer<class_AnimationMixer>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A node used for animation playback.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. An animation player is used for general-purpose playback of animations. It contains a dictionary of :ref:`AnimationLibrary<class_AnimationLibrary>` resources and custom blend times between animation transitions.
  15. Some methods and properties use a single key to reference an animation directly. These keys are formatted as the key for the library, followed by a forward slash, then the key for the animation within the library, for example ``"movement/run"``. If the library's key is an empty string (known as the default library), the forward slash is omitted, being the same key used by the library.
  16. \ **AnimationPlayer** is better-suited than :ref:`Tween<class_Tween>` for more complex animations, for example ones with non-trivial timings. It can also be used over :ref:`Tween<class_Tween>` if the animation track editor is more convenient than doing it in code.
  17. Updating the target properties of animations occurs at the process frame.
  18. .. rst-class:: classref-introduction-group
  19. Tutorials
  20. ---------
  21. - :doc:`2D Sprite animation <../tutorials/2d/2d_sprite_animation>`
  22. - :doc:`Animation documentation index <../tutorials/animation/index>`
  23. - `Third Person Shooter (TPS) Demo <https://godotengine.org/asset-library/asset/2710>`__
  24. .. rst-class:: classref-reftable-group
  25. Properties
  26. ----------
  27. .. table::
  28. :widths: auto
  29. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  30. | :ref:`StringName<class_StringName>` | :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` | |
  31. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  32. | :ref:`StringName<class_StringName>` | :ref:`autoplay<class_AnimationPlayer_property_autoplay>` | ``&""`` |
  33. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  34. | :ref:`StringName<class_StringName>` | :ref:`current_animation<class_AnimationPlayer_property_current_animation>` | ``&""`` |
  35. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  36. | :ref:`float<class_float>` | :ref:`current_animation_length<class_AnimationPlayer_property_current_animation_length>` | |
  37. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  38. | :ref:`float<class_float>` | :ref:`current_animation_position<class_AnimationPlayer_property_current_animation_position>` | |
  39. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  40. | :ref:`bool<class_bool>` | :ref:`movie_quit_on_finish<class_AnimationPlayer_property_movie_quit_on_finish>` | ``false`` |
  41. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  42. | :ref:`bool<class_bool>` | :ref:`playback_auto_capture<class_AnimationPlayer_property_playback_auto_capture>` | ``true`` |
  43. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  44. | :ref:`float<class_float>` | :ref:`playback_auto_capture_duration<class_AnimationPlayer_property_playback_auto_capture_duration>` | ``-1.0`` |
  45. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  46. | :ref:`EaseType<enum_Tween_EaseType>` | :ref:`playback_auto_capture_ease_type<class_AnimationPlayer_property_playback_auto_capture_ease_type>` | ``0`` |
  47. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  48. | :ref:`TransitionType<enum_Tween_TransitionType>` | :ref:`playback_auto_capture_transition_type<class_AnimationPlayer_property_playback_auto_capture_transition_type>` | ``0`` |
  49. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  50. | :ref:`float<class_float>` | :ref:`playback_default_blend_time<class_AnimationPlayer_property_playback_default_blend_time>` | ``0.0`` |
  51. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  52. | :ref:`float<class_float>` | :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` | ``1.0`` |
  53. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  54. .. rst-class:: classref-reftable-group
  55. Methods
  56. -------
  57. .. table::
  58. :widths: auto
  59. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`StringName<class_StringName>` | :ref:`animation_get_next<class_AnimationPlayer_method_animation_get_next>`\ (\ animation_from\: :ref:`StringName<class_StringName>`\ ) |const| |
  61. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | |void| | :ref:`animation_set_next<class_AnimationPlayer_method_animation_set_next>`\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`\ ) |
  63. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | |void| | :ref:`clear_queue<class_AnimationPlayer_method_clear_queue>`\ (\ ) |
  65. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`float<class_float>` | :ref:`get_blend_time<class_AnimationPlayer_method_get_blend_time>`\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`\ ) |const| |
  67. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` | :ref:`get_method_call_mode<class_AnimationPlayer_method_get_method_call_mode>`\ (\ ) |const| |
  69. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`float<class_float>` | :ref:`get_playing_speed<class_AnimationPlayer_method_get_playing_speed>`\ (\ ) |const| |
  71. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` | :ref:`get_process_callback<class_AnimationPlayer_method_get_process_callback>`\ (\ ) |const| |
  73. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] | :ref:`get_queue<class_AnimationPlayer_method_get_queue>`\ (\ ) |
  75. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`NodePath<class_NodePath>` | :ref:`get_root<class_AnimationPlayer_method_get_root>`\ (\ ) |const| |
  77. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`float<class_float>` | :ref:`get_section_end_time<class_AnimationPlayer_method_get_section_end_time>`\ (\ ) |const| |
  79. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`float<class_float>` | :ref:`get_section_start_time<class_AnimationPlayer_method_get_section_start_time>`\ (\ ) |const| |
  81. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`bool<class_bool>` | :ref:`has_section<class_AnimationPlayer_method_has_section>`\ (\ ) |const| |
  83. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`is_animation_active<class_AnimationPlayer_method_is_animation_active>`\ (\ ) |const| |
  85. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationPlayer_method_is_playing>`\ (\ ) |const| |
  87. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | |void| | :ref:`pause<class_AnimationPlayer_method_pause>`\ (\ ) |
  89. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | |void| | :ref:`play<class_AnimationPlayer_method_play>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) |
  91. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | |void| | :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1\ ) |
  93. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | |void| | :ref:`play_section<class_AnimationPlayer_method_play_section>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1, custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) |
  95. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | |void| | :ref:`play_section_backwards<class_AnimationPlayer_method_play_section_backwards>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1, custom_blend\: :ref:`float<class_float>` = -1\ ) |
  97. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | |void| | :ref:`play_section_with_markers<class_AnimationPlayer_method_play_section_with_markers>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) |
  99. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | |void| | :ref:`play_section_with_markers_backwards<class_AnimationPlayer_method_play_section_with_markers_backwards>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1\ ) |
  101. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | |void| | :ref:`play_with_capture<class_AnimationPlayer_method_play_with_capture>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", duration\: :ref:`float<class_float>` = -1.0, custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false, trans_type\: :ref:`TransitionType<enum_Tween_TransitionType>` = 0, ease_type\: :ref:`EaseType<enum_Tween_EaseType>` = 0\ ) |
  103. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | |void| | :ref:`queue<class_AnimationPlayer_method_queue>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  105. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | |void| | :ref:`reset_section<class_AnimationPlayer_method_reset_section>`\ (\ ) |
  107. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | |void| | :ref:`seek<class_AnimationPlayer_method_seek>`\ (\ seconds\: :ref:`float<class_float>`, update\: :ref:`bool<class_bool>` = false, update_only\: :ref:`bool<class_bool>` = false\ ) |
  109. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | |void| | :ref:`set_blend_time<class_AnimationPlayer_method_set_blend_time>`\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`, sec\: :ref:`float<class_float>`\ ) |
  111. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | |void| | :ref:`set_method_call_mode<class_AnimationPlayer_method_set_method_call_mode>`\ (\ mode\: :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>`\ ) |
  113. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | |void| | :ref:`set_process_callback<class_AnimationPlayer_method_set_process_callback>`\ (\ mode\: :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>`\ ) |
  115. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | |void| | :ref:`set_root<class_AnimationPlayer_method_set_root>`\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |
  117. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | |void| | :ref:`set_section<class_AnimationPlayer_method_set_section>`\ (\ start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1\ ) |
  119. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | |void| | :ref:`set_section_with_markers<class_AnimationPlayer_method_set_section_with_markers>`\ (\ start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &""\ ) |
  121. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | |void| | :ref:`stop<class_AnimationPlayer_method_stop>`\ (\ keep_state\: :ref:`bool<class_bool>` = false\ ) |
  123. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. .. rst-class:: classref-section-separator
  125. ----
  126. .. rst-class:: classref-descriptions-group
  127. Signals
  128. -------
  129. .. _class_AnimationPlayer_signal_animation_changed:
  130. .. rst-class:: classref-signal
  131. **animation_changed**\ (\ old_name\: :ref:`StringName<class_StringName>`, new_name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationPlayer_signal_animation_changed>`
  132. Emitted when a queued animation plays after the previous animation finished. See also :ref:`queue()<class_AnimationPlayer_method_queue>`.
  133. \ **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>`.
  134. .. rst-class:: classref-item-separator
  135. ----
  136. .. _class_AnimationPlayer_signal_current_animation_changed:
  137. .. rst-class:: classref-signal
  138. **current_animation_changed**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationPlayer_signal_current_animation_changed>`
  139. Emitted when :ref:`current_animation<class_AnimationPlayer_property_current_animation>` changes.
  140. .. rst-class:: classref-section-separator
  141. ----
  142. .. rst-class:: classref-descriptions-group
  143. Enumerations
  144. ------------
  145. .. _enum_AnimationPlayer_AnimationProcessCallback:
  146. .. rst-class:: classref-enumeration
  147. enum **AnimationProcessCallback**: :ref:`🔗<enum_AnimationPlayer_AnimationProcessCallback>`
  148. .. _class_AnimationPlayer_constant_ANIMATION_PROCESS_PHYSICS:
  149. .. rst-class:: classref-enumeration-constant
  150. :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_PHYSICS** = ``0``
  151. **Deprecated:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS>`.
  152. .. _class_AnimationPlayer_constant_ANIMATION_PROCESS_IDLE:
  153. .. rst-class:: classref-enumeration-constant
  154. :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_IDLE** = ``1``
  155. **Deprecated:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_IDLE>`.
  156. .. _class_AnimationPlayer_constant_ANIMATION_PROCESS_MANUAL:
  157. .. rst-class:: classref-enumeration-constant
  158. :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_MANUAL** = ``2``
  159. **Deprecated:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_MANUAL>`.
  160. .. rst-class:: classref-item-separator
  161. ----
  162. .. _enum_AnimationPlayer_AnimationMethodCallMode:
  163. .. rst-class:: classref-enumeration
  164. enum **AnimationMethodCallMode**: :ref:`🔗<enum_AnimationPlayer_AnimationMethodCallMode>`
  165. .. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_DEFERRED:
  166. .. rst-class:: classref-enumeration-constant
  167. :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **ANIMATION_METHOD_CALL_DEFERRED** = ``0``
  168. **Deprecated:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_DEFERRED<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_METHOD_DEFERRED>`.
  169. .. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_IMMEDIATE:
  170. .. rst-class:: classref-enumeration-constant
  171. :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **ANIMATION_METHOD_CALL_IMMEDIATE** = ``1``
  172. **Deprecated:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE>`.
  173. .. rst-class:: classref-section-separator
  174. ----
  175. .. rst-class:: classref-descriptions-group
  176. Property Descriptions
  177. ---------------------
  178. .. _class_AnimationPlayer_property_assigned_animation:
  179. .. rst-class:: classref-property
  180. :ref:`StringName<class_StringName>` **assigned_animation** :ref:`🔗<class_AnimationPlayer_property_assigned_animation>`
  181. .. rst-class:: classref-property-setget
  182. - |void| **set_assigned_animation**\ (\ value\: :ref:`StringName<class_StringName>`\ )
  183. - :ref:`StringName<class_StringName>` **get_assigned_animation**\ (\ )
  184. If playing, the current animation's key, otherwise, the animation last played. When set, this changes the animation, but will not play it unless already playing. See also :ref:`current_animation<class_AnimationPlayer_property_current_animation>`.
  185. .. rst-class:: classref-item-separator
  186. ----
  187. .. _class_AnimationPlayer_property_autoplay:
  188. .. rst-class:: classref-property
  189. :ref:`StringName<class_StringName>` **autoplay** = ``&""`` :ref:`🔗<class_AnimationPlayer_property_autoplay>`
  190. .. rst-class:: classref-property-setget
  191. - |void| **set_autoplay**\ (\ value\: :ref:`StringName<class_StringName>`\ )
  192. - :ref:`StringName<class_StringName>` **get_autoplay**\ (\ )
  193. The key of the animation to play when the scene loads.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_AnimationPlayer_property_current_animation:
  197. .. rst-class:: classref-property
  198. :ref:`StringName<class_StringName>` **current_animation** = ``&""`` :ref:`🔗<class_AnimationPlayer_property_current_animation>`
  199. .. rst-class:: classref-property-setget
  200. - |void| **set_current_animation**\ (\ value\: :ref:`StringName<class_StringName>`\ )
  201. - :ref:`StringName<class_StringName>` **get_current_animation**\ (\ )
  202. The key of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See :ref:`play()<class_AnimationPlayer_method_play>` for more information on playing animations.
  203. \ **Note:** While this property appears in the Inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see :ref:`Animation<class_Animation>`.
  204. .. rst-class:: classref-item-separator
  205. ----
  206. .. _class_AnimationPlayer_property_current_animation_length:
  207. .. rst-class:: classref-property
  208. :ref:`float<class_float>` **current_animation_length** :ref:`🔗<class_AnimationPlayer_property_current_animation_length>`
  209. .. rst-class:: classref-property-setget
  210. - :ref:`float<class_float>` **get_current_animation_length**\ (\ )
  211. The length (in seconds) of the currently playing animation.
  212. .. rst-class:: classref-item-separator
  213. ----
  214. .. _class_AnimationPlayer_property_current_animation_position:
  215. .. rst-class:: classref-property
  216. :ref:`float<class_float>` **current_animation_position** :ref:`🔗<class_AnimationPlayer_property_current_animation_position>`
  217. .. rst-class:: classref-property-setget
  218. - :ref:`float<class_float>` **get_current_animation_position**\ (\ )
  219. The position (in seconds) of the currently playing animation.
  220. .. rst-class:: classref-item-separator
  221. ----
  222. .. _class_AnimationPlayer_property_movie_quit_on_finish:
  223. .. rst-class:: classref-property
  224. :ref:`bool<class_bool>` **movie_quit_on_finish** = ``false`` :ref:`🔗<class_AnimationPlayer_property_movie_quit_on_finish>`
  225. .. rst-class:: classref-property-setget
  226. - |void| **set_movie_quit_on_finish_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  227. - :ref:`bool<class_bool>` **is_movie_quit_on_finish_enabled**\ (\ )
  228. 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.
  229. \ **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.
  230. .. rst-class:: classref-item-separator
  231. ----
  232. .. _class_AnimationPlayer_property_playback_auto_capture:
  233. .. rst-class:: classref-property
  234. :ref:`bool<class_bool>` **playback_auto_capture** = ``true`` :ref:`🔗<class_AnimationPlayer_property_playback_auto_capture>`
  235. .. rst-class:: classref-property-setget
  236. - |void| **set_auto_capture**\ (\ value\: :ref:`bool<class_bool>`\ )
  237. - :ref:`bool<class_bool>` **is_auto_capture**\ (\ )
  238. If ``true``, performs :ref:`AnimationMixer.capture()<class_AnimationMixer_method_capture>` before playback automatically. This means just :ref:`play_with_capture()<class_AnimationPlayer_method_play_with_capture>` is executed with default arguments instead of :ref:`play()<class_AnimationPlayer_method_play>`.
  239. \ **Note:** Capture interpolation is only performed if the animation contains a capture track. See also :ref:`Animation.UPDATE_CAPTURE<class_Animation_constant_UPDATE_CAPTURE>`.
  240. .. rst-class:: classref-item-separator
  241. ----
  242. .. _class_AnimationPlayer_property_playback_auto_capture_duration:
  243. .. rst-class:: classref-property
  244. :ref:`float<class_float>` **playback_auto_capture_duration** = ``-1.0`` :ref:`🔗<class_AnimationPlayer_property_playback_auto_capture_duration>`
  245. .. rst-class:: classref-property-setget
  246. - |void| **set_auto_capture_duration**\ (\ value\: :ref:`float<class_float>`\ )
  247. - :ref:`float<class_float>` **get_auto_capture_duration**\ (\ )
  248. See also :ref:`play_with_capture()<class_AnimationPlayer_method_play_with_capture>` and :ref:`AnimationMixer.capture()<class_AnimationMixer_method_capture>`.
  249. If :ref:`playback_auto_capture_duration<class_AnimationPlayer_property_playback_auto_capture_duration>` is negative value, the duration is set to the interval between the current position and the first key.
  250. .. rst-class:: classref-item-separator
  251. ----
  252. .. _class_AnimationPlayer_property_playback_auto_capture_ease_type:
  253. .. rst-class:: classref-property
  254. :ref:`EaseType<enum_Tween_EaseType>` **playback_auto_capture_ease_type** = ``0`` :ref:`🔗<class_AnimationPlayer_property_playback_auto_capture_ease_type>`
  255. .. rst-class:: classref-property-setget
  256. - |void| **set_auto_capture_ease_type**\ (\ value\: :ref:`EaseType<enum_Tween_EaseType>`\ )
  257. - :ref:`EaseType<enum_Tween_EaseType>` **get_auto_capture_ease_type**\ (\ )
  258. The ease type of the capture interpolation. See also :ref:`EaseType<enum_Tween_EaseType>`.
  259. .. rst-class:: classref-item-separator
  260. ----
  261. .. _class_AnimationPlayer_property_playback_auto_capture_transition_type:
  262. .. rst-class:: classref-property
  263. :ref:`TransitionType<enum_Tween_TransitionType>` **playback_auto_capture_transition_type** = ``0`` :ref:`🔗<class_AnimationPlayer_property_playback_auto_capture_transition_type>`
  264. .. rst-class:: classref-property-setget
  265. - |void| **set_auto_capture_transition_type**\ (\ value\: :ref:`TransitionType<enum_Tween_TransitionType>`\ )
  266. - :ref:`TransitionType<enum_Tween_TransitionType>` **get_auto_capture_transition_type**\ (\ )
  267. The transition type of the capture interpolation. See also :ref:`TransitionType<enum_Tween_TransitionType>`.
  268. .. rst-class:: classref-item-separator
  269. ----
  270. .. _class_AnimationPlayer_property_playback_default_blend_time:
  271. .. rst-class:: classref-property
  272. :ref:`float<class_float>` **playback_default_blend_time** = ``0.0`` :ref:`🔗<class_AnimationPlayer_property_playback_default_blend_time>`
  273. .. rst-class:: classref-property-setget
  274. - |void| **set_default_blend_time**\ (\ value\: :ref:`float<class_float>`\ )
  275. - :ref:`float<class_float>` **get_default_blend_time**\ (\ )
  276. The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision.
  277. .. rst-class:: classref-item-separator
  278. ----
  279. .. _class_AnimationPlayer_property_speed_scale:
  280. .. rst-class:: classref-property
  281. :ref:`float<class_float>` **speed_scale** = ``1.0`` :ref:`🔗<class_AnimationPlayer_property_speed_scale>`
  282. .. rst-class:: classref-property-setget
  283. - |void| **set_speed_scale**\ (\ value\: :ref:`float<class_float>`\ )
  284. - :ref:`float<class_float>` **get_speed_scale**\ (\ )
  285. The speed scaling ratio. For example, if this value is ``1``, then the animation plays at normal speed. If it's ``0.5``, then it plays at half speed. If it's ``2``, then it plays at double speed.
  286. If set to a negative value, the animation is played in reverse. If set to ``0``, the animation will not advance.
  287. .. rst-class:: classref-section-separator
  288. ----
  289. .. rst-class:: classref-descriptions-group
  290. Method Descriptions
  291. -------------------
  292. .. _class_AnimationPlayer_method_animation_get_next:
  293. .. rst-class:: classref-method
  294. :ref:`StringName<class_StringName>` **animation_get_next**\ (\ animation_from\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_AnimationPlayer_method_animation_get_next>`
  295. Returns the key of the animation which is queued to play after the ``animation_from`` animation.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_AnimationPlayer_method_animation_set_next:
  299. .. rst-class:: classref-method
  300. |void| **animation_set_next**\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationPlayer_method_animation_set_next>`
  301. Triggers the ``animation_to`` animation when the ``animation_from`` animation completes.
  302. .. rst-class:: classref-item-separator
  303. ----
  304. .. _class_AnimationPlayer_method_clear_queue:
  305. .. rst-class:: classref-method
  306. |void| **clear_queue**\ (\ ) :ref:`🔗<class_AnimationPlayer_method_clear_queue>`
  307. Clears all queued, unplayed animations.
  308. .. rst-class:: classref-item-separator
  309. ----
  310. .. _class_AnimationPlayer_method_get_blend_time:
  311. .. rst-class:: classref-method
  312. :ref:`float<class_float>` **get_blend_time**\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_blend_time>`
  313. Returns the blend time (in seconds) between two animations, referenced by their keys.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_AnimationPlayer_method_get_method_call_mode:
  317. .. rst-class:: classref-method
  318. :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **get_method_call_mode**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_method_call_mode>`
  319. **Deprecated:** Use :ref:`AnimationMixer.callback_mode_method<class_AnimationMixer_property_callback_mode_method>` instead.
  320. Returns the call mode used for "Call Method" tracks.
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _class_AnimationPlayer_method_get_playing_speed:
  324. .. rst-class:: classref-method
  325. :ref:`float<class_float>` **get_playing_speed**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_playing_speed>`
  326. Returns the actual playing speed of current animation or ``0`` if not playing. This speed is the :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play()<class_AnimationPlayer_method_play>` method.
  327. Returns a negative value if the current animation is playing backwards.
  328. .. rst-class:: classref-item-separator
  329. ----
  330. .. _class_AnimationPlayer_method_get_process_callback:
  331. .. rst-class:: classref-method
  332. :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **get_process_callback**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_process_callback>`
  333. **Deprecated:** Use :ref:`AnimationMixer.callback_mode_process<class_AnimationMixer_property_callback_mode_process>` instead.
  334. Returns the process notification in which to update animations.
  335. .. rst-class:: classref-item-separator
  336. ----
  337. .. _class_AnimationPlayer_method_get_queue:
  338. .. rst-class:: classref-method
  339. :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] **get_queue**\ (\ ) :ref:`🔗<class_AnimationPlayer_method_get_queue>`
  340. Returns a list of the animation keys that are currently queued to play.
  341. .. rst-class:: classref-item-separator
  342. ----
  343. .. _class_AnimationPlayer_method_get_root:
  344. .. rst-class:: classref-method
  345. :ref:`NodePath<class_NodePath>` **get_root**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_root>`
  346. **Deprecated:** Use :ref:`AnimationMixer.root_node<class_AnimationMixer_property_root_node>` instead.
  347. Returns the node which node path references will travel from.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_AnimationPlayer_method_get_section_end_time:
  351. .. rst-class:: classref-method
  352. :ref:`float<class_float>` **get_section_end_time**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_section_end_time>`
  353. Returns the end time of the section currently being played.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_AnimationPlayer_method_get_section_start_time:
  357. .. rst-class:: classref-method
  358. :ref:`float<class_float>` **get_section_start_time**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_section_start_time>`
  359. Returns the start time of the section currently being played.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_AnimationPlayer_method_has_section:
  363. .. rst-class:: classref-method
  364. :ref:`bool<class_bool>` **has_section**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_has_section>`
  365. Returns ``true`` if an animation is currently playing with a section.
  366. .. rst-class:: classref-item-separator
  367. ----
  368. .. _class_AnimationPlayer_method_is_animation_active:
  369. .. rst-class:: classref-method
  370. :ref:`bool<class_bool>` **is_animation_active**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_is_animation_active>`
  371. Returns ``true`` if the an animation is currently active. An animation is active if it was played by calling :ref:`play()<class_AnimationPlayer_method_play>` and was not finished yet, or was stopped by calling :ref:`stop()<class_AnimationPlayer_method_stop>`.
  372. This can be used to check whether an animation is currently paused or stopped.
  373. ::
  374. var is_paused = not is_playing() and is_animation_active()
  375. var is_stopped = not is_playing() and not is_animation_active()
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _class_AnimationPlayer_method_is_playing:
  379. .. rst-class:: classref-method
  380. :ref:`bool<class_bool>` **is_playing**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_is_playing>`
  381. Returns ``true`` if an animation is currently playing (even if :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` and/or ``custom_speed`` are ``0``).
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_AnimationPlayer_method_pause:
  385. .. rst-class:: classref-method
  386. |void| **pause**\ (\ ) :ref:`🔗<class_AnimationPlayer_method_pause>`
  387. Pauses the currently playing animation. The :ref:`current_animation_position<class_AnimationPlayer_property_current_animation_position>` will be kept and calling :ref:`play()<class_AnimationPlayer_method_play>` or :ref:`play_backwards()<class_AnimationPlayer_method_play_backwards>` without arguments or with the same animation name as :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` will resume the animation.
  388. See also :ref:`stop()<class_AnimationPlayer_method_stop>`.
  389. .. rst-class:: classref-item-separator
  390. ----
  391. .. _class_AnimationPlayer_method_play:
  392. .. rst-class:: classref-method
  393. |void| **play**\ (\ name\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationPlayer_method_play>`
  394. Plays the animation with key ``name``. Custom blend times and speed can be set.
  395. The ``from_end`` option only affects when switching to a new animation track, or if the same track but at the start or end. It does not affect resuming playback that was paused in the middle of an animation. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards()<class_AnimationPlayer_method_play_backwards>`).
  396. The **AnimationPlayer** keeps track of its current or last played animation with :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>`. If this method is called with that same animation ``name``, or with no ``name`` parameter, the assigned animation will resume playing if it was paused.
  397. \ **Note:** The animation will be updated the next time the **AnimationPlayer** is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call ``advance(0)``.
  398. .. rst-class:: classref-item-separator
  399. ----
  400. .. _class_AnimationPlayer_method_play_backwards:
  401. .. rst-class:: classref-method
  402. |void| **play_backwards**\ (\ name\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1\ ) :ref:`🔗<class_AnimationPlayer_method_play_backwards>`
  403. Plays the animation with key ``name`` in reverse.
  404. This method is a shorthand for :ref:`play()<class_AnimationPlayer_method_play>` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information.
  405. .. rst-class:: classref-item-separator
  406. ----
  407. .. _class_AnimationPlayer_method_play_section:
  408. .. rst-class:: classref-method
  409. |void| **play_section**\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1, custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationPlayer_method_play_section>`
  410. Plays the animation with key ``name`` and the section starting from ``start_time`` and ending on ``end_time``. See also :ref:`play()<class_AnimationPlayer_method_play>`.
  411. Setting ``start_time`` to a value outside the range of the animation means the start of the animation will be used instead, and setting ``end_time`` to a value outside the range of the animation means the end of the animation will be used instead. ``start_time`` cannot be equal to ``end_time``.
  412. .. rst-class:: classref-item-separator
  413. ----
  414. .. _class_AnimationPlayer_method_play_section_backwards:
  415. .. rst-class:: classref-method
  416. |void| **play_section_backwards**\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1, custom_blend\: :ref:`float<class_float>` = -1\ ) :ref:`🔗<class_AnimationPlayer_method_play_section_backwards>`
  417. Plays the animation with key ``name`` and the section starting from ``start_time`` and ending on ``end_time`` in reverse.
  418. This method is a shorthand for :ref:`play_section()<class_AnimationPlayer_method_play_section>` with ``custom_speed = -1.0`` and ``from_end = true``, see its description for more information.
  419. .. rst-class:: classref-item-separator
  420. ----
  421. .. _class_AnimationPlayer_method_play_section_with_markers:
  422. .. rst-class:: classref-method
  423. |void| **play_section_with_markers**\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationPlayer_method_play_section_with_markers>`
  424. Plays the animation with key ``name`` and the section starting from ``start_marker`` and ending on ``end_marker``.
  425. If the start marker is empty, the section starts from the beginning of the animation. If the end marker is empty, the section ends on the end of the animation. See also :ref:`play()<class_AnimationPlayer_method_play>`.
  426. .. rst-class:: classref-item-separator
  427. ----
  428. .. _class_AnimationPlayer_method_play_section_with_markers_backwards:
  429. .. rst-class:: classref-method
  430. |void| **play_section_with_markers_backwards**\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1\ ) :ref:`🔗<class_AnimationPlayer_method_play_section_with_markers_backwards>`
  431. Plays the animation with key ``name`` and the section starting from ``start_marker`` and ending on ``end_marker`` in reverse.
  432. This method is a shorthand for :ref:`play_section_with_markers()<class_AnimationPlayer_method_play_section_with_markers>` with ``custom_speed = -1.0`` and ``from_end = true``, see its description for more information.
  433. .. rst-class:: classref-item-separator
  434. ----
  435. .. _class_AnimationPlayer_method_play_with_capture:
  436. .. rst-class:: classref-method
  437. |void| **play_with_capture**\ (\ name\: :ref:`StringName<class_StringName>` = &"", duration\: :ref:`float<class_float>` = -1.0, custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false, trans_type\: :ref:`TransitionType<enum_Tween_TransitionType>` = 0, ease_type\: :ref:`EaseType<enum_Tween_EaseType>` = 0\ ) :ref:`🔗<class_AnimationPlayer_method_play_with_capture>`
  438. See also :ref:`AnimationMixer.capture()<class_AnimationMixer_method_capture>`.
  439. You can use this method to use more detailed options for capture than those performed by :ref:`playback_auto_capture<class_AnimationPlayer_property_playback_auto_capture>`. When :ref:`playback_auto_capture<class_AnimationPlayer_property_playback_auto_capture>` is ``false``, this method is almost the same as the following:
  440. ::
  441. capture(name, duration, trans_type, ease_type)
  442. play(name, custom_blend, custom_speed, from_end)
  443. If ``name`` is blank, it specifies :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>`.
  444. If ``duration`` is a negative value, the duration is set to the interval between the current position and the first key, when ``from_end`` is ``true``, uses the interval between the current position and the last key instead.
  445. \ **Note:** The ``duration`` takes :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` into account, but ``custom_speed`` does not, because the capture cache is interpolated with the blend result and the result may contain multiple animations.
  446. .. rst-class:: classref-item-separator
  447. ----
  448. .. _class_AnimationPlayer_method_queue:
  449. .. rst-class:: classref-method
  450. |void| **queue**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationPlayer_method_queue>`
  451. Queues an animation for playback once the current animation and all previously queued animations are done.
  452. \ **Note:** If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow.
  453. .. rst-class:: classref-item-separator
  454. ----
  455. .. _class_AnimationPlayer_method_reset_section:
  456. .. rst-class:: classref-method
  457. |void| **reset_section**\ (\ ) :ref:`🔗<class_AnimationPlayer_method_reset_section>`
  458. Resets the current section. Does nothing if a section has not been set.
  459. .. rst-class:: classref-item-separator
  460. ----
  461. .. _class_AnimationPlayer_method_seek:
  462. .. rst-class:: classref-method
  463. |void| **seek**\ (\ seconds\: :ref:`float<class_float>`, update\: :ref:`bool<class_bool>` = false, update_only\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationPlayer_method_seek>`
  464. 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.
  465. If ``update_only`` is ``true``, the method / audio / animation playback tracks will not be processed.
  466. \ **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>`.
  467. .. rst-class:: classref-item-separator
  468. ----
  469. .. _class_AnimationPlayer_method_set_blend_time:
  470. .. rst-class:: classref-method
  471. |void| **set_blend_time**\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`, sec\: :ref:`float<class_float>`\ ) :ref:`🔗<class_AnimationPlayer_method_set_blend_time>`
  472. Specifies a blend time (in seconds) between two animations, referenced by their keys.
  473. .. rst-class:: classref-item-separator
  474. ----
  475. .. _class_AnimationPlayer_method_set_method_call_mode:
  476. .. rst-class:: classref-method
  477. |void| **set_method_call_mode**\ (\ mode\: :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>`\ ) :ref:`🔗<class_AnimationPlayer_method_set_method_call_mode>`
  478. **Deprecated:** Use :ref:`AnimationMixer.callback_mode_method<class_AnimationMixer_property_callback_mode_method>` instead.
  479. Sets the call mode used for "Call Method" tracks.
  480. .. rst-class:: classref-item-separator
  481. ----
  482. .. _class_AnimationPlayer_method_set_process_callback:
  483. .. rst-class:: classref-method
  484. |void| **set_process_callback**\ (\ mode\: :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>`\ ) :ref:`🔗<class_AnimationPlayer_method_set_process_callback>`
  485. **Deprecated:** Use :ref:`AnimationMixer.callback_mode_process<class_AnimationMixer_property_callback_mode_process>` instead.
  486. Sets the process notification in which to update animations.
  487. .. rst-class:: classref-item-separator
  488. ----
  489. .. _class_AnimationPlayer_method_set_root:
  490. .. rst-class:: classref-method
  491. |void| **set_root**\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) :ref:`🔗<class_AnimationPlayer_method_set_root>`
  492. **Deprecated:** Use :ref:`AnimationMixer.root_node<class_AnimationMixer_property_root_node>` instead.
  493. Sets the node which node path references will travel from.
  494. .. rst-class:: classref-item-separator
  495. ----
  496. .. _class_AnimationPlayer_method_set_section:
  497. .. rst-class:: classref-method
  498. |void| **set_section**\ (\ start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1\ ) :ref:`🔗<class_AnimationPlayer_method_set_section>`
  499. Changes the start and end times of the section being played. The current playback position will be clamped within the new section. See also :ref:`play_section()<class_AnimationPlayer_method_play_section>`.
  500. .. rst-class:: classref-item-separator
  501. ----
  502. .. _class_AnimationPlayer_method_set_section_with_markers:
  503. .. rst-class:: classref-method
  504. |void| **set_section_with_markers**\ (\ start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &""\ ) :ref:`🔗<class_AnimationPlayer_method_set_section_with_markers>`
  505. Changes the start and end markers of the section being played. The current playback position will be clamped within the new section. See also :ref:`play_section_with_markers()<class_AnimationPlayer_method_play_section_with_markers>`.
  506. If the argument is empty, the section uses the beginning or end of the animation. If both are empty, it means that the section is not set.
  507. .. rst-class:: classref-item-separator
  508. ----
  509. .. _class_AnimationPlayer_method_stop:
  510. .. rst-class:: classref-method
  511. |void| **stop**\ (\ keep_state\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationPlayer_method_stop>`
  512. Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause()<class_AnimationPlayer_method_pause>`.
  513. If ``keep_state`` is ``true``, the animation state is not updated visually.
  514. \ **Note:** The method / audio / animation playback tracks will not be processed by this method.
  515. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  516. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  517. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  518. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  519. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  520. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  521. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  522. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  523. .. |void| replace:: :abbr:`void (No return value.)`