2
0

AnimationNode.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AnimationNode" inherits="Resource" version="4.0">
  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 title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
  12. </tutorials>
  13. <methods>
  14. <method name="_get_caption" qualifiers="virtual const">
  15. <return type="String" />
  16. <description>
  17. Gets the text caption for this node (used by some editors).
  18. </description>
  19. </method>
  20. <method name="_get_child_by_name" qualifiers="virtual const">
  21. <return type="AnimationNode" />
  22. <argument index="0" name="name" type="StringName" />
  23. <description>
  24. Gets a child node by index (used by editors inheriting from [AnimationRootNode]).
  25. </description>
  26. </method>
  27. <method name="_get_child_nodes" qualifiers="virtual const">
  28. <return type="Dictionary" />
  29. <description>
  30. Gets all children nodes in order as a [code]name: node[/code] dictionary. Only useful when inheriting [AnimationRootNode].
  31. </description>
  32. </method>
  33. <method name="_get_parameter_default_value" qualifiers="virtual const">
  34. <return type="Variant" />
  35. <argument index="0" name="parameter" type="StringName" />
  36. <description>
  37. 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.
  38. </description>
  39. </method>
  40. <method name="_get_parameter_list" qualifiers="virtual const">
  41. <return type="Array" />
  42. <description>
  43. 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].
  44. </description>
  45. </method>
  46. <method name="_has_filter" qualifiers="virtual const">
  47. <return type="bool" />
  48. <description>
  49. Returns [code]true[/code] whether you want the blend tree editor to display filter editing on this node.
  50. </description>
  51. </method>
  52. <method name="_process" qualifiers="virtual const">
  53. <return type="float" />
  54. <argument index="0" name="time" type="float" />
  55. <argument index="1" name="seek" type="bool" />
  56. <description>
  57. 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.
  58. 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.
  59. This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called).
  60. </description>
  61. </method>
  62. <method name="add_input">
  63. <return type="void" />
  64. <argument index="0" name="name" type="String" />
  65. <description>
  66. Adds an input to the node. This is only useful for nodes created for use in an [AnimationNodeBlendTree].
  67. </description>
  68. </method>
  69. <method name="blend_animation">
  70. <return type="void" />
  71. <argument index="0" name="animation" type="StringName" />
  72. <argument index="1" name="time" type="float" />
  73. <argument index="2" name="delta" type="float" />
  74. <argument index="3" name="seeked" type="bool" />
  75. <argument index="4" name="blend" type="float" />
  76. <description>
  77. 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.
  78. </description>
  79. </method>
  80. <method name="blend_input">
  81. <return type="float" />
  82. <argument index="0" name="input_index" type="int" />
  83. <argument index="1" name="time" type="float" />
  84. <argument index="2" name="seek" type="bool" />
  85. <argument index="3" name="blend" type="float" />
  86. <argument index="4" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" />
  87. <argument index="5" name="optimize" type="bool" default="true" />
  88. <description>
  89. 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).
  90. </description>
  91. </method>
  92. <method name="blend_node">
  93. <return type="float" />
  94. <argument index="0" name="name" type="StringName" />
  95. <argument index="1" name="node" type="AnimationNode" />
  96. <argument index="2" name="time" type="float" />
  97. <argument index="3" name="seek" type="bool" />
  98. <argument index="4" name="blend" type="float" />
  99. <argument index="5" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" />
  100. <argument index="6" name="optimize" type="bool" default="true" />
  101. <description>
  102. 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.
  103. </description>
  104. </method>
  105. <method name="get_input_count" qualifiers="const">
  106. <return type="int" />
  107. <description>
  108. Amount of inputs in this node, only useful for nodes that go into [AnimationNodeBlendTree].
  109. </description>
  110. </method>
  111. <method name="get_input_name">
  112. <return type="String" />
  113. <argument index="0" name="input" type="int" />
  114. <description>
  115. Gets the name of an input by index.
  116. </description>
  117. </method>
  118. <method name="get_parameter" qualifiers="const">
  119. <return type="Variant" />
  120. <argument index="0" name="name" type="StringName" />
  121. <description>
  122. Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
  123. </description>
  124. </method>
  125. <method name="is_path_filtered" qualifiers="const">
  126. <return type="bool" />
  127. <argument index="0" name="path" type="NodePath" />
  128. <description>
  129. Returns [code]true[/code] whether a given path is filtered.
  130. </description>
  131. </method>
  132. <method name="remove_input">
  133. <return type="void" />
  134. <argument index="0" name="index" type="int" />
  135. <description>
  136. Removes an input, call this only when inactive.
  137. </description>
  138. </method>
  139. <method name="set_filter_path">
  140. <return type="void" />
  141. <argument index="0" name="path" type="NodePath" />
  142. <argument index="1" name="enable" type="bool" />
  143. <description>
  144. Adds or removes a path for the filter.
  145. </description>
  146. </method>
  147. <method name="set_parameter">
  148. <return type="void" />
  149. <argument index="0" name="name" type="StringName" />
  150. <argument index="1" name="value" type="Variant" />
  151. <description>
  152. Sets a custom parameter. These are used as local storage, because resources can be reused across the tree or scenes.
  153. </description>
  154. </method>
  155. </methods>
  156. <members>
  157. <member name="filter_enabled" type="bool" setter="set_filter_enabled" getter="is_filter_enabled">
  158. If [code]true[/code], filtering is enabled.
  159. </member>
  160. </members>
  161. <signals>
  162. <signal name="removed_from_graph">
  163. <description>
  164. Called when the node was removed from the graph.
  165. </description>
  166. </signal>
  167. <signal name="tree_changed">
  168. <description>
  169. 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].
  170. </description>
  171. </signal>
  172. </signals>
  173. <constants>
  174. <constant name="FILTER_IGNORE" value="0" enum="FilterAction">
  175. Do not use filtering.
  176. </constant>
  177. <constant name="FILTER_PASS" value="1" enum="FilterAction">
  178. Paths matching the filter will be allowed to pass.
  179. </constant>
  180. <constant name="FILTER_STOP" value="2" enum="FilterAction">
  181. Paths matching the filter will be discarded.
  182. </constant>
  183. <constant name="FILTER_BLEND" value="3" enum="FilterAction">
  184. Paths matching the filter will be blended (by the blend value).
  185. </constant>
  186. </constants>
  187. </class>