class_animation.rst 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the Animation.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Animation:
  6. Animation
  7. =========
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. Contains data used to animate everything in the engine.
  10. Description
  11. -----------
  12. An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track.
  13. ::
  14. # This creates an animation that makes the node "Enemy" move to the right by
  15. # 100 pixels in 1 second.
  16. var animation = Animation.new()
  17. var track_index = animation.add_track(Animation.TYPE_VALUE)
  18. animation.track_set_path(track_index, "Enemy:position.x")
  19. animation.track_insert_key(track_index, 0.0, 0)
  20. animation.track_insert_key(track_index, 0.5, 100)
  21. Animations are just data containers, and must be added to nodes such as an :ref:`AnimationPlayer<class_AnimationPlayer>` or :ref:`AnimationTreePlayer<class_AnimationTreePlayer>` to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check :ref:`TrackType<enum_Animation_TrackType>` to see available types.
  22. Tutorials
  23. ---------
  24. - :doc:`../tutorials/animation/index`
  25. Properties
  26. ----------
  27. +---------------------------+------------------------------------------------+-----------+
  28. | :ref:`float<class_float>` | :ref:`length<class_Animation_property_length>` | ``1.0`` |
  29. +---------------------------+------------------------------------------------+-----------+
  30. | :ref:`bool<class_bool>` | :ref:`loop<class_Animation_property_loop>` | ``false`` |
  31. +---------------------------+------------------------------------------------+-----------+
  32. | :ref:`float<class_float>` | :ref:`step<class_Animation_property_step>` | ``0.1`` |
  33. +---------------------------+------------------------------------------------+-----------+
  34. Methods
  35. -------
  36. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`int<class_int>` | :ref:`add_track<class_Animation_method_add_track>` **(** :ref:`TrackType<enum_Animation_TrackType>` type, :ref:`int<class_int>` at_position=-1 **)** |
  38. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`String<class_String>` | :ref:`animation_track_get_key_animation<class_Animation_method_animation_track_get_key_animation>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  40. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`int<class_int>` | :ref:`animation_track_insert_key<class_Animation_method_animation_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`String<class_String>` animation **)** |
  42. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`animation_track_set_key_animation<class_Animation_method_animation_track_set_key_animation>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`String<class_String>` animation **)** |
  44. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`float<class_float>` | :ref:`audio_track_get_key_end_offset<class_Animation_method_audio_track_get_key_end_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  46. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`float<class_float>` | :ref:`audio_track_get_key_start_offset<class_Animation_method_audio_track_get_key_start_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  48. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`Resource<class_Resource>` | :ref:`audio_track_get_key_stream<class_Animation_method_audio_track_get_key_stream>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  50. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`int<class_int>` | :ref:`audio_track_insert_key<class_Animation_method_audio_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Resource<class_Resource>` stream, :ref:`float<class_float>` start_offset=0, :ref:`float<class_float>` end_offset=0 **)** |
  52. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`audio_track_set_key_end_offset<class_Animation_method_audio_track_set_key_end_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)** |
  54. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`audio_track_set_key_start_offset<class_Animation_method_audio_track_set_key_start_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)** |
  56. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`audio_track_set_key_stream<class_Animation_method_audio_track_set_key_stream>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Resource<class_Resource>` stream **)** |
  58. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Vector2<class_Vector2>` | :ref:`bezier_track_get_key_in_handle<class_Animation_method_bezier_track_get_key_in_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  60. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`Vector2<class_Vector2>` | :ref:`bezier_track_get_key_out_handle<class_Animation_method_bezier_track_get_key_out_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  62. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`float<class_float>` | :ref:`bezier_track_get_key_value<class_Animation_method_bezier_track_get_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  64. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`int<class_int>` | :ref:`bezier_track_insert_key<class_Animation_method_bezier_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` value, :ref:`Vector2<class_Vector2>` in_handle=Vector2( 0, 0 ), :ref:`Vector2<class_Vector2>` out_handle=Vector2( 0, 0 ) **)** |
  66. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`float<class_float>` | :ref:`bezier_track_interpolate<class_Animation_method_bezier_track_interpolate>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)** const |
  68. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`bezier_track_set_key_in_handle<class_Animation_method_bezier_track_set_key_in_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` in_handle **)** |
  70. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`bezier_track_set_key_out_handle<class_Animation_method_bezier_track_set_key_out_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` out_handle **)** |
  72. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`bezier_track_set_key_value<class_Animation_method_bezier_track_set_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` value **)** |
  74. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`clear<class_Animation_method_clear>` **(** **)** |
  76. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`copy_track<class_Animation_method_copy_track>` **(** :ref:`int<class_int>` track_idx, :ref:`Animation<class_Animation>` to_animation **)** |
  78. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`int<class_int>` | :ref:`find_track<class_Animation_method_find_track>` **(** :ref:`NodePath<class_NodePath>` path **)** const |
  80. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`int<class_int>` | :ref:`get_track_count<class_Animation_method_get_track_count>` **(** **)** const |
  82. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`method_track_get_key_indices<class_Animation_method_method_track_get_key_indices>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** const |
  84. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`String<class_String>` | :ref:`method_track_get_name<class_Animation_method_method_track_get_name>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  86. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`Array<class_Array>` | :ref:`method_track_get_params<class_Animation_method_method_track_get_params>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  88. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`remove_track<class_Animation_method_remove_track>` **(** :ref:`int<class_int>` track_idx **)** |
  90. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`int<class_int>` | :ref:`track_find_key<class_Animation_method_track_find_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`bool<class_bool>` exact=false **)** const |
  92. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`bool<class_bool>` | :ref:`track_get_interpolation_loop_wrap<class_Animation_method_track_get_interpolation_loop_wrap>` **(** :ref:`int<class_int>` track_idx **)** const |
  94. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`InterpolationType<enum_Animation_InterpolationType>` | :ref:`track_get_interpolation_type<class_Animation_method_track_get_interpolation_type>` **(** :ref:`int<class_int>` track_idx **)** const |
  96. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`int<class_int>` | :ref:`track_get_key_count<class_Animation_method_track_get_key_count>` **(** :ref:`int<class_int>` track_idx **)** const |
  98. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`float<class_float>` | :ref:`track_get_key_time<class_Animation_method_track_get_key_time>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  100. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`float<class_float>` | :ref:`track_get_key_transition<class_Animation_method_track_get_key_transition>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  102. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`Variant<class_Variant>` | :ref:`track_get_key_value<class_Animation_method_track_get_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const |
  104. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`NodePath<class_NodePath>` | :ref:`track_get_path<class_Animation_method_track_get_path>` **(** :ref:`int<class_int>` track_idx **)** const |
  106. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`TrackType<enum_Animation_TrackType>` | :ref:`track_get_type<class_Animation_method_track_get_type>` **(** :ref:`int<class_int>` track_idx **)** const |
  108. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`track_insert_key<class_Animation_method_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Variant<class_Variant>` key, :ref:`float<class_float>` transition=1 **)** |
  110. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`bool<class_bool>` | :ref:`track_is_enabled<class_Animation_method_track_is_enabled>` **(** :ref:`int<class_int>` track_idx **)** const |
  112. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`bool<class_bool>` | :ref:`track_is_imported<class_Animation_method_track_is_imported>` **(** :ref:`int<class_int>` track_idx **)** const |
  114. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`track_move_down<class_Animation_method_track_move_down>` **(** :ref:`int<class_int>` track_idx **)** |
  116. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`track_move_to<class_Animation_method_track_move_to>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` to_idx **)** |
  118. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`track_move_up<class_Animation_method_track_move_up>` **(** :ref:`int<class_int>` track_idx **)** |
  120. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`track_remove_key<class_Animation_method_track_remove_key>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |
  122. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | void | :ref:`track_remove_key_at_position<class_Animation_method_track_remove_key_at_position>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` position **)** |
  124. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`track_set_enabled<class_Animation_method_track_set_enabled>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` enabled **)** |
  126. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | void | :ref:`track_set_imported<class_Animation_method_track_set_imported>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` imported **)** |
  128. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | void | :ref:`track_set_interpolation_loop_wrap<class_Animation_method_track_set_interpolation_loop_wrap>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` interpolation **)** |
  130. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`track_set_interpolation_type<class_Animation_method_track_set_interpolation_type>` **(** :ref:`int<class_int>` track_idx, :ref:`InterpolationType<enum_Animation_InterpolationType>` interpolation **)** |
  132. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`track_set_key_time<class_Animation_method_track_set_key_time>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` time **)** |
  134. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | void | :ref:`track_set_key_transition<class_Animation_method_track_set_key_transition>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` transition **)** |
  136. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`track_set_key_value<class_Animation_method_track_set_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key, :ref:`Variant<class_Variant>` value **)** |
  138. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`track_set_path<class_Animation_method_track_set_path>` **(** :ref:`int<class_int>` track_idx, :ref:`NodePath<class_NodePath>` path **)** |
  140. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`track_swap<class_Animation_method_track_swap>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` with_idx **)** |
  142. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`int<class_int>` | :ref:`transform_track_insert_key<class_Animation_method_transform_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` location, :ref:`Quat<class_Quat>` rotation, :ref:`Vector3<class_Vector3>` scale **)** |
  144. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`Array<class_Array>` | :ref:`transform_track_interpolate<class_Animation_method_transform_track_interpolate>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec **)** const |
  146. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`value_track_get_key_indices<class_Animation_method_value_track_get_key_indices>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** const |
  148. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`UpdateMode<enum_Animation_UpdateMode>` | :ref:`value_track_get_update_mode<class_Animation_method_value_track_get_update_mode>` **(** :ref:`int<class_int>` track_idx **)** const |
  150. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | void | :ref:`value_track_set_update_mode<class_Animation_method_value_track_set_update_mode>` **(** :ref:`int<class_int>` track_idx, :ref:`UpdateMode<enum_Animation_UpdateMode>` mode **)** |
  152. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. Signals
  154. -------
  155. .. _class_Animation_signal_tracks_changed:
  156. - **tracks_changed** **(** **)**
  157. Emitted when there's a change in the list of tracks, e.g. tracks are added, moved or have changed paths.
  158. Enumerations
  159. ------------
  160. .. _enum_Animation_TrackType:
  161. .. _class_Animation_constant_TYPE_VALUE:
  162. .. _class_Animation_constant_TYPE_TRANSFORM:
  163. .. _class_Animation_constant_TYPE_METHOD:
  164. .. _class_Animation_constant_TYPE_BEZIER:
  165. .. _class_Animation_constant_TYPE_AUDIO:
  166. .. _class_Animation_constant_TYPE_ANIMATION:
  167. enum **TrackType**:
  168. - **TYPE_VALUE** = **0** --- Value tracks set values in node properties, but only those which can be Interpolated.
  169. - **TYPE_TRANSFORM** = **1** --- Transform tracks are used to change node local transforms or skeleton pose bones. Transitions are interpolated.
  170. - **TYPE_METHOD** = **2** --- Method tracks call functions with given arguments per key.
  171. - **TYPE_BEZIER** = **3** --- Bezier tracks are used to interpolate a value using custom curves. They can also be used to animate sub-properties of vectors and colors (e.g. alpha value of a :ref:`Color<class_Color>`).
  172. - **TYPE_AUDIO** = **4** --- Audio tracks are used to play an audio stream with either type of :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`. The stream can be trimmed and previewed in the animation.
  173. - **TYPE_ANIMATION** = **5** --- Animation tracks play animations in other :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
  174. ----
  175. .. _enum_Animation_InterpolationType:
  176. .. _class_Animation_constant_INTERPOLATION_NEAREST:
  177. .. _class_Animation_constant_INTERPOLATION_LINEAR:
  178. .. _class_Animation_constant_INTERPOLATION_CUBIC:
  179. enum **InterpolationType**:
  180. - **INTERPOLATION_NEAREST** = **0** --- No interpolation (nearest value).
  181. - **INTERPOLATION_LINEAR** = **1** --- Linear interpolation.
  182. - **INTERPOLATION_CUBIC** = **2** --- Cubic interpolation.
  183. ----
  184. .. _enum_Animation_UpdateMode:
  185. .. _class_Animation_constant_UPDATE_CONTINUOUS:
  186. .. _class_Animation_constant_UPDATE_DISCRETE:
  187. .. _class_Animation_constant_UPDATE_TRIGGER:
  188. .. _class_Animation_constant_UPDATE_CAPTURE:
  189. enum **UpdateMode**:
  190. - **UPDATE_CONTINUOUS** = **0** --- Update between keyframes.
  191. - **UPDATE_DISCRETE** = **1** --- Update at the keyframes and hold the value.
  192. - **UPDATE_TRIGGER** = **2** --- Update at the keyframes.
  193. - **UPDATE_CAPTURE** = **3** --- Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds.
  194. Property Descriptions
  195. ---------------------
  196. .. _class_Animation_property_length:
  197. - :ref:`float<class_float>` **length**
  198. +-----------+-------------------+
  199. | *Default* | ``1.0`` |
  200. +-----------+-------------------+
  201. | *Setter* | set_length(value) |
  202. +-----------+-------------------+
  203. | *Getter* | get_length() |
  204. +-----------+-------------------+
  205. The total length of the animation (in seconds).
  206. **Note:** Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping.
  207. ----
  208. .. _class_Animation_property_loop:
  209. - :ref:`bool<class_bool>` **loop**
  210. +-----------+-----------------+
  211. | *Default* | ``false`` |
  212. +-----------+-----------------+
  213. | *Setter* | set_loop(value) |
  214. +-----------+-----------------+
  215. | *Getter* | has_loop() |
  216. +-----------+-----------------+
  217. A flag indicating that the animation must loop. This is uses for correct interpolation of animation cycles, and for hinting the player that it must restart the animation.
  218. ----
  219. .. _class_Animation_property_step:
  220. - :ref:`float<class_float>` **step**
  221. +-----------+-----------------+
  222. | *Default* | ``0.1`` |
  223. +-----------+-----------------+
  224. | *Setter* | set_step(value) |
  225. +-----------+-----------------+
  226. | *Getter* | get_step() |
  227. +-----------+-----------------+
  228. The animation step value.
  229. Method Descriptions
  230. -------------------
  231. .. _class_Animation_method_add_track:
  232. - :ref:`int<class_int>` **add_track** **(** :ref:`TrackType<enum_Animation_TrackType>` type, :ref:`int<class_int>` at_position=-1 **)**
  233. Adds a track to the Animation.
  234. ----
  235. .. _class_Animation_method_animation_track_get_key_animation:
  236. - :ref:`String<class_String>` **animation_track_get_key_animation** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  237. Returns the animation name at the key identified by ``key_idx``. The ``track_idx`` must be the index of an Animation Track.
  238. ----
  239. .. _class_Animation_method_animation_track_insert_key:
  240. - :ref:`int<class_int>` **animation_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`String<class_String>` animation **)**
  241. Inserts a key with value ``animation`` at the given ``time`` (in seconds). The ``track_idx`` must be the index of an Animation Track.
  242. ----
  243. .. _class_Animation_method_animation_track_set_key_animation:
  244. - void **animation_track_set_key_animation** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`String<class_String>` animation **)**
  245. Sets the key identified by ``key_idx`` to value ``animation``. The ``track_idx`` must be the index of an Animation Track.
  246. ----
  247. .. _class_Animation_method_audio_track_get_key_end_offset:
  248. - :ref:`float<class_float>` **audio_track_get_key_end_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  249. Returns the end offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
  250. End offset is the number of seconds cut off at the ending of the audio stream.
  251. ----
  252. .. _class_Animation_method_audio_track_get_key_start_offset:
  253. - :ref:`float<class_float>` **audio_track_get_key_start_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  254. Returns the start offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
  255. Start offset is the number of seconds cut off at the beginning of the audio stream.
  256. ----
  257. .. _class_Animation_method_audio_track_get_key_stream:
  258. - :ref:`Resource<class_Resource>` **audio_track_get_key_stream** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  259. Returns the audio stream of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
  260. ----
  261. .. _class_Animation_method_audio_track_insert_key:
  262. - :ref:`int<class_int>` **audio_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Resource<class_Resource>` stream, :ref:`float<class_float>` start_offset=0, :ref:`float<class_float>` end_offset=0 **)**
  263. Inserts an Audio Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of an Audio Track.
  264. ``stream`` is the :ref:`AudioStream<class_AudioStream>` resource to play. ``start_offset`` is the number of seconds cut off at the beginning of the audio stream, while ``end_offset`` is at the ending.
  265. ----
  266. .. _class_Animation_method_audio_track_set_key_end_offset:
  267. - void **audio_track_set_key_end_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)**
  268. Sets the end offset of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track.
  269. ----
  270. .. _class_Animation_method_audio_track_set_key_start_offset:
  271. - void **audio_track_set_key_start_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)**
  272. Sets the start offset of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track.
  273. ----
  274. .. _class_Animation_method_audio_track_set_key_stream:
  275. - void **audio_track_set_key_stream** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Resource<class_Resource>` stream **)**
  276. Sets the stream of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track.
  277. ----
  278. .. _class_Animation_method_bezier_track_get_key_in_handle:
  279. - :ref:`Vector2<class_Vector2>` **bezier_track_get_key_in_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  280. Returns the in handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
  281. ----
  282. .. _class_Animation_method_bezier_track_get_key_out_handle:
  283. - :ref:`Vector2<class_Vector2>` **bezier_track_get_key_out_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  284. Returns the out handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
  285. ----
  286. .. _class_Animation_method_bezier_track_get_key_value:
  287. - :ref:`float<class_float>` **bezier_track_get_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  288. Returns the value of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
  289. ----
  290. .. _class_Animation_method_bezier_track_insert_key:
  291. - :ref:`int<class_int>` **bezier_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` value, :ref:`Vector2<class_Vector2>` in_handle=Vector2( 0, 0 ), :ref:`Vector2<class_Vector2>` out_handle=Vector2( 0, 0 ) **)**
  292. Inserts a Bezier Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of a Bezier Track.
  293. ``in_handle`` is the left-side weight of the added Bezier curve point, ``out_handle`` is the right-side one, while ``value`` is the actual value at this point.
  294. ----
  295. .. _class_Animation_method_bezier_track_interpolate:
  296. - :ref:`float<class_float>` **bezier_track_interpolate** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)** const
  297. Returns the interpolated value at the given ``time`` (in seconds). The ``track_idx`` must be the index of a Bezier Track.
  298. ----
  299. .. _class_Animation_method_bezier_track_set_key_in_handle:
  300. - void **bezier_track_set_key_in_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` in_handle **)**
  301. Sets the in handle of the key identified by ``key_idx`` to value ``in_handle``. The ``track_idx`` must be the index of a Bezier Track.
  302. ----
  303. .. _class_Animation_method_bezier_track_set_key_out_handle:
  304. - void **bezier_track_set_key_out_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` out_handle **)**
  305. Sets the out handle of the key identified by ``key_idx`` to value ``out_handle``. The ``track_idx`` must be the index of a Bezier Track.
  306. ----
  307. .. _class_Animation_method_bezier_track_set_key_value:
  308. - void **bezier_track_set_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` value **)**
  309. Sets the value of the key identified by ``key_idx`` to the given value. The ``track_idx`` must be the index of a Bezier Track.
  310. ----
  311. .. _class_Animation_method_clear:
  312. - void **clear** **(** **)**
  313. Clear the animation (clear all tracks and reset all).
  314. ----
  315. .. _class_Animation_method_copy_track:
  316. - void **copy_track** **(** :ref:`int<class_int>` track_idx, :ref:`Animation<class_Animation>` to_animation **)**
  317. Adds a new track that is a copy of the given track from ``to_animation``.
  318. ----
  319. .. _class_Animation_method_find_track:
  320. - :ref:`int<class_int>` **find_track** **(** :ref:`NodePath<class_NodePath>` path **)** const
  321. Returns the index of the specified track. If the track is not found, return -1.
  322. ----
  323. .. _class_Animation_method_get_track_count:
  324. - :ref:`int<class_int>` **get_track_count** **(** **)** const
  325. Returns the amount of tracks in the animation.
  326. ----
  327. .. _class_Animation_method_method_track_get_key_indices:
  328. - :ref:`PoolIntArray<class_PoolIntArray>` **method_track_get_key_indices** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** const
  329. Returns all the key indices of a method track, given a position and delta time.
  330. ----
  331. .. _class_Animation_method_method_track_get_name:
  332. - :ref:`String<class_String>` **method_track_get_name** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  333. Returns the method name of a method track.
  334. ----
  335. .. _class_Animation_method_method_track_get_params:
  336. - :ref:`Array<class_Array>` **method_track_get_params** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  337. Returns the arguments values to be called on a method track for a given key in a given track.
  338. ----
  339. .. _class_Animation_method_remove_track:
  340. - void **remove_track** **(** :ref:`int<class_int>` track_idx **)**
  341. Removes a track by specifying the track index.
  342. ----
  343. .. _class_Animation_method_track_find_key:
  344. - :ref:`int<class_int>` **track_find_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`bool<class_bool>` exact=false **)** const
  345. Finds the key index by time in a given track. Optionally, only find it if the exact time is given.
  346. ----
  347. .. _class_Animation_method_track_get_interpolation_loop_wrap:
  348. - :ref:`bool<class_bool>` **track_get_interpolation_loop_wrap** **(** :ref:`int<class_int>` track_idx **)** const
  349. Returns ``true`` if the track at ``idx`` wraps the interpolation loop. New tracks wrap the interpolation loop by default.
  350. ----
  351. .. _class_Animation_method_track_get_interpolation_type:
  352. - :ref:`InterpolationType<enum_Animation_InterpolationType>` **track_get_interpolation_type** **(** :ref:`int<class_int>` track_idx **)** const
  353. Returns the interpolation type of a given track.
  354. ----
  355. .. _class_Animation_method_track_get_key_count:
  356. - :ref:`int<class_int>` **track_get_key_count** **(** :ref:`int<class_int>` track_idx **)** const
  357. Returns the amount of keys in a given track.
  358. ----
  359. .. _class_Animation_method_track_get_key_time:
  360. - :ref:`float<class_float>` **track_get_key_time** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  361. Returns the time at which the key is located.
  362. ----
  363. .. _class_Animation_method_track_get_key_transition:
  364. - :ref:`float<class_float>` **track_get_key_transition** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  365. Returns the transition curve (easing) for a specific key (see the built-in math function :ref:`@GDScript.ease<class_@GDScript_method_ease>`).
  366. ----
  367. .. _class_Animation_method_track_get_key_value:
  368. - :ref:`Variant<class_Variant>` **track_get_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** const
  369. Returns the value of a given key in a given track.
  370. ----
  371. .. _class_Animation_method_track_get_path:
  372. - :ref:`NodePath<class_NodePath>` **track_get_path** **(** :ref:`int<class_int>` track_idx **)** const
  373. Gets the path of a track. For more information on the path format, see :ref:`track_set_path<class_Animation_method_track_set_path>`.
  374. ----
  375. .. _class_Animation_method_track_get_type:
  376. - :ref:`TrackType<enum_Animation_TrackType>` **track_get_type** **(** :ref:`int<class_int>` track_idx **)** const
  377. Gets the type of a track.
  378. ----
  379. .. _class_Animation_method_track_insert_key:
  380. - void **track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Variant<class_Variant>` key, :ref:`float<class_float>` transition=1 **)**
  381. Insert a generic key in a given track.
  382. ----
  383. .. _class_Animation_method_track_is_enabled:
  384. - :ref:`bool<class_bool>` **track_is_enabled** **(** :ref:`int<class_int>` track_idx **)** const
  385. Returns ``true`` if the track at index ``idx`` is enabled.
  386. ----
  387. .. _class_Animation_method_track_is_imported:
  388. - :ref:`bool<class_bool>` **track_is_imported** **(** :ref:`int<class_int>` track_idx **)** const
  389. Returns ``true`` if the given track is imported. Else, return ``false``.
  390. ----
  391. .. _class_Animation_method_track_move_down:
  392. - void **track_move_down** **(** :ref:`int<class_int>` track_idx **)**
  393. Moves a track down.
  394. ----
  395. .. _class_Animation_method_track_move_to:
  396. - void **track_move_to** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` to_idx **)**
  397. Changes the index position of track ``idx`` to the one defined in ``to_idx``.
  398. ----
  399. .. _class_Animation_method_track_move_up:
  400. - void **track_move_up** **(** :ref:`int<class_int>` track_idx **)**
  401. Moves a track up.
  402. ----
  403. .. _class_Animation_method_track_remove_key:
  404. - void **track_remove_key** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)**
  405. Removes a key by index in a given track.
  406. ----
  407. .. _class_Animation_method_track_remove_key_at_position:
  408. - void **track_remove_key_at_position** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` position **)**
  409. Removes a key by position (seconds) in a given track.
  410. ----
  411. .. _class_Animation_method_track_set_enabled:
  412. - void **track_set_enabled** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` enabled **)**
  413. Enables/disables the given track. Tracks are enabled by default.
  414. ----
  415. .. _class_Animation_method_track_set_imported:
  416. - void **track_set_imported** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` imported **)**
  417. Sets the given track as imported or not.
  418. ----
  419. .. _class_Animation_method_track_set_interpolation_loop_wrap:
  420. - void **track_set_interpolation_loop_wrap** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` interpolation **)**
  421. If ``true``, the track at ``idx`` wraps the interpolation loop.
  422. ----
  423. .. _class_Animation_method_track_set_interpolation_type:
  424. - void **track_set_interpolation_type** **(** :ref:`int<class_int>` track_idx, :ref:`InterpolationType<enum_Animation_InterpolationType>` interpolation **)**
  425. Sets the interpolation type of a given track.
  426. ----
  427. .. _class_Animation_method_track_set_key_time:
  428. - void **track_set_key_time** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` time **)**
  429. Sets the time of an existing key.
  430. ----
  431. .. _class_Animation_method_track_set_key_transition:
  432. - void **track_set_key_transition** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` transition **)**
  433. Sets the transition curve (easing) for a specific key (see the built-in math function :ref:`@GDScript.ease<class_@GDScript_method_ease>`).
  434. ----
  435. .. _class_Animation_method_track_set_key_value:
  436. - void **track_set_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key, :ref:`Variant<class_Variant>` value **)**
  437. Sets the value of an existing key.
  438. ----
  439. .. _class_Animation_method_track_set_path:
  440. - void **track_set_path** **(** :ref:`int<class_int>` track_idx, :ref:`NodePath<class_NodePath>` path **)**
  441. Sets the path of a track. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by ``":"``.
  442. For example, ``"character/skeleton:ankle"`` or ``"character/mesh:transform/local"``.
  443. ----
  444. .. _class_Animation_method_track_swap:
  445. - void **track_swap** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` with_idx **)**
  446. Swaps the track ``idx``'s index position with the track ``with_idx``.
  447. ----
  448. .. _class_Animation_method_transform_track_insert_key:
  449. - :ref:`int<class_int>` **transform_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` location, :ref:`Quat<class_Quat>` rotation, :ref:`Vector3<class_Vector3>` scale **)**
  450. Insert a transform key for a transform track.
  451. ----
  452. .. _class_Animation_method_transform_track_interpolate:
  453. - :ref:`Array<class_Array>` **transform_track_interpolate** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec **)** const
  454. Returns the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position (:ref:`Vector3<class_Vector3>`), rotation (:ref:`Quat<class_Quat>`) and scale (:ref:`Vector3<class_Vector3>`).
  455. ----
  456. .. _class_Animation_method_value_track_get_key_indices:
  457. - :ref:`PoolIntArray<class_PoolIntArray>` **value_track_get_key_indices** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** const
  458. Returns all the key indices of a value track, given a position and delta time.
  459. ----
  460. .. _class_Animation_method_value_track_get_update_mode:
  461. - :ref:`UpdateMode<enum_Animation_UpdateMode>` **value_track_get_update_mode** **(** :ref:`int<class_int>` track_idx **)** const
  462. Returns the update mode of a value track.
  463. ----
  464. .. _class_Animation_method_value_track_set_update_mode:
  465. - void **value_track_set_update_mode** **(** :ref:`int<class_int>` track_idx, :ref:`UpdateMode<enum_Animation_UpdateMode>` mode **)**
  466. Sets the update mode (see :ref:`UpdateMode<enum_Animation_UpdateMode>`) of a value track.