|
@@ -14,7 +14,7 @@ AnimationNodeBlendSpace2D
|
|
|
Brief Description
|
|
|
-----------------
|
|
|
|
|
|
-
|
|
|
+Blends linearly between three :ref:`AnimationNode<class_AnimationNode>` of any type placed in a 2d space.
|
|
|
|
|
|
Properties
|
|
|
----------
|
|
@@ -69,6 +69,8 @@ Signals
|
|
|
|
|
|
- **triangles_updated** **(** **)**
|
|
|
|
|
|
+Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position.
|
|
|
+
|
|
|
Enumerations
|
|
|
------------
|
|
|
|
|
@@ -82,11 +84,20 @@ Enumerations
|
|
|
|
|
|
enum **BlendMode**:
|
|
|
|
|
|
-- **BLEND_MODE_INTERPOLATED** = **0**
|
|
|
+- **BLEND_MODE_INTERPOLATED** = **0** --- The interpolation between animations is linear.
|
|
|
+
|
|
|
+- **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.
|
|
|
+
|
|
|
+- **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.
|
|
|
+
|
|
|
+Description
|
|
|
+-----------
|
|
|
+
|
|
|
+A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
|
|
|
|
|
|
-- **BLEND_MODE_DISCRETE** = **1** --- Useful for frame-by-frame 2D animations.
|
|
|
+This node allows you to blend linearly between three animations using a :ref:`Vector2<class_Vector2>` weight.
|
|
|
|
|
|
-- **BLEND_MODE_DISCRETE_CARRY** = **2** --- Keep the current play position when switching between discrete animations.
|
|
|
+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.
|
|
|
|
|
|
Property Descriptions
|
|
|
---------------------
|
|
@@ -101,6 +112,8 @@ Property Descriptions
|
|
|
| *Getter* | get_auto_triangles() |
|
|
|
+----------+---------------------------+
|
|
|
|
|
|
+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>`.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_property_blend_mode:
|
|
|
|
|
|
- :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` **blend_mode**
|
|
@@ -111,6 +124,8 @@ Property Descriptions
|
|
|
| *Getter* | get_blend_mode() |
|
|
|
+----------+-----------------------+
|
|
|
|
|
|
+Controls the interpolation between animations. See :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` constants.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_property_max_space:
|
|
|
|
|
|
- :ref:`Vector2<class_Vector2>` **max_space**
|
|
@@ -121,6 +136,8 @@ Property Descriptions
|
|
|
| *Getter* | get_max_space() |
|
|
|
+----------+----------------------+
|
|
|
|
|
|
+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>`.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_property_min_space:
|
|
|
|
|
|
- :ref:`Vector2<class_Vector2>` **min_space**
|
|
@@ -131,6 +148,8 @@ Property Descriptions
|
|
|
| *Getter* | get_min_space() |
|
|
|
+----------+----------------------+
|
|
|
|
|
|
+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>`.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_property_snap:
|
|
|
|
|
|
- :ref:`Vector2<class_Vector2>` **snap**
|
|
@@ -141,6 +160,8 @@ Property Descriptions
|
|
|
| *Getter* | get_snap() |
|
|
|
+----------+-----------------+
|
|
|
|
|
|
+Position increment to snap to when moving a point.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_property_x_label:
|
|
|
|
|
|
- :ref:`String<class_String>` **x_label**
|
|
@@ -151,6 +172,8 @@ Property Descriptions
|
|
|
| *Getter* | get_x_label() |
|
|
|
+----------+--------------------+
|
|
|
|
|
|
+Name of the blend space's X axis.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_property_y_label:
|
|
|
|
|
|
- :ref:`String<class_String>` **y_label**
|
|
@@ -161,6 +184,8 @@ Property Descriptions
|
|
|
| *Getter* | get_y_label() |
|
|
|
+----------+--------------------+
|
|
|
|
|
|
+Name of the blend space's Y axis.
|
|
|
+
|
|
|
Method Descriptions
|
|
|
-------------------
|
|
|
|
|
@@ -168,43 +193,65 @@ Method Descriptions
|
|
|
|
|
|
- void **add_blend_point** **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` at_index=-1 **)**
|
|
|
|
|
|
+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.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_method_add_triangle:
|
|
|
|
|
|
- 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 **)**
|
|
|
|
|
|
+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.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_count:
|
|
|
|
|
|
- :ref:`int<class_int>` **get_blend_point_count** **(** **)** const
|
|
|
|
|
|
+Returns the number of points in the blend space.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_node:
|
|
|
|
|
|
- :ref:`AnimationRootNode<class_AnimationRootNode>` **get_blend_point_node** **(** :ref:`int<class_int>` point **)** const
|
|
|
|
|
|
+Returns the ``AnimationRootNode`` referenced by the point at index ``point``.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_position:
|
|
|
|
|
|
- :ref:`Vector2<class_Vector2>` **get_blend_point_position** **(** :ref:`int<class_int>` point **)** const
|
|
|
|
|
|
+Returns the position of the point at index ``point``.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_method_get_triangle_count:
|
|
|
|
|
|
- :ref:`int<class_int>` **get_triangle_count** **(** **)** const
|
|
|
|
|
|
+Returns the number of triangles in the blend space.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_method_get_triangle_point:
|
|
|
|
|
|
- :ref:`int<class_int>` **get_triangle_point** **(** :ref:`int<class_int>` triangle, :ref:`int<class_int>` point **)**
|
|
|
|
|
|
+Returns the position of the point at index ``point`` in the triangle of index ``triangle``.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_method_remove_blend_point:
|
|
|
|
|
|
- void **remove_blend_point** **(** :ref:`int<class_int>` point **)**
|
|
|
|
|
|
+Removes the point at index ``point`` from the blend space.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_method_remove_triangle:
|
|
|
|
|
|
- void **remove_triangle** **(** :ref:`int<class_int>` triangle **)**
|
|
|
|
|
|
+Removes the triangle at index ``triangle`` from the blend space.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_method_set_blend_point_node:
|
|
|
|
|
|
- void **set_blend_point_node** **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)**
|
|
|
|
|
|
+Changes the AnimationNode referenced by the point at index ``point``.
|
|
|
+
|
|
|
.. _class_AnimationNodeBlendSpace2D_method_set_blend_point_position:
|
|
|
|
|
|
- void **set_blend_point_position** **(** :ref:`int<class_int>` point, :ref:`Vector2<class_Vector2>` pos **)**
|
|
|
|
|
|
+Updates the position of the point at index ``point`` on the blend axis.
|
|
|
+
|