class_animationtreeplayer.rst 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  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 AnimationTreePlayer.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_AnimationTreePlayer:
  6. AnimationTreePlayer
  7. ===================
  8. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Animation player that uses a node graph for blending animations.
  10. Description
  11. -----------
  12. A node graph tool for blending multiple animations bound to an :ref:`AnimationPlayer<class_AnimationPlayer>`. Especially useful for animating characters or other skeleton-based rigs. It can combine several animations to form a desired pose.
  13. It takes :ref:`Animation<class_Animation>`\ s from an :ref:`AnimationPlayer<class_AnimationPlayer>` node and mixes them depending on the graph.
  14. Tutorials
  15. ---------
  16. - :doc:`../tutorials/animation/animation_tree`
  17. Properties
  18. ----------
  19. +----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+
  20. | :ref:`bool<class_bool>` | :ref:`active<class_AnimationTreePlayer_property_active>` | ``false`` |
  21. +----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+
  22. | :ref:`NodePath<class_NodePath>` | :ref:`base_path<class_AnimationTreePlayer_property_base_path>` | ``NodePath("..")`` |
  23. +----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+
  24. | :ref:`NodePath<class_NodePath>` | :ref:`master_player<class_AnimationTreePlayer_property_master_player>` | ``NodePath("")`` |
  25. +----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+
  26. | :ref:`AnimationProcessMode<enum_AnimationTreePlayer_AnimationProcessMode>` | :ref:`playback_process_mode<class_AnimationTreePlayer_property_playback_process_mode>` | ``1`` |
  27. +----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+
  28. Methods
  29. -------
  30. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`add_node<class_AnimationTreePlayer_method_add_node>` **(** :ref:`NodeType<enum_AnimationTreePlayer_NodeType>` type, :ref:`String<class_String>` id **)** |
  32. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`advance<class_AnimationTreePlayer_method_advance>` **(** :ref:`float<class_float>` delta **)** |
  34. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`Animation<class_Animation>` | :ref:`animation_node_get_animation<class_AnimationTreePlayer_method_animation_node_get_animation>` **(** :ref:`String<class_String>` id **)** const |
  36. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`String<class_String>` | :ref:`animation_node_get_master_animation<class_AnimationTreePlayer_method_animation_node_get_master_animation>` **(** :ref:`String<class_String>` id **)** const |
  38. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`float<class_float>` | :ref:`animation_node_get_position<class_AnimationTreePlayer_method_animation_node_get_position>` **(** :ref:`String<class_String>` id **)** const |
  40. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`animation_node_set_animation<class_AnimationTreePlayer_method_animation_node_set_animation>` **(** :ref:`String<class_String>` id, :ref:`Animation<class_Animation>` animation **)** |
  42. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`animation_node_set_filter_path<class_AnimationTreePlayer_method_animation_node_set_filter_path>` **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)** |
  44. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`animation_node_set_master_animation<class_AnimationTreePlayer_method_animation_node_set_master_animation>` **(** :ref:`String<class_String>` id, :ref:`String<class_String>` source **)** |
  46. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`are_nodes_connected<class_AnimationTreePlayer_method_are_nodes_connected>` **(** :ref:`String<class_String>` id, :ref:`String<class_String>` dst_id, :ref:`int<class_int>` dst_input_idx **)** const |
  48. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`float<class_float>` | :ref:`blend2_node_get_amount<class_AnimationTreePlayer_method_blend2_node_get_amount>` **(** :ref:`String<class_String>` id **)** const |
  50. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`blend2_node_set_amount<class_AnimationTreePlayer_method_blend2_node_set_amount>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` blend **)** |
  52. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`blend2_node_set_filter_path<class_AnimationTreePlayer_method_blend2_node_set_filter_path>` **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)** |
  54. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`float<class_float>` | :ref:`blend3_node_get_amount<class_AnimationTreePlayer_method_blend3_node_get_amount>` **(** :ref:`String<class_String>` id **)** const |
  56. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`blend3_node_set_amount<class_AnimationTreePlayer_method_blend3_node_set_amount>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` blend **)** |
  58. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Vector2<class_Vector2>` | :ref:`blend4_node_get_amount<class_AnimationTreePlayer_method_blend4_node_get_amount>` **(** :ref:`String<class_String>` id **)** const |
  60. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | void | :ref:`blend4_node_set_amount<class_AnimationTreePlayer_method_blend4_node_set_amount>` **(** :ref:`String<class_String>` id, :ref:`Vector2<class_Vector2>` blend **)** |
  62. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`connect_nodes<class_AnimationTreePlayer_method_connect_nodes>` **(** :ref:`String<class_String>` id, :ref:`String<class_String>` dst_id, :ref:`int<class_int>` dst_input_idx **)** |
  64. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | void | :ref:`disconnect_nodes<class_AnimationTreePlayer_method_disconnect_nodes>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` dst_input_idx **)** |
  66. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_node_list<class_AnimationTreePlayer_method_get_node_list>` **(** **)** |
  68. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`float<class_float>` | :ref:`mix_node_get_amount<class_AnimationTreePlayer_method_mix_node_get_amount>` **(** :ref:`String<class_String>` id **)** const |
  70. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`mix_node_set_amount<class_AnimationTreePlayer_method_mix_node_set_amount>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` ratio **)** |
  72. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`node_exists<class_AnimationTreePlayer_method_node_exists>` **(** :ref:`String<class_String>` node **)** const |
  74. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`int<class_int>` | :ref:`node_get_input_count<class_AnimationTreePlayer_method_node_get_input_count>` **(** :ref:`String<class_String>` id **)** const |
  76. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`String<class_String>` | :ref:`node_get_input_source<class_AnimationTreePlayer_method_node_get_input_source>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` idx **)** const |
  78. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`Vector2<class_Vector2>` | :ref:`node_get_position<class_AnimationTreePlayer_method_node_get_position>` **(** :ref:`String<class_String>` id **)** const |
  80. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`NodeType<enum_AnimationTreePlayer_NodeType>` | :ref:`node_get_type<class_AnimationTreePlayer_method_node_get_type>` **(** :ref:`String<class_String>` id **)** const |
  82. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`node_rename<class_AnimationTreePlayer_method_node_rename>` **(** :ref:`String<class_String>` node, :ref:`String<class_String>` new_name **)** |
  84. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`node_set_position<class_AnimationTreePlayer_method_node_set_position>` **(** :ref:`String<class_String>` id, :ref:`Vector2<class_Vector2>` screen_position **)** |
  86. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`float<class_float>` | :ref:`oneshot_node_get_autorestart_delay<class_AnimationTreePlayer_method_oneshot_node_get_autorestart_delay>` **(** :ref:`String<class_String>` id **)** const |
  88. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`float<class_float>` | :ref:`oneshot_node_get_autorestart_random_delay<class_AnimationTreePlayer_method_oneshot_node_get_autorestart_random_delay>` **(** :ref:`String<class_String>` id **)** const |
  90. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`float<class_float>` | :ref:`oneshot_node_get_fadein_time<class_AnimationTreePlayer_method_oneshot_node_get_fadein_time>` **(** :ref:`String<class_String>` id **)** const |
  92. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`float<class_float>` | :ref:`oneshot_node_get_fadeout_time<class_AnimationTreePlayer_method_oneshot_node_get_fadeout_time>` **(** :ref:`String<class_String>` id **)** const |
  94. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`bool<class_bool>` | :ref:`oneshot_node_has_autorestart<class_AnimationTreePlayer_method_oneshot_node_has_autorestart>` **(** :ref:`String<class_String>` id **)** const |
  96. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`bool<class_bool>` | :ref:`oneshot_node_is_active<class_AnimationTreePlayer_method_oneshot_node_is_active>` **(** :ref:`String<class_String>` id **)** const |
  98. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`oneshot_node_set_autorestart<class_AnimationTreePlayer_method_oneshot_node_set_autorestart>` **(** :ref:`String<class_String>` id, :ref:`bool<class_bool>` enable **)** |
  100. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`oneshot_node_set_autorestart_delay<class_AnimationTreePlayer_method_oneshot_node_set_autorestart_delay>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` delay_sec **)** |
  102. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`oneshot_node_set_autorestart_random_delay<class_AnimationTreePlayer_method_oneshot_node_set_autorestart_random_delay>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` rand_sec **)** |
  104. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | void | :ref:`oneshot_node_set_fadein_time<class_AnimationTreePlayer_method_oneshot_node_set_fadein_time>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)** |
  106. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | void | :ref:`oneshot_node_set_fadeout_time<class_AnimationTreePlayer_method_oneshot_node_set_fadeout_time>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)** |
  108. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`oneshot_node_set_filter_path<class_AnimationTreePlayer_method_oneshot_node_set_filter_path>` **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)** |
  110. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | void | :ref:`oneshot_node_start<class_AnimationTreePlayer_method_oneshot_node_start>` **(** :ref:`String<class_String>` id **)** |
  112. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`oneshot_node_stop<class_AnimationTreePlayer_method_oneshot_node_stop>` **(** :ref:`String<class_String>` id **)** |
  114. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`recompute_caches<class_AnimationTreePlayer_method_recompute_caches>` **(** **)** |
  116. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`remove_node<class_AnimationTreePlayer_method_remove_node>` **(** :ref:`String<class_String>` id **)** |
  118. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`reset<class_AnimationTreePlayer_method_reset>` **(** **)** |
  120. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`float<class_float>` | :ref:`timescale_node_get_scale<class_AnimationTreePlayer_method_timescale_node_get_scale>` **(** :ref:`String<class_String>` id **)** const |
  122. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | void | :ref:`timescale_node_set_scale<class_AnimationTreePlayer_method_timescale_node_set_scale>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` scale **)** |
  124. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`timeseek_node_seek<class_AnimationTreePlayer_method_timeseek_node_seek>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` seconds **)** |
  126. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | void | :ref:`transition_node_delete_input<class_AnimationTreePlayer_method_transition_node_delete_input>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)** |
  128. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`int<class_int>` | :ref:`transition_node_get_current<class_AnimationTreePlayer_method_transition_node_get_current>` **(** :ref:`String<class_String>` id **)** const |
  130. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`int<class_int>` | :ref:`transition_node_get_input_count<class_AnimationTreePlayer_method_transition_node_get_input_count>` **(** :ref:`String<class_String>` id **)** const |
  132. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`float<class_float>` | :ref:`transition_node_get_xfade_time<class_AnimationTreePlayer_method_transition_node_get_xfade_time>` **(** :ref:`String<class_String>` id **)** const |
  134. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`bool<class_bool>` | :ref:`transition_node_has_input_auto_advance<class_AnimationTreePlayer_method_transition_node_has_input_auto_advance>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)** const |
  136. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`transition_node_set_current<class_AnimationTreePlayer_method_transition_node_set_current>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)** |
  138. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`transition_node_set_input_auto_advance<class_AnimationTreePlayer_method_transition_node_set_input_auto_advance>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx, :ref:`bool<class_bool>` enable **)** |
  140. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`transition_node_set_input_count<class_AnimationTreePlayer_method_transition_node_set_input_count>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` count **)** |
  142. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | void | :ref:`transition_node_set_xfade_time<class_AnimationTreePlayer_method_transition_node_set_xfade_time>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)** |
  144. +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. Enumerations
  146. ------------
  147. .. _enum_AnimationTreePlayer_NodeType:
  148. .. _class_AnimationTreePlayer_constant_NODE_OUTPUT:
  149. .. _class_AnimationTreePlayer_constant_NODE_ANIMATION:
  150. .. _class_AnimationTreePlayer_constant_NODE_ONESHOT:
  151. .. _class_AnimationTreePlayer_constant_NODE_MIX:
  152. .. _class_AnimationTreePlayer_constant_NODE_BLEND2:
  153. .. _class_AnimationTreePlayer_constant_NODE_BLEND3:
  154. .. _class_AnimationTreePlayer_constant_NODE_BLEND4:
  155. .. _class_AnimationTreePlayer_constant_NODE_TIMESCALE:
  156. .. _class_AnimationTreePlayer_constant_NODE_TIMESEEK:
  157. .. _class_AnimationTreePlayer_constant_NODE_TRANSITION:
  158. enum **NodeType**:
  159. - **NODE_OUTPUT** = **0** --- Output node.
  160. - **NODE_ANIMATION** = **1** --- Animation node.
  161. - **NODE_ONESHOT** = **2** --- OneShot node.
  162. - **NODE_MIX** = **3** --- Mix node.
  163. - **NODE_BLEND2** = **4** --- Blend2 node.
  164. - **NODE_BLEND3** = **5** --- Blend3 node.
  165. - **NODE_BLEND4** = **6** --- Blend4 node.
  166. - **NODE_TIMESCALE** = **7** --- TimeScale node.
  167. - **NODE_TIMESEEK** = **8** --- TimeSeek node.
  168. - **NODE_TRANSITION** = **9** --- Transition node.
  169. ----
  170. .. _enum_AnimationTreePlayer_AnimationProcessMode:
  171. .. _class_AnimationTreePlayer_constant_ANIMATION_PROCESS_PHYSICS:
  172. .. _class_AnimationTreePlayer_constant_ANIMATION_PROCESS_IDLE:
  173. enum **AnimationProcessMode**:
  174. - **ANIMATION_PROCESS_PHYSICS** = **0** --- Process animation during the physics process. This is especially useful when animating physics bodies.
  175. - **ANIMATION_PROCESS_IDLE** = **1** --- Process animation during the idle process.
  176. Property Descriptions
  177. ---------------------
  178. .. _class_AnimationTreePlayer_property_active:
  179. - :ref:`bool<class_bool>` **active**
  180. +-----------+-------------------+
  181. | *Default* | ``false`` |
  182. +-----------+-------------------+
  183. | *Setter* | set_active(value) |
  184. +-----------+-------------------+
  185. | *Getter* | is_active() |
  186. +-----------+-------------------+
  187. If ``true``, the ``AnimationTreePlayer`` is able to play animations.
  188. ----
  189. .. _class_AnimationTreePlayer_property_base_path:
  190. - :ref:`NodePath<class_NodePath>` **base_path**
  191. +-----------+----------------------+
  192. | *Default* | ``NodePath("..")`` |
  193. +-----------+----------------------+
  194. | *Setter* | set_base_path(value) |
  195. +-----------+----------------------+
  196. | *Getter* | get_base_path() |
  197. +-----------+----------------------+
  198. The node from which to relatively access other nodes.
  199. It accesses the bones, so it should point to the same node the :ref:`AnimationPlayer<class_AnimationPlayer>` would point its Root Node at.
  200. ----
  201. .. _class_AnimationTreePlayer_property_master_player:
  202. - :ref:`NodePath<class_NodePath>` **master_player**
  203. +-----------+--------------------------+
  204. | *Default* | ``NodePath("")`` |
  205. +-----------+--------------------------+
  206. | *Setter* | set_master_player(value) |
  207. +-----------+--------------------------+
  208. | *Getter* | get_master_player() |
  209. +-----------+--------------------------+
  210. The path to the :ref:`AnimationPlayer<class_AnimationPlayer>` from which this ``AnimationTreePlayer`` binds animations to animation nodes.
  211. Once set, :ref:`Animation<class_Animation>` nodes can be added to the ``AnimationTreePlayer``.
  212. ----
  213. .. _class_AnimationTreePlayer_property_playback_process_mode:
  214. - :ref:`AnimationProcessMode<enum_AnimationTreePlayer_AnimationProcessMode>` **playback_process_mode**
  215. +-----------+-----------------------------------+
  216. | *Default* | ``1`` |
  217. +-----------+-----------------------------------+
  218. | *Setter* | set_animation_process_mode(value) |
  219. +-----------+-----------------------------------+
  220. | *Getter* | get_animation_process_mode() |
  221. +-----------+-----------------------------------+
  222. The thread in which to update animations.
  223. Method Descriptions
  224. -------------------
  225. .. _class_AnimationTreePlayer_method_add_node:
  226. - void **add_node** **(** :ref:`NodeType<enum_AnimationTreePlayer_NodeType>` type, :ref:`String<class_String>` id **)**
  227. Adds a ``type`` node to the graph with name ``id``.
  228. ----
  229. .. _class_AnimationTreePlayer_method_advance:
  230. - void **advance** **(** :ref:`float<class_float>` delta **)**
  231. Shifts position in the animation timeline. ``delta`` is the time in seconds to shift. Events between the current frame and ``delta`` are handled.
  232. ----
  233. .. _class_AnimationTreePlayer_method_animation_node_get_animation:
  234. - :ref:`Animation<class_Animation>` **animation_node_get_animation** **(** :ref:`String<class_String>` id **)** const
  235. Returns the :ref:`AnimationPlayer<class_AnimationPlayer>`'s :ref:`Animation<class_Animation>` bound to the ``AnimationTreePlayer``'s animation node with name ``id``.
  236. ----
  237. .. _class_AnimationTreePlayer_method_animation_node_get_master_animation:
  238. - :ref:`String<class_String>` **animation_node_get_master_animation** **(** :ref:`String<class_String>` id **)** const
  239. Returns the name of the :ref:`master_player<class_AnimationTreePlayer_property_master_player>`'s :ref:`Animation<class_Animation>` bound to this animation node.
  240. ----
  241. .. _class_AnimationTreePlayer_method_animation_node_get_position:
  242. - :ref:`float<class_float>` **animation_node_get_position** **(** :ref:`String<class_String>` id **)** const
  243. Returns the absolute playback timestamp of the animation node with name ``id``.
  244. ----
  245. .. _class_AnimationTreePlayer_method_animation_node_set_animation:
  246. - void **animation_node_set_animation** **(** :ref:`String<class_String>` id, :ref:`Animation<class_Animation>` animation **)**
  247. Binds a new :ref:`Animation<class_Animation>` from the :ref:`master_player<class_AnimationTreePlayer_property_master_player>` to the ``AnimationTreePlayer``'s animation node with name ``id``.
  248. ----
  249. .. _class_AnimationTreePlayer_method_animation_node_set_filter_path:
  250. - void **animation_node_set_filter_path** **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)**
  251. If ``enable`` is ``true``, the animation node with ID ``id`` turns off the track modifying the property at ``path``. The modified node's children continue to animate.
  252. ----
  253. .. _class_AnimationTreePlayer_method_animation_node_set_master_animation:
  254. - void **animation_node_set_master_animation** **(** :ref:`String<class_String>` id, :ref:`String<class_String>` source **)**
  255. Binds the :ref:`Animation<class_Animation>` named ``source`` from :ref:`master_player<class_AnimationTreePlayer_property_master_player>` to the animation node ``id``. Recalculates caches.
  256. ----
  257. .. _class_AnimationTreePlayer_method_are_nodes_connected:
  258. - :ref:`bool<class_bool>` **are_nodes_connected** **(** :ref:`String<class_String>` id, :ref:`String<class_String>` dst_id, :ref:`int<class_int>` dst_input_idx **)** const
  259. Returns whether node ``id`` and ``dst_id`` are connected at the specified slot.
  260. ----
  261. .. _class_AnimationTreePlayer_method_blend2_node_get_amount:
  262. - :ref:`float<class_float>` **blend2_node_get_amount** **(** :ref:`String<class_String>` id **)** const
  263. Returns the blend amount of a Blend2 node given its name.
  264. ----
  265. .. _class_AnimationTreePlayer_method_blend2_node_set_amount:
  266. - void **blend2_node_set_amount** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` blend **)**
  267. Sets the blend amount of a Blend2 node given its name and value.
  268. A Blend2 node blends two animations (A and B) with the amount between 0 and 1.
  269. At 0, output is input A. Towards 1, the influence of A gets lessened, the influence of B gets raised. At 1, output is input B.
  270. ----
  271. .. _class_AnimationTreePlayer_method_blend2_node_set_filter_path:
  272. - void **blend2_node_set_filter_path** **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)**
  273. If ``enable`` is ``true``, the Blend2 node with name ``id`` turns off the track modifying the property at ``path``. The modified node's children continue to animate.
  274. ----
  275. .. _class_AnimationTreePlayer_method_blend3_node_get_amount:
  276. - :ref:`float<class_float>` **blend3_node_get_amount** **(** :ref:`String<class_String>` id **)** const
  277. Returns the blend amount of a Blend3 node given its name.
  278. ----
  279. .. _class_AnimationTreePlayer_method_blend3_node_set_amount:
  280. - void **blend3_node_set_amount** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` blend **)**
  281. Sets the blend amount of a Blend3 node given its name and value.
  282. A Blend3 Node blends three animations (A, B-, B+) with the amount between -1 and 1.
  283. At -1, output is input B-. From -1 to 0, the influence of B- gets lessened, the influence of A gets raised and the influence of B+ is 0. At 0, output is input A. From 0 to 1, the influence of A gets lessened, the influence of B+ gets raised and the influence of B+ is 0. At 1, output is input B+.
  284. ----
  285. .. _class_AnimationTreePlayer_method_blend4_node_get_amount:
  286. - :ref:`Vector2<class_Vector2>` **blend4_node_get_amount** **(** :ref:`String<class_String>` id **)** const
  287. Returns the blend amount of a Blend4 node given its name.
  288. ----
  289. .. _class_AnimationTreePlayer_method_blend4_node_set_amount:
  290. - void **blend4_node_set_amount** **(** :ref:`String<class_String>` id, :ref:`Vector2<class_Vector2>` blend **)**
  291. Sets the blend amount of a Blend4 node given its name and value.
  292. A Blend4 Node blends two pairs of animations.
  293. The two pairs are blended like Blend2 and then added together.
  294. ----
  295. .. _class_AnimationTreePlayer_method_connect_nodes:
  296. - :ref:`Error<enum_@GlobalScope_Error>` **connect_nodes** **(** :ref:`String<class_String>` id, :ref:`String<class_String>` dst_id, :ref:`int<class_int>` dst_input_idx **)**
  297. Connects node ``id`` to ``dst_id`` at the specified input slot.
  298. ----
  299. .. _class_AnimationTreePlayer_method_disconnect_nodes:
  300. - void **disconnect_nodes** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` dst_input_idx **)**
  301. Disconnects nodes connected to ``id`` at the specified input slot.
  302. ----
  303. .. _class_AnimationTreePlayer_method_get_node_list:
  304. - :ref:`PoolStringArray<class_PoolStringArray>` **get_node_list** **(** **)**
  305. Returns a :ref:`PoolStringArray<class_PoolStringArray>` containing the name of all nodes.
  306. ----
  307. .. _class_AnimationTreePlayer_method_mix_node_get_amount:
  308. - :ref:`float<class_float>` **mix_node_get_amount** **(** :ref:`String<class_String>` id **)** const
  309. Returns the mix amount of a Mix node given its name.
  310. ----
  311. .. _class_AnimationTreePlayer_method_mix_node_set_amount:
  312. - void **mix_node_set_amount** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` ratio **)**
  313. Sets the mix amount of a Mix node given its name and value.
  314. A Mix node adds input b to input a by the amount given by ratio.
  315. ----
  316. .. _class_AnimationTreePlayer_method_node_exists:
  317. - :ref:`bool<class_bool>` **node_exists** **(** :ref:`String<class_String>` node **)** const
  318. Check if a node exists (by name).
  319. ----
  320. .. _class_AnimationTreePlayer_method_node_get_input_count:
  321. - :ref:`int<class_int>` **node_get_input_count** **(** :ref:`String<class_String>` id **)** const
  322. Returns the input count for a given node. Different types of nodes have different amount of inputs.
  323. ----
  324. .. _class_AnimationTreePlayer_method_node_get_input_source:
  325. - :ref:`String<class_String>` **node_get_input_source** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` idx **)** const
  326. Returns the input source for a given node input.
  327. ----
  328. .. _class_AnimationTreePlayer_method_node_get_position:
  329. - :ref:`Vector2<class_Vector2>` **node_get_position** **(** :ref:`String<class_String>` id **)** const
  330. Returns position of a node in the graph given its name.
  331. ----
  332. .. _class_AnimationTreePlayer_method_node_get_type:
  333. - :ref:`NodeType<enum_AnimationTreePlayer_NodeType>` **node_get_type** **(** :ref:`String<class_String>` id **)** const
  334. Gets the node type, will return from :ref:`NodeType<enum_AnimationTreePlayer_NodeType>` enum.
  335. ----
  336. .. _class_AnimationTreePlayer_method_node_rename:
  337. - :ref:`Error<enum_@GlobalScope_Error>` **node_rename** **(** :ref:`String<class_String>` node, :ref:`String<class_String>` new_name **)**
  338. Renames a node in the graph.
  339. ----
  340. .. _class_AnimationTreePlayer_method_node_set_position:
  341. - void **node_set_position** **(** :ref:`String<class_String>` id, :ref:`Vector2<class_Vector2>` screen_position **)**
  342. Sets the position of a node in the graph given its name and position.
  343. ----
  344. .. _class_AnimationTreePlayer_method_oneshot_node_get_autorestart_delay:
  345. - :ref:`float<class_float>` **oneshot_node_get_autorestart_delay** **(** :ref:`String<class_String>` id **)** const
  346. Returns the autostart delay of a OneShot node given its name.
  347. ----
  348. .. _class_AnimationTreePlayer_method_oneshot_node_get_autorestart_random_delay:
  349. - :ref:`float<class_float>` **oneshot_node_get_autorestart_random_delay** **(** :ref:`String<class_String>` id **)** const
  350. Returns the autostart random delay of a OneShot node given its name.
  351. ----
  352. .. _class_AnimationTreePlayer_method_oneshot_node_get_fadein_time:
  353. - :ref:`float<class_float>` **oneshot_node_get_fadein_time** **(** :ref:`String<class_String>` id **)** const
  354. Returns the fade in time of a OneShot node given its name.
  355. ----
  356. .. _class_AnimationTreePlayer_method_oneshot_node_get_fadeout_time:
  357. - :ref:`float<class_float>` **oneshot_node_get_fadeout_time** **(** :ref:`String<class_String>` id **)** const
  358. Returns the fade out time of a OneShot node given its name.
  359. ----
  360. .. _class_AnimationTreePlayer_method_oneshot_node_has_autorestart:
  361. - :ref:`bool<class_bool>` **oneshot_node_has_autorestart** **(** :ref:`String<class_String>` id **)** const
  362. Returns whether a OneShot node will auto restart given its name.
  363. ----
  364. .. _class_AnimationTreePlayer_method_oneshot_node_is_active:
  365. - :ref:`bool<class_bool>` **oneshot_node_is_active** **(** :ref:`String<class_String>` id **)** const
  366. Returns whether a OneShot node is active given its name.
  367. ----
  368. .. _class_AnimationTreePlayer_method_oneshot_node_set_autorestart:
  369. - void **oneshot_node_set_autorestart** **(** :ref:`String<class_String>` id, :ref:`bool<class_bool>` enable **)**
  370. Sets the autorestart property of a OneShot node given its name and value.
  371. ----
  372. .. _class_AnimationTreePlayer_method_oneshot_node_set_autorestart_delay:
  373. - void **oneshot_node_set_autorestart_delay** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` delay_sec **)**
  374. Sets the autorestart delay of a OneShot node given its name and value in seconds.
  375. ----
  376. .. _class_AnimationTreePlayer_method_oneshot_node_set_autorestart_random_delay:
  377. - void **oneshot_node_set_autorestart_random_delay** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` rand_sec **)**
  378. Sets the autorestart random delay of a OneShot node given its name and value in seconds.
  379. ----
  380. .. _class_AnimationTreePlayer_method_oneshot_node_set_fadein_time:
  381. - void **oneshot_node_set_fadein_time** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)**
  382. Sets the fade in time of a OneShot node given its name and value in seconds.
  383. ----
  384. .. _class_AnimationTreePlayer_method_oneshot_node_set_fadeout_time:
  385. - void **oneshot_node_set_fadeout_time** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)**
  386. Sets the fade out time of a OneShot node given its name and value in seconds.
  387. ----
  388. .. _class_AnimationTreePlayer_method_oneshot_node_set_filter_path:
  389. - void **oneshot_node_set_filter_path** **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)**
  390. If ``enable`` is ``true``, the OneShot node with ID ``id`` turns off the track modifying the property at ``path``. The modified node's children continue to animate.
  391. ----
  392. .. _class_AnimationTreePlayer_method_oneshot_node_start:
  393. - void **oneshot_node_start** **(** :ref:`String<class_String>` id **)**
  394. Starts a OneShot node given its name.
  395. ----
  396. .. _class_AnimationTreePlayer_method_oneshot_node_stop:
  397. - void **oneshot_node_stop** **(** :ref:`String<class_String>` id **)**
  398. Stops the OneShot node with name ``id``.
  399. ----
  400. .. _class_AnimationTreePlayer_method_recompute_caches:
  401. - void **recompute_caches** **(** **)**
  402. Manually recalculates the cache of track information generated from animation nodes. Needed when external sources modify the animation nodes' state.
  403. ----
  404. .. _class_AnimationTreePlayer_method_remove_node:
  405. - void **remove_node** **(** :ref:`String<class_String>` id **)**
  406. Removes the animation node with name ``id``.
  407. ----
  408. .. _class_AnimationTreePlayer_method_reset:
  409. - void **reset** **(** **)**
  410. Resets this ``AnimationTreePlayer``.
  411. ----
  412. .. _class_AnimationTreePlayer_method_timescale_node_get_scale:
  413. - :ref:`float<class_float>` **timescale_node_get_scale** **(** :ref:`String<class_String>` id **)** const
  414. Returns the time scale value of the TimeScale node with name ``id``.
  415. ----
  416. .. _class_AnimationTreePlayer_method_timescale_node_set_scale:
  417. - void **timescale_node_set_scale** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` scale **)**
  418. Sets the time scale of the TimeScale node with name ``id`` to ``scale``.
  419. The TimeScale node is used to speed :ref:`Animation<class_Animation>`\ s up if the scale is above 1 or slow them down if it is below 1.
  420. If applied after a blend or mix, affects all input animations to that blend or mix.
  421. ----
  422. .. _class_AnimationTreePlayer_method_timeseek_node_seek:
  423. - void **timeseek_node_seek** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` seconds **)**
  424. Sets the time seek value of the TimeSeek node with name ``id`` to ``seconds``.
  425. This functions as a seek in the :ref:`Animation<class_Animation>` or the blend or mix of :ref:`Animation<class_Animation>`\ s input in it.
  426. ----
  427. .. _class_AnimationTreePlayer_method_transition_node_delete_input:
  428. - void **transition_node_delete_input** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)**
  429. Deletes the input at ``input_idx`` for the transition node with name ``id``.
  430. ----
  431. .. _class_AnimationTreePlayer_method_transition_node_get_current:
  432. - :ref:`int<class_int>` **transition_node_get_current** **(** :ref:`String<class_String>` id **)** const
  433. Returns the index of the currently evaluated input for the transition node with name ``id``.
  434. ----
  435. .. _class_AnimationTreePlayer_method_transition_node_get_input_count:
  436. - :ref:`int<class_int>` **transition_node_get_input_count** **(** :ref:`String<class_String>` id **)** const
  437. Returns the number of inputs for the transition node with name ``id``. You can add inputs by right-clicking on the transition node.
  438. ----
  439. .. _class_AnimationTreePlayer_method_transition_node_get_xfade_time:
  440. - :ref:`float<class_float>` **transition_node_get_xfade_time** **(** :ref:`String<class_String>` id **)** const
  441. Returns the cross fade time for the transition node with name ``id``.
  442. ----
  443. .. _class_AnimationTreePlayer_method_transition_node_has_input_auto_advance:
  444. - :ref:`bool<class_bool>` **transition_node_has_input_auto_advance** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)** const
  445. Returns ``true`` if the input at ``input_idx`` on the transition node with name ``id`` is set to automatically advance to the next input upon completion.
  446. ----
  447. .. _class_AnimationTreePlayer_method_transition_node_set_current:
  448. - void **transition_node_set_current** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)**
  449. The transition node with name ``id`` sets its current input at ``input_idx``.
  450. ----
  451. .. _class_AnimationTreePlayer_method_transition_node_set_input_auto_advance:
  452. - void **transition_node_set_input_auto_advance** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx, :ref:`bool<class_bool>` enable **)**
  453. The transition node with name ``id`` advances to its next input automatically when the input at ``input_idx`` completes.
  454. ----
  455. .. _class_AnimationTreePlayer_method_transition_node_set_input_count:
  456. - void **transition_node_set_input_count** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` count **)**
  457. Resizes the number of inputs available for the transition node with name ``id``.
  458. ----
  459. .. _class_AnimationTreePlayer_method_transition_node_set_xfade_time:
  460. - void **transition_node_set_xfade_time** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)**
  461. The transition node with name ``id`` sets its cross fade time to ``time_sec``.