class_animationnodeblendspace2d.rst 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the AnimationNodeBlendSpace2D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_AnimationNodeBlendSpace2D:
  6. AnimationNodeBlendSpace2D
  7. =========================
  8. **Inherits:** :ref:`AnimationRootNode<class_AnimationRootNode>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Blends linearly between three :ref:`AnimationNode<class_AnimationNode>` of any type placed in a 2d space.
  13. Properties
  14. ----------
  15. +------------------------------------------------------------+--------------------------------------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`auto_triangles<class_AnimationNodeBlendSpace2D_property_auto_triangles>` |
  17. +------------------------------------------------------------+--------------------------------------------------------------------------------+
  18. | :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` | :ref:`blend_mode<class_AnimationNodeBlendSpace2D_property_blend_mode>` |
  19. +------------------------------------------------------------+--------------------------------------------------------------------------------+
  20. | :ref:`Vector2<class_Vector2>` | :ref:`max_space<class_AnimationNodeBlendSpace2D_property_max_space>` |
  21. +------------------------------------------------------------+--------------------------------------------------------------------------------+
  22. | :ref:`Vector2<class_Vector2>` | :ref:`min_space<class_AnimationNodeBlendSpace2D_property_min_space>` |
  23. +------------------------------------------------------------+--------------------------------------------------------------------------------+
  24. | :ref:`Vector2<class_Vector2>` | :ref:`snap<class_AnimationNodeBlendSpace2D_property_snap>` |
  25. +------------------------------------------------------------+--------------------------------------------------------------------------------+
  26. | :ref:`String<class_String>` | :ref:`x_label<class_AnimationNodeBlendSpace2D_property_x_label>` |
  27. +------------------------------------------------------------+--------------------------------------------------------------------------------+
  28. | :ref:`String<class_String>` | :ref:`y_label<class_AnimationNodeBlendSpace2D_property_y_label>` |
  29. +------------------------------------------------------------+--------------------------------------------------------------------------------+
  30. Methods
  31. -------
  32. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>` **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` at_index=-1 **)** |
  34. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`add_triangle<class_AnimationNodeBlendSpace2D_method_add_triangle>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z, :ref:`int<class_int>` at_index=-1 **)** |
  36. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`int<class_int>` | :ref:`get_blend_point_count<class_AnimationNodeBlendSpace2D_method_get_blend_point_count>` **(** **)** const |
  38. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`AnimationRootNode<class_AnimationRootNode>` | :ref:`get_blend_point_node<class_AnimationNodeBlendSpace2D_method_get_blend_point_node>` **(** :ref:`int<class_int>` point **)** const |
  40. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Vector2<class_Vector2>` | :ref:`get_blend_point_position<class_AnimationNodeBlendSpace2D_method_get_blend_point_position>` **(** :ref:`int<class_int>` point **)** const |
  42. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`int<class_int>` | :ref:`get_triangle_count<class_AnimationNodeBlendSpace2D_method_get_triangle_count>` **(** **)** const |
  44. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`int<class_int>` | :ref:`get_triangle_point<class_AnimationNodeBlendSpace2D_method_get_triangle_point>` **(** :ref:`int<class_int>` triangle, :ref:`int<class_int>` point **)** |
  46. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`remove_blend_point<class_AnimationNodeBlendSpace2D_method_remove_blend_point>` **(** :ref:`int<class_int>` point **)** |
  48. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`remove_triangle<class_AnimationNodeBlendSpace2D_method_remove_triangle>` **(** :ref:`int<class_int>` triangle **)** |
  50. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`set_blend_point_node<class_AnimationNodeBlendSpace2D_method_set_blend_point_node>` **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)** |
  52. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`set_blend_point_position<class_AnimationNodeBlendSpace2D_method_set_blend_point_position>` **(** :ref:`int<class_int>` point, :ref:`Vector2<class_Vector2>` pos **)** |
  54. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. Signals
  56. -------
  57. .. _class_AnimationNodeBlendSpace2D_signal_triangles_updated:
  58. - **triangles_updated** **(** **)**
  59. Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position.
  60. Enumerations
  61. ------------
  62. .. _enum_AnimationNodeBlendSpace2D_BlendMode:
  63. .. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_INTERPOLATED:
  64. .. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE:
  65. .. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE_CARRY:
  66. enum **BlendMode**:
  67. - **BLEND_MODE_INTERPOLATED** = **0** --- The interpolation between animations is linear.
  68. - **BLEND_MODE_DISCRETE** = **1** --- The blend space plays the animation of the node the blending position is closest to. Useful for frame-by-frame 2D animations.
  69. - **BLEND_MODE_DISCRETE_CARRY** = **2** --- Similar to :ref:`BLEND_MODE_DISCRETE<class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE>`, but starts the new animation at the last animation's playback position.
  70. Description
  71. -----------
  72. A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
  73. This node allows you to blend linearly between three animations using a :ref:`Vector2<class_Vector2>` weight.
  74. You can add vertices to the blend space with :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>` and automatically triangulate it by setting :ref:`auto_triangles<class_AnimationNodeBlendSpace2D_property_auto_triangles>` to ``true``. Otherwise, use :ref:`add_triangle<class_AnimationNodeBlendSpace2D_method_add_triangle>` and :ref:`remove_triangle<class_AnimationNodeBlendSpace2D_method_remove_triangle>` to create up the blend space by hand.
  75. Property Descriptions
  76. ---------------------
  77. .. _class_AnimationNodeBlendSpace2D_property_auto_triangles:
  78. - :ref:`bool<class_bool>` **auto_triangles**
  79. +----------+---------------------------+
  80. | *Setter* | set_auto_triangles(value) |
  81. +----------+---------------------------+
  82. | *Getter* | get_auto_triangles() |
  83. +----------+---------------------------+
  84. If true, the blend space is triangulated automatically. The mesh updates every time you add or remove points with :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>` and :ref:`remove_blend_point<class_AnimationNodeBlendSpace2D_method_remove_blend_point>`.
  85. ----
  86. .. _class_AnimationNodeBlendSpace2D_property_blend_mode:
  87. - :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` **blend_mode**
  88. +----------+-----------------------+
  89. | *Setter* | set_blend_mode(value) |
  90. +----------+-----------------------+
  91. | *Getter* | get_blend_mode() |
  92. +----------+-----------------------+
  93. Controls the interpolation between animations. See :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` constants.
  94. ----
  95. .. _class_AnimationNodeBlendSpace2D_property_max_space:
  96. - :ref:`Vector2<class_Vector2>` **max_space**
  97. +----------+----------------------+
  98. | *Setter* | set_max_space(value) |
  99. +----------+----------------------+
  100. | *Getter* | get_max_space() |
  101. +----------+----------------------+
  102. The blend space's X and Y axes' upper limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>`.
  103. ----
  104. .. _class_AnimationNodeBlendSpace2D_property_min_space:
  105. - :ref:`Vector2<class_Vector2>` **min_space**
  106. +----------+----------------------+
  107. | *Setter* | set_min_space(value) |
  108. +----------+----------------------+
  109. | *Getter* | get_min_space() |
  110. +----------+----------------------+
  111. The blend space's X and Y axes' lower limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>`.
  112. ----
  113. .. _class_AnimationNodeBlendSpace2D_property_snap:
  114. - :ref:`Vector2<class_Vector2>` **snap**
  115. +----------+-----------------+
  116. | *Setter* | set_snap(value) |
  117. +----------+-----------------+
  118. | *Getter* | get_snap() |
  119. +----------+-----------------+
  120. Position increment to snap to when moving a point.
  121. ----
  122. .. _class_AnimationNodeBlendSpace2D_property_x_label:
  123. - :ref:`String<class_String>` **x_label**
  124. +----------+--------------------+
  125. | *Setter* | set_x_label(value) |
  126. +----------+--------------------+
  127. | *Getter* | get_x_label() |
  128. +----------+--------------------+
  129. Name of the blend space's X axis.
  130. ----
  131. .. _class_AnimationNodeBlendSpace2D_property_y_label:
  132. - :ref:`String<class_String>` **y_label**
  133. +----------+--------------------+
  134. | *Setter* | set_y_label(value) |
  135. +----------+--------------------+
  136. | *Getter* | get_y_label() |
  137. +----------+--------------------+
  138. Name of the blend space's Y axis.
  139. Method Descriptions
  140. -------------------
  141. .. _class_AnimationNodeBlendSpace2D_method_add_blend_point:
  142. - void **add_blend_point** **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` at_index=-1 **)**
  143. Add a new point that represents a ``node`` at the 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.
  144. ----
  145. .. _class_AnimationNodeBlendSpace2D_method_add_triangle:
  146. - void **add_triangle** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z, :ref:`int<class_int>` at_index=-1 **)**
  147. Creates a new triangle using three points ``x``, ``y``, and ``z``. Triangles can overlap. You can insert the triangle 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.
  148. ----
  149. .. _class_AnimationNodeBlendSpace2D_method_get_blend_point_count:
  150. - :ref:`int<class_int>` **get_blend_point_count** **(** **)** const
  151. Returns the number of points in the blend space.
  152. ----
  153. .. _class_AnimationNodeBlendSpace2D_method_get_blend_point_node:
  154. - :ref:`AnimationRootNode<class_AnimationRootNode>` **get_blend_point_node** **(** :ref:`int<class_int>` point **)** const
  155. Returns the ``AnimationRootNode`` referenced by the point at index ``point``.
  156. ----
  157. .. _class_AnimationNodeBlendSpace2D_method_get_blend_point_position:
  158. - :ref:`Vector2<class_Vector2>` **get_blend_point_position** **(** :ref:`int<class_int>` point **)** const
  159. Returns the position of the point at index ``point``.
  160. ----
  161. .. _class_AnimationNodeBlendSpace2D_method_get_triangle_count:
  162. - :ref:`int<class_int>` **get_triangle_count** **(** **)** const
  163. Returns the number of triangles in the blend space.
  164. ----
  165. .. _class_AnimationNodeBlendSpace2D_method_get_triangle_point:
  166. - :ref:`int<class_int>` **get_triangle_point** **(** :ref:`int<class_int>` triangle, :ref:`int<class_int>` point **)**
  167. Returns the position of the point at index ``point`` in the triangle of index ``triangle``.
  168. ----
  169. .. _class_AnimationNodeBlendSpace2D_method_remove_blend_point:
  170. - void **remove_blend_point** **(** :ref:`int<class_int>` point **)**
  171. Removes the point at index ``point`` from the blend space.
  172. ----
  173. .. _class_AnimationNodeBlendSpace2D_method_remove_triangle:
  174. - void **remove_triangle** **(** :ref:`int<class_int>` triangle **)**
  175. Removes the triangle at index ``triangle`` from the blend space.
  176. ----
  177. .. _class_AnimationNodeBlendSpace2D_method_set_blend_point_node:
  178. - void **set_blend_point_node** **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)**
  179. Changes the AnimationNode referenced by the point at index ``point``.
  180. ----
  181. .. _class_AnimationNodeBlendSpace2D_method_set_blend_point_position:
  182. - void **set_blend_point_position** **(** :ref:`int<class_int>` point, :ref:`Vector2<class_Vector2>` pos **)**
  183. Updates the position of the point at index ``point`` on the blend axis.