AnimationNode.xml 8.2 KB

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