class_animationnode.rst 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the AnimationNode.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_AnimationNode:
  5. AnimationNode
  6. =============
  7. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Inherited By:** :ref:`AnimationNodeAdd2<class_AnimationNodeAdd2>`, :ref:`AnimationNodeAdd3<class_AnimationNodeAdd3>`, :ref:`AnimationNodeTimeScale<class_AnimationNodeTimeScale>`, :ref:`AnimationRootNode<class_AnimationRootNode>`, :ref:`AnimationNodeBlend2<class_AnimationNodeBlend2>`, :ref:`AnimationNodeBlend3<class_AnimationNodeBlend3>`, :ref:`AnimationNodeTimeSeek<class_AnimationNodeTimeSeek>`, :ref:`AnimationNodeOneShot<class_AnimationNodeOneShot>`, :ref:`AnimationNodeTransition<class_AnimationNodeTransition>`, :ref:`AnimationNodeOutput<class_AnimationNodeOutput>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes.
  13. Properties
  14. ----------
  15. +-------------------------+-----------------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`filter_enabled<class_AnimationNode_filter_enabled>` |
  17. +-------------------------+-----------------------------------------------------------+
  18. Methods
  19. -------
  20. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`add_input<class_AnimationNode_add_input>` **(** :ref:`String<class_String>` name **)** |
  22. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`blend_animation<class_AnimationNode_blend_animation>` **(** :ref:`String<class_String>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`float<class_float>` blend **)** |
  24. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`float<class_float>` | :ref:`blend_input<class_AnimationNode_blend_input>` **(** :ref:`int<class_int>` input_index, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)** |
  26. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`blend_node<class_AnimationNode_blend_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)** |
  28. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`String<class_String>` | :ref:`get_caption<class_AnimationNode_get_caption>` **(** **)** virtual |
  30. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`Object<class_Object>` | :ref:`get_child_by_name<class_AnimationNode_get_child_by_name>` **(** :ref:`String<class_String>` name **)** virtual |
  32. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_child_nodes<class_AnimationNode_get_child_nodes>` **(** **)** virtual |
  34. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`int<class_int>` | :ref:`get_input_count<class_AnimationNode_get_input_count>` **(** **)** const |
  36. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`String<class_String>` | :ref:`get_input_name<class_AnimationNode_get_input_name>` **(** :ref:`int<class_int>` input **)** |
  38. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`Variant<class_Variant>` | :ref:`get_parameter<class_AnimationNode_get_parameter>` **(** :ref:`String<class_String>` name **)** const |
  40. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Variant<class_Variant>` | :ref:`get_parameter_default_value<class_AnimationNode_get_parameter_default_value>` **(** :ref:`String<class_String>` name **)** virtual |
  42. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`Array<class_Array>` | :ref:`get_parameter_list<class_AnimationNode_get_parameter_list>` **(** **)** virtual |
  44. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`String<class_String>` | :ref:`has_filter<class_AnimationNode_has_filter>` **(** **)** virtual |
  46. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`is_path_filtered<class_AnimationNode_is_path_filtered>` **(** :ref:`NodePath<class_NodePath>` path **)** const |
  48. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`process<class_AnimationNode_process>` **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek **)** virtual |
  50. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`remove_input<class_AnimationNode_remove_input>` **(** :ref:`int<class_int>` index **)** |
  52. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`set_filter_path<class_AnimationNode_set_filter_path>` **(** :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)** |
  54. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`set_parameter<class_AnimationNode_set_parameter>` **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)** |
  56. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. Signals
  58. -------
  59. .. _class_AnimationNode_removed_from_graph:
  60. - **removed_from_graph** **(** **)**
  61. Called when the node was removed from the graph.
  62. .. _class_AnimationNode_tree_changed:
  63. - **tree_changed** **(** **)**
  64. Enumerations
  65. ------------
  66. .. _enum_AnimationNode_FilterAction:
  67. enum **FilterAction**:
  68. - **FILTER_IGNORE** = **0** --- Do not use filtering.
  69. - **FILTER_PASS** = **1** --- Paths matching the filter will be allowed to pass.
  70. - **FILTER_STOP** = **2** --- Paths matching the filter will be discarded.
  71. - **FILTER_BLEND** = **3** --- Paths matching the filter will be blended (by the blend value).
  72. Description
  73. -----------
  74. Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes. In general it's not used directly but you can create custom ones with custom blending formulas.
  75. Inherit this when creating nodes mainly for use in :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`, otherwise :ref:`AnimationRootNode<class_AnimationRootNode>` should be used instead.
  76. Property Descriptions
  77. ---------------------
  78. .. _class_AnimationNode_filter_enabled:
  79. - :ref:`bool<class_bool>` **filter_enabled**
  80. +----------+---------------------------+
  81. | *Setter* | set_filter_enabled(value) |
  82. +----------+---------------------------+
  83. | *Getter* | is_filter_enabled() |
  84. +----------+---------------------------+
  85. Return whether filtering is enabled.
  86. Method Descriptions
  87. -------------------
  88. .. _class_AnimationNode_add_input:
  89. - void **add_input** **(** :ref:`String<class_String>` name **)**
  90. Add an input to the node. This is only useful for nodes created for use in an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`
  91. .. _class_AnimationNode_blend_animation:
  92. - void **blend_animation** **(** :ref:`String<class_String>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`float<class_float>` blend **)**
  93. Blend an animation by "blend" amount (name must be valid in the linked :ref:`AnimationPlayer<class_AnimationPlayer>`). A time and delta mas be passed, as well as whether seek happened.
  94. .. _class_AnimationNode_blend_input:
  95. - :ref:`float<class_float>` **blend_input** **(** :ref:`int<class_int>` input_index, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)**
  96. 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.
  97. .. _class_AnimationNode_blend_node:
  98. - :ref:`float<class_float>` **blend_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)**
  99. Blend another animaiton node (in case this node contains children animation nodes). This function is only useful if you inherit from :ref:`AnimationRootNode<class_AnimationRootNode>` instead, else editors will not display your node for addition.
  100. .. _class_AnimationNode_get_caption:
  101. - :ref:`String<class_String>` **get_caption** **(** **)** virtual
  102. Get the text caption for this node (used by some editors)
  103. .. _class_AnimationNode_get_child_by_name:
  104. - :ref:`Object<class_Object>` **get_child_by_name** **(** :ref:`String<class_String>` name **)** virtual
  105. Get the a child node by index (used by editors inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`).
  106. .. _class_AnimationNode_get_child_nodes:
  107. - :ref:`Dictionary<class_Dictionary>` **get_child_nodes** **(** **)** virtual
  108. Get all children nodes, in order as a name:node dictionary. Only useful when inheriting :ref:`AnimationRootNode<class_AnimationRootNode>`.
  109. .. _class_AnimationNode_get_input_count:
  110. - :ref:`int<class_int>` **get_input_count** **(** **)** const
  111. Amount of inputs in this node, only useful for nodes that go into AnimationBlendTree.
  112. .. _class_AnimationNode_get_input_name:
  113. - :ref:`String<class_String>` **get_input_name** **(** :ref:`int<class_int>` input **)**
  114. Get the name of an input by index.
  115. .. _class_AnimationNode_get_parameter:
  116. - :ref:`Variant<class_Variant>` **get_parameter** **(** :ref:`String<class_String>` name **)** const
  117. Get the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
  118. .. _class_AnimationNode_get_parameter_default_value:
  119. - :ref:`Variant<class_Variant>` **get_parameter_default_value** **(** :ref:`String<class_String>` name **)** virtual
  120. 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.
  121. .. _class_AnimationNode_get_parameter_list:
  122. - :ref:`Array<class_Array>` **get_parameter_list** **(** **)** virtual
  123. Get the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
  124. Format is similar to Object.get_property_list
  125. .. _class_AnimationNode_has_filter:
  126. - :ref:`String<class_String>` **has_filter** **(** **)** virtual
  127. Return true whether you want the blend tree editor to display filter editing on this node.
  128. .. _class_AnimationNode_is_path_filtered:
  129. - :ref:`bool<class_bool>` **is_path_filtered** **(** :ref:`NodePath<class_NodePath>` path **)** const
  130. Return true wether a given path is filtered.
  131. .. _class_AnimationNode_process:
  132. - void **process** **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek **)** virtual
  133. Called when a custom node is processed. The argument "time" is relative, unless "seek" is true (in which case it is absolute).
  134. Here, call the :ref:`blend_input<class_AnimationNode_blend_input>`, :ref:`blend_node<class_AnimationNode_blend_node>` or :ref:`blend_animation<class_AnimationNode_blend_animation>` functions.
  135. You can also use :ref:`get_parameter<class_AnimationNode_get_parameter>` and :ref:`set_parameter<class_AnimationNode_set_parameter>` to modify local memory.
  136. This function returns the time left for the current animation to finish (if unsure, just pass the value from the main blend being called).
  137. .. _class_AnimationNode_remove_input:
  138. - void **remove_input** **(** :ref:`int<class_int>` index **)**
  139. Remove an input, call this only when inactive.
  140. .. _class_AnimationNode_set_filter_path:
  141. - void **set_filter_path** **(** :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)**
  142. Add/Remove a path for the filter.
  143. .. _class_AnimationNode_set_parameter:
  144. - void **set_parameter** **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)**
  145. Set a custom parameter. These are used as local storage, because resources can be reused across the tree or scenes.