AnimationNode.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AnimationNode" inherits="Resource" version="3.3">
  3. <brief_description>
  4. Base resource for [AnimationTree] nodes.
  5. </brief_description>
  6. <description>
  7. Base resource for [AnimationTree] nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas.
  8. Inherit this when creating nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead.
  9. </description>
  10. <tutorials>
  11. <link>https://docs.godotengine.org/en/3.3/tutorials/animation/animation_tree.html</link>
  12. </tutorials>
  13. <methods>
  14. <method name="add_input">
  15. <return type="void">
  16. </return>
  17. <argument index="0" name="name" type="String">
  18. </argument>
  19. <description>
  20. Adds an input to the node. This is only useful for nodes created for use in an [AnimationNodeBlendTree].
  21. </description>
  22. </method>
  23. <method name="blend_animation">
  24. <return type="void">
  25. </return>
  26. <argument index="0" name="animation" type="String">
  27. </argument>
  28. <argument index="1" name="time" type="float">
  29. </argument>
  30. <argument index="2" name="delta" type="float">
  31. </argument>
  32. <argument index="3" name="seeked" type="bool">
  33. </argument>
  34. <argument index="4" name="blend" type="float">
  35. </argument>
  36. <description>
  37. Blend an animation by [code]blend[/code] amount (name must be valid in the linked [AnimationPlayer]). A [code]time[/code] and [code]delta[/code] may be passed, as well as whether [code]seek[/code] happened.
  38. </description>
  39. </method>
  40. <method name="blend_input">
  41. <return type="float">
  42. </return>
  43. <argument index="0" name="input_index" type="int">
  44. </argument>
  45. <argument index="1" name="time" type="float">
  46. </argument>
  47. <argument index="2" name="seek" type="bool">
  48. </argument>
  49. <argument index="3" name="blend" type="float">
  50. </argument>
  51. <argument index="4" name="filter" type="int" enum="AnimationNode.FilterAction" default="0">
  52. </argument>
  53. <argument index="5" name="optimize" type="bool" default="true">
  54. </argument>
  55. <description>
  56. Blend an input. This is only useful for nodes created for an [AnimationNodeBlendTree]. The [code]time[/code] parameter is a relative delta, unless [code]seek[/code] is [code]true[/code], in which case it is absolute. A filter mode may be optionally passed (see [enum FilterAction] for options).
  57. </description>
  58. </method>
  59. <method name="blend_node">
  60. <return type="float">
  61. </return>
  62. <argument index="0" name="name" type="String">
  63. </argument>
  64. <argument index="1" name="node" type="AnimationNode">
  65. </argument>
  66. <argument index="2" name="time" type="float">
  67. </argument>
  68. <argument index="3" name="seek" type="bool">
  69. </argument>
  70. <argument index="4" name="blend" type="float">
  71. </argument>
  72. <argument index="5" name="filter" type="int" enum="AnimationNode.FilterAction" default="0">
  73. </argument>
  74. <argument index="6" name="optimize" type="bool" default="true">
  75. </argument>
  76. <description>
  77. Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from [AnimationRootNode] instead, else editors will not display your node for addition.
  78. </description>
  79. </method>
  80. <method name="get_caption" qualifiers="virtual">
  81. <return type="String">
  82. </return>
  83. <description>
  84. Gets the text caption for this node (used by some editors).
  85. </description>
  86. </method>
  87. <method name="get_child_by_name" qualifiers="virtual">
  88. <return type="Object">
  89. </return>
  90. <argument index="0" name="name" type="String">
  91. </argument>
  92. <description>
  93. Gets a child node by index (used by editors inheriting from [AnimationRootNode]).
  94. </description>
  95. </method>
  96. <method name="get_child_nodes" qualifiers="virtual">
  97. <return type="Dictionary">
  98. </return>
  99. <description>
  100. Gets all children nodes in order as a [code]name: node[/code] dictionary. Only useful when inheriting [AnimationRootNode].
  101. </description>
  102. </method>
  103. <method name="get_input_count" qualifiers="const">
  104. <return type="int">
  105. </return>
  106. <description>
  107. Amount of inputs in this node, only useful for nodes that go into [AnimationNodeBlendTree].
  108. </description>
  109. </method>
  110. <method name="get_input_name">
  111. <return type="String">
  112. </return>
  113. <argument index="0" name="input" type="int">
  114. </argument>
  115. <description>
  116. Gets the name of an input by index.
  117. </description>
  118. </method>
  119. <method name="get_parameter" qualifiers="const">
  120. <return type="Variant">
  121. </return>
  122. <argument index="0" name="name" type="String">
  123. </argument>
  124. <description>
  125. Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
  126. </description>
  127. </method>
  128. <method name="get_parameter_default_value" qualifiers="virtual">
  129. <return type="Variant">
  130. </return>
  131. <argument index="0" name="name" type="String">
  132. </argument>
  133. <description>
  134. Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
  135. </description>
  136. </method>
  137. <method name="get_parameter_list" qualifiers="virtual">
  138. <return type="Array">
  139. </return>
  140. <description>
  141. Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list].
  142. </description>
  143. </method>
  144. <method name="has_filter" qualifiers="virtual">
  145. <return type="String">
  146. </return>
  147. <description>
  148. Returns [code]true[/code] whether you want the blend tree editor to display filter editing on this node.
  149. </description>
  150. </method>
  151. <method name="is_path_filtered" qualifiers="const">
  152. <return type="bool">
  153. </return>
  154. <argument index="0" name="path" type="NodePath">
  155. </argument>
  156. <description>
  157. Returns [code]true[/code] whether a given path is filtered.
  158. </description>
  159. </method>
  160. <method name="process" qualifiers="virtual">
  161. <return type="void">
  162. </return>
  163. <argument index="0" name="time" type="float">
  164. </argument>
  165. <argument index="1" name="seek" type="bool">
  166. </argument>
  167. <description>
  168. User-defined callback called when a custom node is processed. The [code]time[/code] parameter is a relative delta, unless [code]seek[/code] is [code]true[/code], in which case it is absolute.
  169. Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory.
  170. This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called).
  171. </description>
  172. </method>
  173. <method name="remove_input">
  174. <return type="void">
  175. </return>
  176. <argument index="0" name="index" type="int">
  177. </argument>
  178. <description>
  179. Removes an input, call this only when inactive.
  180. </description>
  181. </method>
  182. <method name="set_filter_path">
  183. <return type="void">
  184. </return>
  185. <argument index="0" name="path" type="NodePath">
  186. </argument>
  187. <argument index="1" name="enable" type="bool">
  188. </argument>
  189. <description>
  190. Adds or removes a path for the filter.
  191. </description>
  192. </method>
  193. <method name="set_parameter">
  194. <return type="void">
  195. </return>
  196. <argument index="0" name="name" type="String">
  197. </argument>
  198. <argument index="1" name="value" type="Variant">
  199. </argument>
  200. <description>
  201. Sets a custom parameter. These are used as local storage, because resources can be reused across the tree or scenes.
  202. </description>
  203. </method>
  204. </methods>
  205. <members>
  206. <member name="filter_enabled" type="bool" setter="set_filter_enabled" getter="is_filter_enabled">
  207. If [code]true[/code], filtering is enabled.
  208. </member>
  209. </members>
  210. <signals>
  211. <signal name="removed_from_graph">
  212. <description>
  213. Called when the node was removed from the graph.
  214. </description>
  215. </signal>
  216. <signal name="tree_changed">
  217. <description>
  218. Emitted by nodes that inherit from this class and that have an internal tree when one of their nodes changes. The nodes that emit this signal are [AnimationNodeBlendSpace1D], [AnimationNodeBlendSpace2D], [AnimationNodeStateMachine], and [AnimationNodeBlendTree].
  219. </description>
  220. </signal>
  221. </signals>
  222. <constants>
  223. <constant name="FILTER_IGNORE" value="0" enum="FilterAction">
  224. Do not use filtering.
  225. </constant>
  226. <constant name="FILTER_PASS" value="1" enum="FilterAction">
  227. Paths matching the filter will be allowed to pass.
  228. </constant>
  229. <constant name="FILTER_STOP" value="2" enum="FilterAction">
  230. Paths matching the filter will be discarded.
  231. </constant>
  232. <constant name="FILTER_BLEND" value="3" enum="FilterAction">
  233. Paths matching the filter will be blended (by the blend value).
  234. </constant>
  235. </constants>
  236. </class>