2018-07-26 11:56:21 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 10:08:05 +02:00
<class name= "AnimationNodeBlendSpace2D" inherits= "AnimationRootNode" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2018-07-26 11:56:21 +02:00
<brief_description >
2023-04-28 17:16:44 +02:00
A set of [AnimationRootNode]s placed on 2D coordinates, crossfading between the three adjacent ones. Used by [AnimationTree].
2018-07-26 11:56:21 +02:00
</brief_description>
<description >
2023-04-28 17:16:44 +02:00
A resource used by [AnimationNodeBlendTree].
[AnimationNodeBlendSpace1D] represents a virtual 2D space on which [AnimationRootNode]s are placed. Outputs the linear blend of the three adjacent animations using a [Vector2] weight. Adjacent in this context means the three [AnimationRootNode]s making up the triangle that contains the current value.
You can add vertices to the blend space with [method add_blend_point] and automatically triangulate it by setting [member auto_triangles] to [code]true[/code]. Otherwise, use [method add_triangle] and [method remove_triangle] to triangulate the blend space by hand.
2018-07-26 11:56:21 +02:00
</description>
<tutorials >
2023-04-28 17:16:44 +02:00
<link title= "Using AnimationTree" > $DOCS_URL/tutorials/animation/animation_tree.html</link>
2024-03-25 02:20:59 +01:00
<link title= "Third Person Shooter (TPS) Demo" > https://godotengine.org/asset-library/asset/2710</link>
2018-07-26 11:56:21 +02:00
</tutorials>
<methods >
<method name= "add_blend_point" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "node" type= "AnimationRootNode" />
<param index= "1" name= "pos" type= "Vector2" />
<param index= "2" name= "at_index" type= "int" default= "-1" />
2018-07-26 11:56:21 +02:00
<description >
2022-08-12 19:51:01 +02:00
Adds a new point that represents a [param node] at the position set by [param pos]. You can insert it at a specific index using the [param at_index] argument. If you use the default value for [param at_index], the point is inserted at the end of the blend points array.
2018-07-26 11:56:21 +02:00
</description>
</method>
<method name= "add_triangle" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "x" type= "int" />
<param index= "1" name= "y" type= "int" />
<param index= "2" name= "z" type= "int" />
<param index= "3" name= "at_index" type= "int" default= "-1" />
2018-07-26 11:56:21 +02:00
<description >
2022-08-12 19:51:01 +02:00
Creates a new triangle using three points [param x], [param y], and [param z]. Triangles can overlap. You can insert the triangle at a specific index using the [param at_index] argument. If you use the default value for [param at_index], the point is inserted at the end of the blend points array.
2018-07-26 11:56:21 +02:00
</description>
</method>
<method name= "get_blend_point_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2018-07-26 11:56:21 +02:00
<description >
2019-06-04 02:01:24 +02:00
Returns the number of points in the blend space.
2018-07-26 11:56:21 +02:00
</description>
</method>
<method name= "get_blend_point_node" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "AnimationRootNode" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "point" type= "int" />
2018-07-26 11:56:21 +02:00
<description >
2022-08-12 19:51:01 +02:00
Returns the [AnimationRootNode] referenced by the point at index [param point].
2018-07-26 11:56:21 +02:00
</description>
</method>
<method name= "get_blend_point_position" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "point" type= "int" />
2018-07-26 11:56:21 +02:00
<description >
2022-08-12 19:51:01 +02:00
Returns the position of the point at index [param point].
2018-07-26 11:56:21 +02:00
</description>
</method>
<method name= "get_triangle_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2018-07-26 11:56:21 +02:00
<description >
2019-06-04 02:01:24 +02:00
Returns the number of triangles in the blend space.
2018-07-26 11:56:21 +02:00
</description>
</method>
<method name= "get_triangle_point" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "triangle" type= "int" />
<param index= "1" name= "point" type= "int" />
2018-07-26 11:56:21 +02:00
<description >
2022-08-12 19:51:01 +02:00
Returns the position of the point at index [param point] in the triangle of index [param triangle].
2018-07-26 11:56:21 +02:00
</description>
</method>
<method name= "remove_blend_point" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "point" type= "int" />
2018-07-26 11:56:21 +02:00
<description >
2022-08-12 19:51:01 +02:00
Removes the point at index [param point] from the blend space.
2018-07-26 11:56:21 +02:00
</description>
</method>
<method name= "remove_triangle" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "triangle" type= "int" />
2018-07-26 11:56:21 +02:00
<description >
2022-08-12 19:51:01 +02:00
Removes the triangle at index [param triangle] from the blend space.
2018-07-26 11:56:21 +02:00
</description>
</method>
<method name= "set_blend_point_node" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "point" type= "int" />
<param index= "1" name= "node" type= "AnimationRootNode" />
2018-07-26 11:56:21 +02:00
<description >
2022-08-12 19:51:01 +02:00
Changes the [AnimationNode] referenced by the point at index [param point].
2018-07-26 11:56:21 +02:00
</description>
</method>
<method name= "set_blend_point_position" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "point" type= "int" />
<param index= "1" name= "pos" type= "Vector2" />
2018-07-26 11:56:21 +02:00
<description >
2022-08-12 19:51:01 +02:00
Updates the position of the point at index [param point] on the blend axis.
2018-07-26 11:56:21 +02:00
</description>
</method>
</methods>
<members >
2019-06-29 12:38:01 +02:00
<member name= "auto_triangles" type= "bool" setter= "set_auto_triangles" getter= "get_auto_triangles" default= "true" >
2019-11-02 12:14:15 +01:00
If [code]true[/code], the blend space is triangulated automatically. The mesh updates every time you add or remove points with [method add_blend_point] and [method remove_blend_point].
2018-07-26 11:56:21 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "blend_mode" type= "int" setter= "set_blend_mode" getter= "get_blend_mode" enum= "AnimationNodeBlendSpace2D.BlendMode" default= "0" >
2019-06-04 02:01:24 +02:00
Controls the interpolation between animations. See [enum BlendMode] constants.
2018-11-23 01:06:24 +01:00
</member>
2019-09-24 19:45:03 +02:00
<member name= "max_space" type= "Vector2" setter= "set_max_space" getter= "get_max_space" default= "Vector2(1, 1)" >
2019-06-04 02:01:24 +02:00
The blend space's X and Y axes' upper limit for the points' position. See [method add_blend_point].
2018-07-26 11:56:21 +02:00
</member>
2019-09-24 19:45:03 +02:00
<member name= "min_space" type= "Vector2" setter= "set_min_space" getter= "get_min_space" default= "Vector2(-1, -1)" >
2019-06-04 02:01:24 +02:00
The blend space's X and Y axes' lower limit for the points' position. See [method add_blend_point].
2018-07-26 11:56:21 +02:00
</member>
2019-09-24 19:45:03 +02:00
<member name= "snap" type= "Vector2" setter= "set_snap" getter= "get_snap" default= "Vector2(0.1, 0.1)" >
2019-06-04 02:01:24 +02:00
Position increment to snap to when moving a point.
2018-07-26 11:56:21 +02:00
</member>
2022-06-29 08:35:29 +02:00
<member name= "sync" type= "bool" setter= "set_use_sync" getter= "is_using_sync" default= "false" >
If [code]false[/code], the blended animations' frame are stopped when the blend value is [code]0[/code].
If [code]true[/code], forcing the blended animations to advance frame.
</member>
2019-06-29 12:38:01 +02:00
<member name= "x_label" type= "String" setter= "set_x_label" getter= "get_x_label" default= ""x"" >
2019-06-04 02:01:24 +02:00
Name of the blend space's X axis.
2018-07-26 11:56:21 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "y_label" type= "String" setter= "set_y_label" getter= "get_y_label" default= ""y"" >
2019-06-04 02:01:24 +02:00
Name of the blend space's Y axis.
2018-07-26 11:56:21 +02:00
</member>
</members>
2019-01-15 13:26:47 +01:00
<signals >
<signal name= "triangles_updated" >
<description >
2019-06-04 02:01:24 +02:00
Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position.
2019-01-15 13:26:47 +01:00
</description>
</signal>
</signals>
2018-07-26 11:56:21 +02:00
<constants >
2018-11-23 01:06:24 +01:00
<constant name= "BLEND_MODE_INTERPOLATED" value= "0" enum= "BlendMode" >
2019-06-04 02:01:24 +02:00
The interpolation between animations is linear.
2018-11-23 01:06:24 +01:00
</constant>
<constant name= "BLEND_MODE_DISCRETE" value= "1" enum= "BlendMode" >
2023-04-30 16:32:18 +02:00
The blend space plays the animation of the animation node which blending position is closest to. Useful for frame-by-frame 2D animations.
2018-11-23 01:06:24 +01:00
</constant>
<constant name= "BLEND_MODE_DISCRETE_CARRY" value= "2" enum= "BlendMode" >
2019-06-16 11:22:38 +02:00
Similar to [constant BLEND_MODE_DISCRETE], but starts the new animation at the last animation's playback position.
2018-11-23 01:06:24 +01:00
</constant>
2018-07-26 11:56:21 +02:00
</constants>
</class>