class_animationtreeplayer.rst 53 KB

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