AnimationNodeStateMachine.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AnimationNodeStateMachine" inherits="AnimationRootNode" version="3.2">
  3. <brief_description>
  4. State machine for control of animations.
  5. </brief_description>
  6. <description>
  7. Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the [AnimationNodeStateMachinePlayback] object from the [AnimationTree] node to control it programmatically.
  8. [b]Example:[/b]
  9. [codeblock]
  10. var state_machine = $AnimationTree.get("parameters/playback")
  11. state_machine.travel("some_state")
  12. [/codeblock]
  13. </description>
  14. <tutorials>
  15. <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
  16. </tutorials>
  17. <methods>
  18. <method name="add_node">
  19. <return type="void">
  20. </return>
  21. <argument index="0" name="name" type="String">
  22. </argument>
  23. <argument index="1" name="node" type="AnimationNode">
  24. </argument>
  25. <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )">
  26. </argument>
  27. <description>
  28. Adds a new node to the graph. The [code]position[/code] is used for display in the editor.
  29. </description>
  30. </method>
  31. <method name="add_transition">
  32. <return type="void">
  33. </return>
  34. <argument index="0" name="from" type="String">
  35. </argument>
  36. <argument index="1" name="to" type="String">
  37. </argument>
  38. <argument index="2" name="transition" type="AnimationNodeStateMachineTransition">
  39. </argument>
  40. <description>
  41. Adds a transition between the given nodes.
  42. </description>
  43. </method>
  44. <method name="get_end_node" qualifiers="const">
  45. <return type="String">
  46. </return>
  47. <description>
  48. Returns the graph's end node.
  49. </description>
  50. </method>
  51. <method name="get_graph_offset" qualifiers="const">
  52. <return type="Vector2">
  53. </return>
  54. <description>
  55. Returns the draw offset of the graph. Used for display in the editor.
  56. </description>
  57. </method>
  58. <method name="get_node" qualifiers="const">
  59. <return type="AnimationNode">
  60. </return>
  61. <argument index="0" name="name" type="String">
  62. </argument>
  63. <description>
  64. Returns the animation node with the given name.
  65. </description>
  66. </method>
  67. <method name="get_node_name" qualifiers="const">
  68. <return type="String">
  69. </return>
  70. <argument index="0" name="node" type="AnimationNode">
  71. </argument>
  72. <description>
  73. Returns the given animation node's name.
  74. </description>
  75. </method>
  76. <method name="get_node_position" qualifiers="const">
  77. <return type="Vector2">
  78. </return>
  79. <argument index="0" name="name" type="String">
  80. </argument>
  81. <description>
  82. Returns the given node's coordinates. Used for display in the editor.
  83. </description>
  84. </method>
  85. <method name="get_start_node" qualifiers="const">
  86. <return type="String">
  87. </return>
  88. <description>
  89. Returns the graph's end node.
  90. </description>
  91. </method>
  92. <method name="get_transition" qualifiers="const">
  93. <return type="AnimationNodeStateMachineTransition">
  94. </return>
  95. <argument index="0" name="idx" type="int">
  96. </argument>
  97. <description>
  98. Returns the given transition.
  99. </description>
  100. </method>
  101. <method name="get_transition_count" qualifiers="const">
  102. <return type="int">
  103. </return>
  104. <description>
  105. Returns the number of connections in the graph.
  106. </description>
  107. </method>
  108. <method name="get_transition_from" qualifiers="const">
  109. <return type="String">
  110. </return>
  111. <argument index="0" name="idx" type="int">
  112. </argument>
  113. <description>
  114. Returns the given transition's start node.
  115. </description>
  116. </method>
  117. <method name="get_transition_to" qualifiers="const">
  118. <return type="String">
  119. </return>
  120. <argument index="0" name="idx" type="int">
  121. </argument>
  122. <description>
  123. Returns the given transition's end node.
  124. </description>
  125. </method>
  126. <method name="has_node" qualifiers="const">
  127. <return type="bool">
  128. </return>
  129. <argument index="0" name="name" type="String">
  130. </argument>
  131. <description>
  132. Returns [code]true[/code] if the graph contains the given node.
  133. </description>
  134. </method>
  135. <method name="has_transition" qualifiers="const">
  136. <return type="bool">
  137. </return>
  138. <argument index="0" name="from" type="String">
  139. </argument>
  140. <argument index="1" name="to" type="String">
  141. </argument>
  142. <description>
  143. Returns [code]true[/code] if there is a transition between the given nodes.
  144. </description>
  145. </method>
  146. <method name="remove_node">
  147. <return type="void">
  148. </return>
  149. <argument index="0" name="name" type="String">
  150. </argument>
  151. <description>
  152. Deletes the given node from the graph.
  153. </description>
  154. </method>
  155. <method name="remove_transition">
  156. <return type="void">
  157. </return>
  158. <argument index="0" name="from" type="String">
  159. </argument>
  160. <argument index="1" name="to" type="String">
  161. </argument>
  162. <description>
  163. Deletes the transition between the two specified nodes.
  164. </description>
  165. </method>
  166. <method name="remove_transition_by_index">
  167. <return type="void">
  168. </return>
  169. <argument index="0" name="idx" type="int">
  170. </argument>
  171. <description>
  172. Deletes the given transition by index.
  173. </description>
  174. </method>
  175. <method name="rename_node">
  176. <return type="void">
  177. </return>
  178. <argument index="0" name="name" type="String">
  179. </argument>
  180. <argument index="1" name="new_name" type="String">
  181. </argument>
  182. <description>
  183. Renames the given node.
  184. </description>
  185. </method>
  186. <method name="set_end_node">
  187. <return type="void">
  188. </return>
  189. <argument index="0" name="name" type="String">
  190. </argument>
  191. <description>
  192. Sets the given node as the graph end point.
  193. </description>
  194. </method>
  195. <method name="set_graph_offset">
  196. <return type="void">
  197. </return>
  198. <argument index="0" name="offset" type="Vector2">
  199. </argument>
  200. <description>
  201. Sets the draw offset of the graph. Used for display in the editor.
  202. </description>
  203. </method>
  204. <method name="set_node_position">
  205. <return type="void">
  206. </return>
  207. <argument index="0" name="name" type="String">
  208. </argument>
  209. <argument index="1" name="position" type="Vector2">
  210. </argument>
  211. <description>
  212. Sets the node's coordinates. Used for display in the editor.
  213. </description>
  214. </method>
  215. <method name="set_start_node">
  216. <return type="void">
  217. </return>
  218. <argument index="0" name="name" type="String">
  219. </argument>
  220. <description>
  221. Sets the given node as the graph start point.
  222. </description>
  223. </method>
  224. </methods>
  225. <constants>
  226. </constants>
  227. </class>