AnimationNodeStateMachine.xml 6.4 KB

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