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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNode" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Base class for [AnimationTree] nodes. Not related to scene nodes.
</brief_description>
<description>
Base resource for [AnimationTree] nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas.
Inherit this when creating animation nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead.
You can access the time information as read-only parameter which is processed and stored in the previous frame for all nodes except [AnimationNodeOutput].
[b]Note:[/b] If multiple inputs exist in the [AnimationNode], which time information takes precedence depends on the type of [AnimationNode].
[codeblock]
var current_length = $AnimationTree[parameters/AnimationNodeName/current_length]
var current_position = $AnimationTree[parameters/AnimationNodeName/current_position]
var current_delta = $AnimationTree[parameters/AnimationNodeName/current_delta]
[/codeblock]
</description>
<tutorials>
<link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
<method name="_get_caption" qualifiers="virtual const">
<return type="String" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to override the text caption for this animation node.
</description>
</method>
<method name="_get_child_by_name" qualifiers="virtual const">
<return type="AnimationNode" />
<param index="0" name="name" type="StringName" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to return a child animation node by its [param name].
</description>
</method>
<method name="_get_child_nodes" qualifiers="virtual const">
<return type="Dictionary" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to return all child animation nodes in order as a [code]name: node[/code] dictionary.
</description>
</method>
<method name="_get_parameter_default_value" qualifiers="virtual const">
<return type="Variant" />
<param index="0" name="parameter" type="StringName" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to return the default value of a [param parameter]. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees.
</description>
</method>
<method name="_get_parameter_list" qualifiers="virtual const">
<return type="Array" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to return a list of the properties on this animation node. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list].
</description>
</method>
<method name="_has_filter" qualifiers="virtual const">
<return type="bool" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to return whether the blend tree editor should display filter editing on this animation node.
</description>
</method>
<method name="_is_parameter_read_only" qualifiers="virtual const">
<return type="bool" />
<param index="0" name="parameter" type="StringName" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to return whether the [param parameter] is read-only. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees.
</description>
</method>
<method name="_process" qualifiers="virtual" deprecated="Currently this is mostly useless as there is a lack of many APIs to extend AnimationNode by GDScript. It is planned that a more flexible API using structures will be provided in the future.">
<return type="float" />
<param index="0" name="time" type="float" />
<param index="1" name="seek" type="bool" />
<param index="2" name="is_external_seeking" type="bool" />
<param index="3" name="test_only" type="bool" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to run some code when this animation node is processed. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute.
Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory.
This function should return the delta.
</description>
</method>
<method name="add_input">
<return type="bool" />
<param index="0" name="name" type="String" />
<description>
Adds an input to the animation node. This is only useful for animation nodes created for use in an [AnimationNodeBlendTree]. If the addition fails, returns [code]false[/code].
</description>
</method>
<method name="blend_animation">
<return type="void" />
<param index="0" name="animation" type="StringName" />
<param index="1" name="time" type="float" />
<param index="2" name="delta" type="float" />
<param index="3" name="seeked" type="bool" />
<param index="4" name="is_external_seeking" type="bool" />
<param index="5" name="blend" type="float" />
<param index="6" name="looped_flag" type="int" enum="Animation.LoopedFlag" default="0" />
<description>
Blend an animation by [param blend] amount (name must be valid in the linked [AnimationPlayer]). A [param time] and [param delta] may be passed, as well as whether [param seeked] happened.
A [param looped_flag] is used by internal processing immediately after the loop. See also [enum Animation.LoopedFlag].
</description>
</method>
<method name="blend_input">
<return type="float" />
<param index="0" name="input_index" type="int" />
<param index="1" name="time" type="float" />
<param index="2" name="seek" type="bool" />
<param index="3" name="is_external_seeking" type="bool" />
<param index="4" name="blend" type="float" />
<param index="5" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" />
<param index="6" name="sync" type="bool" default="true" />
<param index="7" name="test_only" type="bool" default="false" />
<description>
Blend an input. This is only useful for animation nodes created for an [AnimationNodeBlendTree]. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute. A filter mode may be optionally passed (see [enum FilterAction] for options).
</description>
</method>
<method name="blend_node">
<return type="float" />
<param index="0" name="name" type="StringName" />
<param index="1" name="node" type="AnimationNode" />
<param index="2" name="time" type="float" />
<param index="3" name="seek" type="bool" />
<param index="4" name="is_external_seeking" type="bool" />
<param index="5" name="blend" type="float" />
<param index="6" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" />
<param index="7" name="sync" type="bool" default="true" />
<param index="8" name="test_only" type="bool" default="false" />
<description>
Blend another animation node (in case this animation node contains child animation nodes). This function is only useful if you inherit from [AnimationRootNode] instead, otherwise editors will not display your animation node for addition.
</description>
</method>
<method name="find_input" qualifiers="const">
<return type="int" />
<param index="0" name="name" type="String" />
<description>
Returns the input index which corresponds to [param name]. If not found, returns [code]-1[/code].
</description>
</method>
<method name="get_input_count" qualifiers="const">
<return type="int" />
<description>
Amount of inputs in this animation node, only useful for animation nodes that go into [AnimationNodeBlendTree].
</description>
</method>
<method name="get_input_name" qualifiers="const">
<return type="String" />
<param index="0" name="input" type="int" />
<description>
Gets the name of an input by index.
</description>
</method>
<method name="get_parameter" qualifiers="const">
<return type="Variant" />
<param index="0" name="name" type="StringName" />
<description>
Gets the value of a parameter. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees.
</description>
</method>
<method name="is_path_filtered" qualifiers="const">
<return type="bool" />
<param index="0" name="path" type="NodePath" />
<description>
Returns whether the given path is filtered.
</description>
</method>
<method name="remove_input">
<return type="void" />
<param index="0" name="index" type="int" />
<description>
Removes an input, call this only when inactive.
</description>
</method>
<method name="set_filter_path">
<return type="void" />
<param index="0" name="path" type="NodePath" />
<param index="1" name="enable" type="bool" />
<description>
Adds or removes a path for the filter.
</description>
</method>
<method name="set_input_name">
<return type="bool" />
<param index="0" name="input" type="int" />
<param index="1" name="name" type="String" />
<description>
Sets the name of the input at the given [param input] index. If the setting fails, returns [code]false[/code].
</description>
</method>
<method name="set_parameter">
<return type="void" />
<param index="0" name="name" type="StringName" />
<param index="1" name="value" type="Variant" />
<description>
Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes.
</description>
</method>
</methods>
<members>
<member name="filter_enabled" type="bool" setter="set_filter_enabled" getter="is_filter_enabled">
If [code]true[/code], filtering is enabled.
</member>
</members>
<signals>
<signal name="animation_node_removed">
<param index="0" name="object_id" type="int" />
<param index="1" name="name" type="String" />
<description>
Emitted by nodes that inherit from this class and that have an internal tree when one of their animation nodes removes. The animation nodes that emit this signal are [AnimationNodeBlendSpace1D], [AnimationNodeBlendSpace2D], [AnimationNodeStateMachine], and [AnimationNodeBlendTree].
</description>
</signal>
<signal name="animation_node_renamed">
<param index="0" name="object_id" type="int" />
<param index="1" name="old_name" type="String" />
<param index="2" name="new_name" type="String" />
<description>
Emitted by nodes that inherit from this class and that have an internal tree when one of their animation node names changes. The animation nodes that emit this signal are [AnimationNodeBlendSpace1D], [AnimationNodeBlendSpace2D], [AnimationNodeStateMachine], and [AnimationNodeBlendTree].
</description>
</signal>
<signal name="tree_changed">
<description>
Emitted by nodes that inherit from this class and that have an internal tree when one of their animation nodes changes. The animation nodes that emit this signal are [AnimationNodeBlendSpace1D], [AnimationNodeBlendSpace2D], [AnimationNodeStateMachine], [AnimationNodeBlendTree] and [AnimationNodeTransition].
</description>
</signal>
</signals>
<constants>
<constant name="FILTER_IGNORE" value="0" enum="FilterAction">
Do not use filtering.
</constant>
<constant name="FILTER_PASS" value="1" enum="FilterAction">
Paths matching the filter will be allowed to pass.
</constant>
<constant name="FILTER_STOP" value="2" enum="FilterAction">
Paths matching the filter will be discarded.
</constant>
<constant name="FILTER_BLEND" value="3" enum="FilterAction">
Paths matching the filter will be blended (by the blend value).
</constant>
</constants>
</class>
|