-
-
Notifications
You must be signed in to change notification settings - Fork 26.4k
Expand file tree
/
Copy pathAnimationNodeBlendSpace2D.xml
More file actions
184 lines (184 loc) · 8.87 KB
/
Copy pathAnimationNodeBlendSpace2D.xml
File metadata and controls
184 lines (184 loc) · 8.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeBlendSpace2D" inherits="AnimationRootNode" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A set of [AnimationRootNode]s placed on 2D coordinates, crossfading between the three adjacent ones. Used by [AnimationTree].
</brief_description>
<description>
A resource used by [AnimationNodeBlendTree].
[AnimationNodeBlendSpace2D] 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.
</description>
<tutorials>
<link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link>
<link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link>
</tutorials>
<methods>
<method name="add_blend_point">
<return type="void" />
<param index="0" name="node" type="AnimationRootNode" />
<param index="1" name="pos" type="Vector2" />
<param index="2" name="at_index" type="int" default="-1" />
<description>
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.
</description>
</method>
<method name="add_triangle">
<return type="void" />
<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" />
<description>
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.
</description>
</method>
<method name="get_blend_point_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of points in the blend space.
</description>
</method>
<method name="get_blend_point_node" qualifiers="const">
<return type="AnimationRootNode" />
<param index="0" name="point" type="int" />
<description>
Returns the [AnimationRootNode] referenced by the point at index [param point].
</description>
</method>
<method name="get_blend_point_ovl" qualifiers="const">
<return type="bool" />
<param index="0" name="point" type="int" />
<description>
Returns the velocity limit override of the point at index [param point].
</description>
</method>
<method name="get_blend_point_position" qualifiers="const">
<return type="Vector2" />
<param index="0" name="point" type="int" />
<description>
Returns the position of the point at index [param point].
</description>
</method>
<method name="get_blend_point_vl" qualifiers="const">
<return type="float" />
<param index="0" name="point" type="int" />
<description>
Returns the velocity limit of the point at index [param point].
</description>
</method>
<method name="get_triangle_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of triangles in the blend space.
</description>
</method>
<method name="get_triangle_point">
<return type="int" />
<param index="0" name="triangle" type="int" />
<param index="1" name="point" type="int" />
<description>
Returns the position of the point at index [param point] in the triangle of index [param triangle].
</description>
</method>
<method name="remove_blend_point">
<return type="void" />
<param index="0" name="point" type="int" />
<description>
Removes the point at index [param point] from the blend space.
</description>
</method>
<method name="remove_triangle">
<return type="void" />
<param index="0" name="triangle" type="int" />
<description>
Removes the triangle at index [param triangle] from the blend space.
</description>
</method>
<method name="set_blend_point_node">
<return type="void" />
<param index="0" name="point" type="int" />
<param index="1" name="node" type="AnimationRootNode" />
<description>
Changes the [AnimationNode] referenced by the point at index [param point].
</description>
</method>
<method name="set_blend_point_ovl">
<return type="void" />
<param index="0" name="point" type="int" />
<param index="1" name="override_velocity_limit" type="bool" />
<description>
Updates the velocity limit override of the point at index [param point] in the blend space.
</description>
</method>
<method name="set_blend_point_position">
<return type="void" />
<param index="0" name="point" type="int" />
<param index="1" name="pos" type="Vector2" />
<description>
Updates the position of the point at index [param point] in the blend space.
</description>
</method>
<method name="set_blend_point_vl">
<return type="void" />
<param index="0" name="point" type="int" />
<param index="1" name="velocity_limit" type="float" />
<description>
Updates the velocity limit of the point at index [param point] in the blend space.
</description>
</method>
</methods>
<members>
<member name="auto_triangles" type="bool" setter="set_auto_triangles" getter="get_auto_triangles" default="true">
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].
</member>
<member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="AnimationNodeBlendSpace2D.BlendMode" default="0">
Controls the interpolation between animations.
</member>
<member name="max_space" type="Vector2" setter="set_max_space" getter="get_max_space" default="Vector2(1, 1)">
The blend space's X and Y axes' upper limit for the points' position. See [method add_blend_point].
</member>
<member name="min_space" type="Vector2" setter="set_min_space" getter="get_min_space" default="Vector2(-1, -1)">
The blend space's X and Y axes' lower limit for the points' position. See [method add_blend_point].
</member>
<member name="snap" type="Vector2" setter="set_snap" getter="get_snap" default="Vector2(0.1, 0.1)">
Position increment to snap to when moving a point.
</member>
<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>
<member name="use_velocity_limit" type="bool" setter="set_use_velocity_limit" getter="get_use_velocity_limit" default="false">
If [code]true[/code], while [member sync] is [code]true[/code] a blend point's weight is applied over time using [member velocity_limit] with [member velocity_limit_ease].
</member>
<member name="velocity_limit" type="float" setter="set_velocity_limit" getter="get_velocity_limit" default="0.0">
Controls the blend point velocity limit speed.
</member>
<member name="velocity_limit_ease" type="float" setter="set_velocity_limit_ease" getter="get_velocity_limit_ease" default="1.0">
Controls the easing of the velocity limit speed.
</member>
<member name="x_label" type="String" setter="set_x_label" getter="get_x_label" default=""x"">
Name of the blend space's X axis.
</member>
<member name="y_label" type="String" setter="set_y_label" getter="get_y_label" default=""y"">
Name of the blend space's Y axis.
</member>
</members>
<signals>
<signal name="triangles_updated">
<description>
Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position.
</description>
</signal>
</signals>
<constants>
<constant name="BLEND_MODE_INTERPOLATED" value="0" enum="BlendMode">
The interpolation between animations is linear.
</constant>
<constant name="BLEND_MODE_DISCRETE" value="1" enum="BlendMode">
The blend space plays the animation of the animation node which blending position is closest to. Useful for frame-by-frame 2D animations.
</constant>
<constant name="BLEND_MODE_DISCRETE_CARRY" value="2" enum="BlendMode">
Similar to [constant BLEND_MODE_DISCRETE], but starts the new animation at the last animation's playback position.
</constant>
</constants>
</class>