class_animationnodeblendspace1d.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeBlendSpace1D.xml.
  6. .. _class_AnimationNodeBlendSpace1D:
  7. AnimationNodeBlendSpace1D
  8. =========================
  9. **Inherits:** :ref:`AnimationRootNode<class_AnimationRootNode>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Blends linearly between two of any number of :ref:`AnimationNode<class_AnimationNode>` of any type placed on a virtual axis.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
  15. This is a virtual axis on which you can add any type of :ref:`AnimationNode<class_AnimationNode>` using :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>`.
  16. Outputs the linear blend of the two :ref:`AnimationNode<class_AnimationNode>`\ s closest to the node's current value.
  17. You can set the extents of the axis using the :ref:`min_space<class_AnimationNodeBlendSpace1D_property_min_space>` and :ref:`max_space<class_AnimationNodeBlendSpace1D_property_max_space>`.
  18. .. rst-class:: classref-introduction-group
  19. Tutorials
  20. ---------
  21. - :doc:`AnimationTree <../tutorials/animation/animation_tree>`
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +------------------------------------------------------------+--------------------------------------------------------------------------+-------------+
  28. | :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` | :ref:`blend_mode<class_AnimationNodeBlendSpace1D_property_blend_mode>` | ``0`` |
  29. +------------------------------------------------------------+--------------------------------------------------------------------------+-------------+
  30. | :ref:`float<class_float>` | :ref:`max_space<class_AnimationNodeBlendSpace1D_property_max_space>` | ``1.0`` |
  31. +------------------------------------------------------------+--------------------------------------------------------------------------+-------------+
  32. | :ref:`float<class_float>` | :ref:`min_space<class_AnimationNodeBlendSpace1D_property_min_space>` | ``-1.0`` |
  33. +------------------------------------------------------------+--------------------------------------------------------------------------+-------------+
  34. | :ref:`float<class_float>` | :ref:`snap<class_AnimationNodeBlendSpace1D_property_snap>` | ``0.1`` |
  35. +------------------------------------------------------------+--------------------------------------------------------------------------+-------------+
  36. | :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlendSpace1D_property_sync>` | ``false`` |
  37. +------------------------------------------------------------+--------------------------------------------------------------------------+-------------+
  38. | :ref:`String<class_String>` | :ref:`value_label<class_AnimationNodeBlendSpace1D_property_value_label>` | ``"value"`` |
  39. +------------------------------------------------------------+--------------------------------------------------------------------------+-------------+
  40. .. rst-class:: classref-reftable-group
  41. Methods
  42. -------
  43. .. table::
  44. :widths: auto
  45. +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>` **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`float<class_float>` pos, :ref:`int<class_int>` at_index=-1 **)** |
  47. +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`int<class_int>` | :ref:`get_blend_point_count<class_AnimationNodeBlendSpace1D_method_get_blend_point_count>` **(** **)** |const| |
  49. +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`AnimationRootNode<class_AnimationRootNode>` | :ref:`get_blend_point_node<class_AnimationNodeBlendSpace1D_method_get_blend_point_node>` **(** :ref:`int<class_int>` point **)** |const| |
  51. +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`float<class_float>` | :ref:`get_blend_point_position<class_AnimationNodeBlendSpace1D_method_get_blend_point_position>` **(** :ref:`int<class_int>` point **)** |const| |
  53. +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`remove_blend_point<class_AnimationNodeBlendSpace1D_method_remove_blend_point>` **(** :ref:`int<class_int>` point **)** |
  55. +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`set_blend_point_node<class_AnimationNodeBlendSpace1D_method_set_blend_point_node>` **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)** |
  57. +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`set_blend_point_position<class_AnimationNodeBlendSpace1D_method_set_blend_point_position>` **(** :ref:`int<class_int>` point, :ref:`float<class_float>` pos **)** |
  59. +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. .. rst-class:: classref-section-separator
  61. ----
  62. .. rst-class:: classref-descriptions-group
  63. Enumerations
  64. ------------
  65. .. _enum_AnimationNodeBlendSpace1D_BlendMode:
  66. .. rst-class:: classref-enumeration
  67. enum **BlendMode**:
  68. .. _class_AnimationNodeBlendSpace1D_constant_BLEND_MODE_INTERPOLATED:
  69. .. rst-class:: classref-enumeration-constant
  70. :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **BLEND_MODE_INTERPOLATED** = ``0``
  71. The interpolation between animations is linear.
  72. .. _class_AnimationNodeBlendSpace1D_constant_BLEND_MODE_DISCRETE:
  73. .. rst-class:: classref-enumeration-constant
  74. :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **BLEND_MODE_DISCRETE** = ``1``
  75. The blend space plays the animation of the node the blending position is closest to. Useful for frame-by-frame 2D animations.
  76. .. _class_AnimationNodeBlendSpace1D_constant_BLEND_MODE_DISCRETE_CARRY:
  77. .. rst-class:: classref-enumeration-constant
  78. :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **BLEND_MODE_DISCRETE_CARRY** = ``2``
  79. Similar to :ref:`BLEND_MODE_DISCRETE<class_AnimationNodeBlendSpace1D_constant_BLEND_MODE_DISCRETE>`, but starts the new animation at the last animation's playback position.
  80. .. rst-class:: classref-section-separator
  81. ----
  82. .. rst-class:: classref-descriptions-group
  83. Property Descriptions
  84. ---------------------
  85. .. _class_AnimationNodeBlendSpace1D_property_blend_mode:
  86. .. rst-class:: classref-property
  87. :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **blend_mode** = ``0``
  88. .. rst-class:: classref-property-setget
  89. - void **set_blend_mode** **(** :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` value **)**
  90. - :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **get_blend_mode** **(** **)**
  91. Controls the interpolation between animations. See :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` constants.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_AnimationNodeBlendSpace1D_property_max_space:
  95. .. rst-class:: classref-property
  96. :ref:`float<class_float>` **max_space** = ``1.0``
  97. .. rst-class:: classref-property-setget
  98. - void **set_max_space** **(** :ref:`float<class_float>` value **)**
  99. - :ref:`float<class_float>` **get_max_space** **(** **)**
  100. The blend space's axis's upper limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>`.
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_AnimationNodeBlendSpace1D_property_min_space:
  104. .. rst-class:: classref-property
  105. :ref:`float<class_float>` **min_space** = ``-1.0``
  106. .. rst-class:: classref-property-setget
  107. - void **set_min_space** **(** :ref:`float<class_float>` value **)**
  108. - :ref:`float<class_float>` **get_min_space** **(** **)**
  109. The blend space's axis's lower limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>`.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _class_AnimationNodeBlendSpace1D_property_snap:
  113. .. rst-class:: classref-property
  114. :ref:`float<class_float>` **snap** = ``0.1``
  115. .. rst-class:: classref-property-setget
  116. - void **set_snap** **(** :ref:`float<class_float>` value **)**
  117. - :ref:`float<class_float>` **get_snap** **(** **)**
  118. Position increment to snap to when moving a point on the axis.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_AnimationNodeBlendSpace1D_property_sync:
  122. .. rst-class:: classref-property
  123. :ref:`bool<class_bool>` **sync** = ``false``
  124. .. rst-class:: classref-property-setget
  125. - void **set_use_sync** **(** :ref:`bool<class_bool>` value **)**
  126. - :ref:`bool<class_bool>` **is_using_sync** **(** **)**
  127. If ``false``, the blended animations' frame are stopped when the blend value is ``0``.
  128. If ``true``, forcing the blended animations to advance frame.
  129. .. rst-class:: classref-item-separator
  130. ----
  131. .. _class_AnimationNodeBlendSpace1D_property_value_label:
  132. .. rst-class:: classref-property
  133. :ref:`String<class_String>` **value_label** = ``"value"``
  134. .. rst-class:: classref-property-setget
  135. - void **set_value_label** **(** :ref:`String<class_String>` value **)**
  136. - :ref:`String<class_String>` **get_value_label** **(** **)**
  137. Label of the virtual axis of the blend space.
  138. .. rst-class:: classref-section-separator
  139. ----
  140. .. rst-class:: classref-descriptions-group
  141. Method Descriptions
  142. -------------------
  143. .. _class_AnimationNodeBlendSpace1D_method_add_blend_point:
  144. .. rst-class:: classref-method
  145. void **add_blend_point** **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`float<class_float>` pos, :ref:`int<class_int>` at_index=-1 **)**
  146. Adds a new point that represents a ``node`` on the virtual axis at a given position set by ``pos``. You can insert it at a specific index using the ``at_index`` argument. If you use the default value for ``at_index``, the point is inserted at the end of the blend points array.
  147. .. rst-class:: classref-item-separator
  148. ----
  149. .. _class_AnimationNodeBlendSpace1D_method_get_blend_point_count:
  150. .. rst-class:: classref-method
  151. :ref:`int<class_int>` **get_blend_point_count** **(** **)** |const|
  152. Returns the number of points on the blend axis.
  153. .. rst-class:: classref-item-separator
  154. ----
  155. .. _class_AnimationNodeBlendSpace1D_method_get_blend_point_node:
  156. .. rst-class:: classref-method
  157. :ref:`AnimationRootNode<class_AnimationRootNode>` **get_blend_point_node** **(** :ref:`int<class_int>` point **)** |const|
  158. Returns the :ref:`AnimationNode<class_AnimationNode>` referenced by the point at index ``point``.
  159. .. rst-class:: classref-item-separator
  160. ----
  161. .. _class_AnimationNodeBlendSpace1D_method_get_blend_point_position:
  162. .. rst-class:: classref-method
  163. :ref:`float<class_float>` **get_blend_point_position** **(** :ref:`int<class_int>` point **)** |const|
  164. Returns the position of the point at index ``point``.
  165. .. rst-class:: classref-item-separator
  166. ----
  167. .. _class_AnimationNodeBlendSpace1D_method_remove_blend_point:
  168. .. rst-class:: classref-method
  169. void **remove_blend_point** **(** :ref:`int<class_int>` point **)**
  170. Removes the point at index ``point`` from the blend axis.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_AnimationNodeBlendSpace1D_method_set_blend_point_node:
  174. .. rst-class:: classref-method
  175. void **set_blend_point_node** **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)**
  176. Changes the :ref:`AnimationNode<class_AnimationNode>` referenced by the point at index ``point``.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_AnimationNodeBlendSpace1D_method_set_blend_point_position:
  180. .. rst-class:: classref-method
  181. void **set_blend_point_position** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` pos **)**
  182. Updates the position of the point at index ``point`` on the blend axis.
  183. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  184. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  185. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  186. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  187. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  188. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`