AnimationNode.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AnimationNode" inherits="Resource" category="Core" version="3.1.2">
  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. </tutorials>
  12. <methods>
  13. <method name="add_input">
  14. <return type="void">
  15. </return>
  16. <argument index="0" name="name" type="String">
  17. </argument>
  18. <description>
  19. Add an input to the node. This is only useful for nodes created for use in an [AnimationNodeBlendTree]
  20. </description>
  21. </method>
  22. <method name="blend_animation">
  23. <return type="void">
  24. </return>
  25. <argument index="0" name="animation" type="String">
  26. </argument>
  27. <argument index="1" name="time" type="float">
  28. </argument>
  29. <argument index="2" name="delta" type="float">
  30. </argument>
  31. <argument index="3" name="seeked" type="bool">
  32. </argument>
  33. <argument index="4" name="blend" type="float">
  34. </argument>
  35. <description>
  36. Blend an animation by "blend" amount (name must be valid in the linked [AnimationPlayer]). A time and delta mas be passed, as well as whether seek happened.
  37. </description>
  38. </method>
  39. <method name="blend_input">
  40. <return type="float">
  41. </return>
  42. <argument index="0" name="input_index" type="int">
  43. </argument>
  44. <argument index="1" name="time" type="float">
  45. </argument>
  46. <argument index="2" name="seek" type="bool">
  47. </argument>
  48. <argument index="3" name="blend" type="float">
  49. </argument>
  50. <argument index="4" name="filter" type="int" enum="AnimationNode.FilterAction" default="0">
  51. </argument>
  52. <argument index="5" name="optimize" type="bool" default="true">
  53. </argument>
  54. <description>
  55. Blend an input. This is only useful for nodes created for an [AnimationNodeBlendTree]. Time is a delta, unless "seek" is [code]true[/code], in which case it is absolute. A filter mode may be optionally passed.
  56. </description>
  57. </method>
  58. <method name="blend_node">
  59. <return type="float">
  60. </return>
  61. <argument index="0" name="name" type="String">
  62. </argument>
  63. <argument index="1" name="node" type="AnimationNode">
  64. </argument>
  65. <argument index="2" name="time" type="float">
  66. </argument>
  67. <argument index="3" name="seek" type="bool">
  68. </argument>
  69. <argument index="4" name="blend" type="float">
  70. </argument>
  71. <argument index="5" name="filter" type="int" enum="AnimationNode.FilterAction" default="0">
  72. </argument>
  73. <argument index="6" name="optimize" type="bool" default="true">
  74. </argument>
  75. <description>
  76. Blend another animaiton 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.
  77. </description>
  78. </method>
  79. <method name="get_caption" qualifiers="virtual">
  80. <return type="String">
  81. </return>
  82. <description>
  83. Get the text caption for this node (used by some editors)
  84. </description>
  85. </method>
  86. <method name="get_child_by_name" qualifiers="virtual">
  87. <return type="Object">
  88. </return>
  89. <argument index="0" name="name" type="String">
  90. </argument>
  91. <description>
  92. Get the a child node by index (used by editors inheriting from [AnimationRootNode]).
  93. </description>
  94. </method>
  95. <method name="get_child_nodes" qualifiers="virtual">
  96. <return type="Dictionary">
  97. </return>
  98. <description>
  99. Get all children nodes, in order as a name:node dictionary. Only useful when inheriting [AnimationRootNode].
  100. </description>
  101. </method>
  102. <method name="get_input_count" qualifiers="const">
  103. <return type="int">
  104. </return>
  105. <description>
  106. Amount of inputs in this node, only useful for nodes that go into [AnimationNodeBlendTree].
  107. </description>
  108. </method>
  109. <method name="get_input_name">
  110. <return type="String">
  111. </return>
  112. <argument index="0" name="input" type="int">
  113. </argument>
  114. <description>
  115. Get the name of an input by index.
  116. </description>
  117. </method>
  118. <method name="get_parameter" qualifiers="const">
  119. <return type="Variant">
  120. </return>
  121. <argument index="0" name="name" type="String">
  122. </argument>
  123. <description>
  124. Get the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
  125. </description>
  126. </method>
  127. <method name="get_parameter_default_value" qualifiers="virtual">
  128. <return type="Variant">
  129. </return>
  130. <argument index="0" name="name" type="String">
  131. </argument>
  132. <description>
  133. Get the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
  134. </description>
  135. </method>
  136. <method name="get_parameter_list" qualifiers="virtual">
  137. <return type="Array">
  138. </return>
  139. <description>
  140. Get 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].
  141. </description>
  142. </method>
  143. <method name="has_filter" qualifiers="virtual">
  144. <return type="String">
  145. </return>
  146. <description>
  147. Returns [code]true[/code] whether you want the blend tree editor to display filter editing on this node.
  148. </description>
  149. </method>
  150. <method name="is_path_filtered" qualifiers="const">
  151. <return type="bool">
  152. </return>
  153. <argument index="0" name="path" type="NodePath">
  154. </argument>
  155. <description>
  156. Returns [code]true[/code] whether a given path is filtered.
  157. </description>
  158. </method>
  159. <method name="process" qualifiers="virtual">
  160. <return type="void">
  161. </return>
  162. <argument index="0" name="time" type="float">
  163. </argument>
  164. <argument index="1" name="seek" type="bool">
  165. </argument>
  166. <description>
  167. Called when a custom node is processed. The argument "time" is relative, unless "seek" is [code]true[/code] (in which case it is absolute).
  168. Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions.
  169. You can also use [method get_parameter] and [method set_parameter] to modify local memory.
  170. This function returns the time left for the current animation to finish (if unsure, just 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. Remove 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. Add/Remove 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. Set 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. Returns whether 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>