class_animationplayer.rst 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912
  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:`String<class_String>` | :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` | |
  31. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  32. | :ref:`String<class_String>` | :ref:`autoplay<class_AnimationPlayer_property_autoplay>` | ``""`` |
  33. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
  34. | :ref:`String<class_String>` | :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:`PackedStringArray<class_PackedStringArray>` | :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_playing<class_AnimationPlayer_method_is_playing>`\ (\ ) |const| |
  85. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | |void| | :ref:`pause<class_AnimationPlayer_method_pause>`\ (\ ) |
  87. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | |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\ ) |
  89. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | |void| | :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1\ ) |
  91. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | |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\ ) |
  93. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | |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\ ) |
  95. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | |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\ ) |
  97. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | |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\ ) |
  99. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | |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\ ) |
  101. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | |void| | :ref:`queue<class_AnimationPlayer_method_queue>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  103. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | |void| | :ref:`reset_section<class_AnimationPlayer_method_reset_section>`\ (\ ) |
  105. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | |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\ ) |
  107. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | |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>`\ ) |
  109. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | |void| | :ref:`set_method_call_mode<class_AnimationPlayer_method_set_method_call_mode>`\ (\ mode\: :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>`\ ) |
  111. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | |void| | :ref:`set_process_callback<class_AnimationPlayer_method_set_process_callback>`\ (\ mode\: :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>`\ ) |
  113. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | |void| | :ref:`set_root<class_AnimationPlayer_method_set_root>`\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |
  115. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | |void| | :ref:`set_section<class_AnimationPlayer_method_set_section>`\ (\ start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1\ ) |
  117. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | |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>` = &""\ ) |
  119. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | |void| | :ref:`stop<class_AnimationPlayer_method_stop>`\ (\ keep_state\: :ref:`bool<class_bool>` = false\ ) |
  121. +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. .. rst-class:: classref-section-separator
  123. ----
  124. .. rst-class:: classref-descriptions-group
  125. Signals
  126. -------
  127. .. _class_AnimationPlayer_signal_animation_changed:
  128. .. rst-class:: classref-signal
  129. **animation_changed**\ (\ old_name\: :ref:`StringName<class_StringName>`, new_name\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_signal_animation_changed>`
  130. Emitted when a queued animation plays after the previous animation finished. See also :ref:`queue<class_AnimationPlayer_method_queue>`.
  131. \ **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>`.
  132. .. rst-class:: classref-item-separator
  133. ----
  134. .. _class_AnimationPlayer_signal_current_animation_changed:
  135. .. rst-class:: classref-signal
  136. **current_animation_changed**\ (\ name\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_signal_current_animation_changed>`
  137. Emitted when :ref:`current_animation<class_AnimationPlayer_property_current_animation>` changes.
  138. .. rst-class:: classref-section-separator
  139. ----
  140. .. rst-class:: classref-descriptions-group
  141. Enumerations
  142. ------------
  143. .. _enum_AnimationPlayer_AnimationProcessCallback:
  144. .. rst-class:: classref-enumeration
  145. enum **AnimationProcessCallback**: :ref:`๐Ÿ”—<enum_AnimationPlayer_AnimationProcessCallback>`
  146. .. _class_AnimationPlayer_constant_ANIMATION_PROCESS_PHYSICS:
  147. .. rst-class:: classref-enumeration-constant
  148. :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_PHYSICS** = ``0``
  149. **Deprecated:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS>`.
  150. .. _class_AnimationPlayer_constant_ANIMATION_PROCESS_IDLE:
  151. .. rst-class:: classref-enumeration-constant
  152. :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_IDLE** = ``1``
  153. **Deprecated:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_IDLE>`.
  154. .. _class_AnimationPlayer_constant_ANIMATION_PROCESS_MANUAL:
  155. .. rst-class:: classref-enumeration-constant
  156. :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_MANUAL** = ``2``
  157. **Deprecated:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_MANUAL>`.
  158. .. rst-class:: classref-item-separator
  159. ----
  160. .. _enum_AnimationPlayer_AnimationMethodCallMode:
  161. .. rst-class:: classref-enumeration
  162. enum **AnimationMethodCallMode**: :ref:`๐Ÿ”—<enum_AnimationPlayer_AnimationMethodCallMode>`
  163. .. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_DEFERRED:
  164. .. rst-class:: classref-enumeration-constant
  165. :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **ANIMATION_METHOD_CALL_DEFERRED** = ``0``
  166. **Deprecated:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_DEFERRED<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_METHOD_DEFERRED>`.
  167. .. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_IMMEDIATE:
  168. .. rst-class:: classref-enumeration-constant
  169. :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **ANIMATION_METHOD_CALL_IMMEDIATE** = ``1``
  170. **Deprecated:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE>`.
  171. .. rst-class:: classref-section-separator
  172. ----
  173. .. rst-class:: classref-descriptions-group
  174. Property Descriptions
  175. ---------------------
  176. .. _class_AnimationPlayer_property_assigned_animation:
  177. .. rst-class:: classref-property
  178. :ref:`String<class_String>` **assigned_animation** :ref:`๐Ÿ”—<class_AnimationPlayer_property_assigned_animation>`
  179. .. rst-class:: classref-property-setget
  180. - |void| **set_assigned_animation**\ (\ value\: :ref:`String<class_String>`\ )
  181. - :ref:`String<class_String>` **get_assigned_animation**\ (\ )
  182. 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>`.
  183. .. rst-class:: classref-item-separator
  184. ----
  185. .. _class_AnimationPlayer_property_autoplay:
  186. .. rst-class:: classref-property
  187. :ref:`String<class_String>` **autoplay** = ``""`` :ref:`๐Ÿ”—<class_AnimationPlayer_property_autoplay>`
  188. .. rst-class:: classref-property-setget
  189. - |void| **set_autoplay**\ (\ value\: :ref:`String<class_String>`\ )
  190. - :ref:`String<class_String>` **get_autoplay**\ (\ )
  191. The key of the animation to play when the scene loads.
  192. .. rst-class:: classref-item-separator
  193. ----
  194. .. _class_AnimationPlayer_property_current_animation:
  195. .. rst-class:: classref-property
  196. :ref:`String<class_String>` **current_animation** = ``""`` :ref:`๐Ÿ”—<class_AnimationPlayer_property_current_animation>`
  197. .. rst-class:: classref-property-setget
  198. - |void| **set_current_animation**\ (\ value\: :ref:`String<class_String>`\ )
  199. - :ref:`String<class_String>` **get_current_animation**\ (\ )
  200. 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.
  201. \ **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>`.
  202. .. rst-class:: classref-item-separator
  203. ----
  204. .. _class_AnimationPlayer_property_current_animation_length:
  205. .. rst-class:: classref-property
  206. :ref:`float<class_float>` **current_animation_length** :ref:`๐Ÿ”—<class_AnimationPlayer_property_current_animation_length>`
  207. .. rst-class:: classref-property-setget
  208. - :ref:`float<class_float>` **get_current_animation_length**\ (\ )
  209. The length (in seconds) of the currently playing animation.
  210. .. rst-class:: classref-item-separator
  211. ----
  212. .. _class_AnimationPlayer_property_current_animation_position:
  213. .. rst-class:: classref-property
  214. :ref:`float<class_float>` **current_animation_position** :ref:`๐Ÿ”—<class_AnimationPlayer_property_current_animation_position>`
  215. .. rst-class:: classref-property-setget
  216. - :ref:`float<class_float>` **get_current_animation_position**\ (\ )
  217. The position (in seconds) of the currently playing animation.
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_AnimationPlayer_property_movie_quit_on_finish:
  221. .. rst-class:: classref-property
  222. :ref:`bool<class_bool>` **movie_quit_on_finish** = ``false`` :ref:`๐Ÿ”—<class_AnimationPlayer_property_movie_quit_on_finish>`
  223. .. rst-class:: classref-property-setget
  224. - |void| **set_movie_quit_on_finish_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  225. - :ref:`bool<class_bool>` **is_movie_quit_on_finish_enabled**\ (\ )
  226. 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.
  227. \ **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.
  228. .. rst-class:: classref-item-separator
  229. ----
  230. .. _class_AnimationPlayer_property_playback_auto_capture:
  231. .. rst-class:: classref-property
  232. :ref:`bool<class_bool>` **playback_auto_capture** = ``true`` :ref:`๐Ÿ”—<class_AnimationPlayer_property_playback_auto_capture>`
  233. .. rst-class:: classref-property-setget
  234. - |void| **set_auto_capture**\ (\ value\: :ref:`bool<class_bool>`\ )
  235. - :ref:`bool<class_bool>` **is_auto_capture**\ (\ )
  236. 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>`.
  237. \ **Note:** Capture interpolation is only performed if the animation contains a capture track. See also :ref:`Animation.UPDATE_CAPTURE<class_Animation_constant_UPDATE_CAPTURE>`.
  238. .. rst-class:: classref-item-separator
  239. ----
  240. .. _class_AnimationPlayer_property_playback_auto_capture_duration:
  241. .. rst-class:: classref-property
  242. :ref:`float<class_float>` **playback_auto_capture_duration** = ``-1.0`` :ref:`๐Ÿ”—<class_AnimationPlayer_property_playback_auto_capture_duration>`
  243. .. rst-class:: classref-property-setget
  244. - |void| **set_auto_capture_duration**\ (\ value\: :ref:`float<class_float>`\ )
  245. - :ref:`float<class_float>` **get_auto_capture_duration**\ (\ )
  246. See also :ref:`play_with_capture<class_AnimationPlayer_method_play_with_capture>` and :ref:`AnimationMixer.capture<class_AnimationMixer_method_capture>`.
  247. 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.
  248. .. rst-class:: classref-item-separator
  249. ----
  250. .. _class_AnimationPlayer_property_playback_auto_capture_ease_type:
  251. .. rst-class:: classref-property
  252. :ref:`EaseType<enum_Tween_EaseType>` **playback_auto_capture_ease_type** = ``0`` :ref:`๐Ÿ”—<class_AnimationPlayer_property_playback_auto_capture_ease_type>`
  253. .. rst-class:: classref-property-setget
  254. - |void| **set_auto_capture_ease_type**\ (\ value\: :ref:`EaseType<enum_Tween_EaseType>`\ )
  255. - :ref:`EaseType<enum_Tween_EaseType>` **get_auto_capture_ease_type**\ (\ )
  256. The ease type of the capture interpolation. See also :ref:`EaseType<enum_Tween_EaseType>`.
  257. .. rst-class:: classref-item-separator
  258. ----
  259. .. _class_AnimationPlayer_property_playback_auto_capture_transition_type:
  260. .. rst-class:: classref-property
  261. :ref:`TransitionType<enum_Tween_TransitionType>` **playback_auto_capture_transition_type** = ``0`` :ref:`๐Ÿ”—<class_AnimationPlayer_property_playback_auto_capture_transition_type>`
  262. .. rst-class:: classref-property-setget
  263. - |void| **set_auto_capture_transition_type**\ (\ value\: :ref:`TransitionType<enum_Tween_TransitionType>`\ )
  264. - :ref:`TransitionType<enum_Tween_TransitionType>` **get_auto_capture_transition_type**\ (\ )
  265. The transition type of the capture interpolation. See also :ref:`TransitionType<enum_Tween_TransitionType>`.
  266. .. rst-class:: classref-item-separator
  267. ----
  268. .. _class_AnimationPlayer_property_playback_default_blend_time:
  269. .. rst-class:: classref-property
  270. :ref:`float<class_float>` **playback_default_blend_time** = ``0.0`` :ref:`๐Ÿ”—<class_AnimationPlayer_property_playback_default_blend_time>`
  271. .. rst-class:: classref-property-setget
  272. - |void| **set_default_blend_time**\ (\ value\: :ref:`float<class_float>`\ )
  273. - :ref:`float<class_float>` **get_default_blend_time**\ (\ )
  274. The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision.
  275. .. rst-class:: classref-item-separator
  276. ----
  277. .. _class_AnimationPlayer_property_speed_scale:
  278. .. rst-class:: classref-property
  279. :ref:`float<class_float>` **speed_scale** = ``1.0`` :ref:`๐Ÿ”—<class_AnimationPlayer_property_speed_scale>`
  280. .. rst-class:: classref-property-setget
  281. - |void| **set_speed_scale**\ (\ value\: :ref:`float<class_float>`\ )
  282. - :ref:`float<class_float>` **get_speed_scale**\ (\ )
  283. 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.
  284. If set to a negative value, the animation is played in reverse. If set to ``0``, the animation will not advance.
  285. .. rst-class:: classref-section-separator
  286. ----
  287. .. rst-class:: classref-descriptions-group
  288. Method Descriptions
  289. -------------------
  290. .. _class_AnimationPlayer_method_animation_get_next:
  291. .. rst-class:: classref-method
  292. :ref:`StringName<class_StringName>` **animation_get_next**\ (\ animation_from\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`๐Ÿ”—<class_AnimationPlayer_method_animation_get_next>`
  293. Returns the key of the animation which is queued to play after the ``animation_from`` animation.
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_AnimationPlayer_method_animation_set_next:
  297. .. rst-class:: classref-method
  298. |void| **animation_set_next**\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_animation_set_next>`
  299. Triggers the ``animation_to`` animation when the ``animation_from`` animation completes.
  300. .. rst-class:: classref-item-separator
  301. ----
  302. .. _class_AnimationPlayer_method_clear_queue:
  303. .. rst-class:: classref-method
  304. |void| **clear_queue**\ (\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_clear_queue>`
  305. Clears all queued, unplayed animations.
  306. .. rst-class:: classref-item-separator
  307. ----
  308. .. _class_AnimationPlayer_method_get_blend_time:
  309. .. rst-class:: classref-method
  310. :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>`
  311. Returns the blend time (in seconds) between two animations, referenced by their keys.
  312. .. rst-class:: classref-item-separator
  313. ----
  314. .. _class_AnimationPlayer_method_get_method_call_mode:
  315. .. rst-class:: classref-method
  316. :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **get_method_call_mode**\ (\ ) |const| :ref:`๐Ÿ”—<class_AnimationPlayer_method_get_method_call_mode>`
  317. **Deprecated:** Use :ref:`AnimationMixer.callback_mode_method<class_AnimationMixer_property_callback_mode_method>` instead.
  318. Returns the call mode used for "Call Method" tracks.
  319. .. rst-class:: classref-item-separator
  320. ----
  321. .. _class_AnimationPlayer_method_get_playing_speed:
  322. .. rst-class:: classref-method
  323. :ref:`float<class_float>` **get_playing_speed**\ (\ ) |const| :ref:`๐Ÿ”—<class_AnimationPlayer_method_get_playing_speed>`
  324. 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.
  325. Returns a negative value if the current animation is playing backwards.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_AnimationPlayer_method_get_process_callback:
  329. .. rst-class:: classref-method
  330. :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **get_process_callback**\ (\ ) |const| :ref:`๐Ÿ”—<class_AnimationPlayer_method_get_process_callback>`
  331. **Deprecated:** Use :ref:`AnimationMixer.callback_mode_process<class_AnimationMixer_property_callback_mode_process>` instead.
  332. Returns the process notification in which to update animations.
  333. .. rst-class:: classref-item-separator
  334. ----
  335. .. _class_AnimationPlayer_method_get_queue:
  336. .. rst-class:: classref-method
  337. :ref:`PackedStringArray<class_PackedStringArray>` **get_queue**\ (\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_get_queue>`
  338. Returns a list of the animation keys that are currently queued to play.
  339. .. rst-class:: classref-item-separator
  340. ----
  341. .. _class_AnimationPlayer_method_get_root:
  342. .. rst-class:: classref-method
  343. :ref:`NodePath<class_NodePath>` **get_root**\ (\ ) |const| :ref:`๐Ÿ”—<class_AnimationPlayer_method_get_root>`
  344. **Deprecated:** Use :ref:`AnimationMixer.root_node<class_AnimationMixer_property_root_node>` instead.
  345. Returns the node which node path references will travel from.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_AnimationPlayer_method_get_section_end_time:
  349. .. rst-class:: classref-method
  350. :ref:`float<class_float>` **get_section_end_time**\ (\ ) |const| :ref:`๐Ÿ”—<class_AnimationPlayer_method_get_section_end_time>`
  351. Returns the end time of the section currently being played.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_AnimationPlayer_method_get_section_start_time:
  355. .. rst-class:: classref-method
  356. :ref:`float<class_float>` **get_section_start_time**\ (\ ) |const| :ref:`๐Ÿ”—<class_AnimationPlayer_method_get_section_start_time>`
  357. Returns the start time of the section currently being played.
  358. .. rst-class:: classref-item-separator
  359. ----
  360. .. _class_AnimationPlayer_method_has_section:
  361. .. rst-class:: classref-method
  362. :ref:`bool<class_bool>` **has_section**\ (\ ) |const| :ref:`๐Ÿ”—<class_AnimationPlayer_method_has_section>`
  363. Returns ``true`` if an animation is currently playing with section.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_AnimationPlayer_method_is_playing:
  367. .. rst-class:: classref-method
  368. :ref:`bool<class_bool>` **is_playing**\ (\ ) |const| :ref:`๐Ÿ”—<class_AnimationPlayer_method_is_playing>`
  369. Returns ``true`` if an animation is currently playing (even if :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` and/or ``custom_speed`` are ``0``).
  370. .. rst-class:: classref-item-separator
  371. ----
  372. .. _class_AnimationPlayer_method_pause:
  373. .. rst-class:: classref-method
  374. |void| **pause**\ (\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_pause>`
  375. 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.
  376. See also :ref:`stop<class_AnimationPlayer_method_stop>`.
  377. .. rst-class:: classref-item-separator
  378. ----
  379. .. _class_AnimationPlayer_method_play:
  380. .. rst-class:: classref-method
  381. |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>`
  382. Plays the animation with key ``name``. Custom blend times and speed can be set.
  383. 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>`).
  384. 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.
  385. \ **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)``.
  386. .. rst-class:: classref-item-separator
  387. ----
  388. .. _class_AnimationPlayer_method_play_backwards:
  389. .. rst-class:: classref-method
  390. |void| **play_backwards**\ (\ name\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_play_backwards>`
  391. Plays the animation with key ``name`` in reverse.
  392. 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.
  393. .. rst-class:: classref-item-separator
  394. ----
  395. .. _class_AnimationPlayer_method_play_section:
  396. .. rst-class:: classref-method
  397. |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>`
  398. 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>`.
  399. 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``.
  400. .. rst-class:: classref-item-separator
  401. ----
  402. .. _class_AnimationPlayer_method_play_section_backwards:
  403. .. rst-class:: classref-method
  404. |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>`
  405. Plays the animation with key ``name`` and the section starting from ``start_time`` and ending on ``end_time`` in reverse.
  406. 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.
  407. .. rst-class:: classref-item-separator
  408. ----
  409. .. _class_AnimationPlayer_method_play_section_with_markers:
  410. .. rst-class:: classref-method
  411. |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>`
  412. Plays the animation with key ``name`` and the section starting from ``start_marker`` and ending on ``end_marker``.
  413. 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>`.
  414. .. rst-class:: classref-item-separator
  415. ----
  416. .. _class_AnimationPlayer_method_play_section_with_markers_backwards:
  417. .. rst-class:: classref-method
  418. |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>`
  419. Plays the animation with key ``name`` and the section starting from ``start_marker`` and ending on ``end_marker`` in reverse.
  420. 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.
  421. .. rst-class:: classref-item-separator
  422. ----
  423. .. _class_AnimationPlayer_method_play_with_capture:
  424. .. rst-class:: classref-method
  425. |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>`
  426. See also :ref:`AnimationMixer.capture<class_AnimationMixer_method_capture>`.
  427. 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:
  428. ::
  429. capture(name, duration, trans_type, ease_type)
  430. play(name, custom_blend, custom_speed, from_end)
  431. If ``name`` is blank, it specifies :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>`.
  432. 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.
  433. \ **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.
  434. .. rst-class:: classref-item-separator
  435. ----
  436. .. _class_AnimationPlayer_method_queue:
  437. .. rst-class:: classref-method
  438. |void| **queue**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_queue>`
  439. Queues an animation for playback once the current animation and all previously queued animations are done.
  440. \ **Note:** If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow.
  441. .. rst-class:: classref-item-separator
  442. ----
  443. .. _class_AnimationPlayer_method_reset_section:
  444. .. rst-class:: classref-method
  445. |void| **reset_section**\ (\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_reset_section>`
  446. Resets the current section if section is set.
  447. .. rst-class:: classref-item-separator
  448. ----
  449. .. _class_AnimationPlayer_method_seek:
  450. .. rst-class:: classref-method
  451. |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>`
  452. 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.
  453. If ``update_only`` is ``true``, the method / audio / animation playback tracks will not be processed.
  454. \ **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>`.
  455. .. rst-class:: classref-item-separator
  456. ----
  457. .. _class_AnimationPlayer_method_set_blend_time:
  458. .. rst-class:: classref-method
  459. |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>`
  460. Specifies a blend time (in seconds) between two animations, referenced by their keys.
  461. .. rst-class:: classref-item-separator
  462. ----
  463. .. _class_AnimationPlayer_method_set_method_call_mode:
  464. .. rst-class:: classref-method
  465. |void| **set_method_call_mode**\ (\ mode\: :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>`\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_set_method_call_mode>`
  466. **Deprecated:** Use :ref:`AnimationMixer.callback_mode_method<class_AnimationMixer_property_callback_mode_method>` instead.
  467. Sets the call mode used for "Call Method" tracks.
  468. .. rst-class:: classref-item-separator
  469. ----
  470. .. _class_AnimationPlayer_method_set_process_callback:
  471. .. rst-class:: classref-method
  472. |void| **set_process_callback**\ (\ mode\: :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>`\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_set_process_callback>`
  473. **Deprecated:** Use :ref:`AnimationMixer.callback_mode_process<class_AnimationMixer_property_callback_mode_process>` instead.
  474. Sets the process notification in which to update animations.
  475. .. rst-class:: classref-item-separator
  476. ----
  477. .. _class_AnimationPlayer_method_set_root:
  478. .. rst-class:: classref-method
  479. |void| **set_root**\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_set_root>`
  480. **Deprecated:** Use :ref:`AnimationMixer.root_node<class_AnimationMixer_property_root_node>` instead.
  481. Sets the node which node path references will travel from.
  482. .. rst-class:: classref-item-separator
  483. ----
  484. .. _class_AnimationPlayer_method_set_section:
  485. .. rst-class:: classref-method
  486. |void| **set_section**\ (\ start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_set_section>`
  487. 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>`.
  488. .. rst-class:: classref-item-separator
  489. ----
  490. .. _class_AnimationPlayer_method_set_section_with_markers:
  491. .. rst-class:: classref-method
  492. |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>`
  493. 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>`.
  494. 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.
  495. .. rst-class:: classref-item-separator
  496. ----
  497. .. _class_AnimationPlayer_method_stop:
  498. .. rst-class:: classref-method
  499. |void| **stop**\ (\ keep_state\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_AnimationPlayer_method_stop>`
  500. 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>`.
  501. If ``keep_state`` is ``true``, the animation state is not updated visually.
  502. \ **Note:** The method / audio / animation playback tracks will not be processed by this method.
  503. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  504. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  505. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  506. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  507. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  508. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  509. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  510. .. |void| replace:: :abbr:`void (No return value.)`