You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: classes/class_animationnode.rst
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,16 @@ Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes. In general, i
25
25
26
26
Inherit this when creating animation nodes mainly for use in :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`, otherwise :ref:`AnimationRootNode<class_AnimationRootNode>` should be used instead.
27
27
28
+
You can access the time information as read-only parameter which is processed and stored in the previous frame for all nodes except :ref:`AnimationNodeOutput<class_AnimationNodeOutput>`.
29
+
30
+
\ **Note:** If more than two inputs exist in the **AnimationNode**, which time information takes precedence depends on the type of **AnimationNode**.
31
+
32
+
::
33
+
34
+
var current_length = $AnimationTree[parameters/AnimationNodeName/current_length]
35
+
var current_position = $AnimationTree[parameters/AnimationNodeName/current_position]
36
+
var current_delta = $AnimationTree[parameters/AnimationNodeName/current_delta]
37
+
28
38
.. rst-class:: classref-introduction-group
29
39
30
40
Tutorials
@@ -305,11 +315,13 @@ When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implemen
**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.
319
+
308
320
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to run some code when this animation node is processed. The ``time`` parameter is a relative delta, unless ``seek`` is ``true``, in which case it is absolute.
309
321
310
322
Here, call the :ref:`blend_input<class_AnimationNode_method_blend_input>`, :ref:`blend_node<class_AnimationNode_method_blend_node>` or :ref:`blend_animation<class_AnimationNode_method_blend_animation>` functions. You can also use :ref:`get_parameter<class_AnimationNode_method_get_parameter>` and :ref:`set_parameter<class_AnimationNode_method_set_parameter>` to modify local memory.
311
323
312
-
This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called).
If :ref:`use_custom_timeline<class_AnimationNodeAnimation_property_use_custom_timeline>` is ``true``, override the loop settings of the original :ref:`Animation<class_Animation>` resource with the value.
If ``true``, scales the time so that the length specified in :ref:`timeline_length<class_AnimationNodeAnimation_property_timeline_length>` is one cycle.
181
+
182
+
This is useful for matching the periods of walking and running animations.
183
+
184
+
If ``false``, the original animation length is respected. If you set the loop to :ref:`loop_mode<class_AnimationNodeAnimation_property_loop_mode>`, the animation will loop in :ref:`timeline_length<class_AnimationNodeAnimation_property_timeline_length>`.
If ``true``, :ref:`AnimationNode<class_AnimationNode>` provides an animation based on the :ref:`Animation<class_Animation>` resource with some parameters adjusted.
219
+
119
220
.. |virtual| replace:::abbr:`virtual(This method should typically be overridden by the user to have any effect.)`
120
221
.. |const| replace:::abbr:`const(This method has no side effects. It doesn't modify any of the instance's member variables.)`
121
222
.. |vararg| replace:::abbr:`vararg(This method accepts any number of arguments after the ones described here.)`
@@ -272,6 +291,8 @@ Determines how cross-fading between animations is eased. If empty, the transitio
272
291
273
292
The fade-in duration. For example, setting this to ``1.0`` for a 5 second length animation will produce a cross-fade that starts at 0 second and ends at 1 second during the animation.
274
293
294
+
\ **Note:** **AnimationNodeOneShot** transitions the current state after the end of the fading. When :ref:`AnimationNodeOutput<class_AnimationNodeOutput>` is considered as the most upstream, so the :ref:`fadein_time<class_AnimationNodeOneShot_property_fadein_time>` is scaled depending on the downstream delta. For example, if this value is set to ``1.0`` and a :ref:`AnimationNodeTimeScale<class_AnimationNodeTimeScale>` with a value of ``2.0`` is chained downstream, the actual processing time will be 0.5 second.
295
+
275
296
.. rst-class:: classref-item-separator
276
297
277
298
----
@@ -306,6 +327,8 @@ Determines how cross-fading between animations is eased. If empty, the transitio
306
327
307
328
The fade-out duration. For example, setting this to ``1.0`` for a 5 second length animation will produce a cross-fade that starts at 4 second and ends at 5 second during the animation.
308
329
330
+
\ **Note:** **AnimationNodeOneShot** transitions the current state after the end of the fading. When :ref:`AnimationNodeOutput<class_AnimationNodeOutput>` is considered as the most upstream, so the :ref:`fadeout_time<class_AnimationNodeOneShot_property_fadeout_time>` is scaled depending on the downstream delta. For example, if this value is set to ``1.0`` and an :ref:`AnimationNodeTimeScale<class_AnimationNodeTimeScale>` with a value of ``2.0`` is chained downstream, the actual processing time will be 0.5 second.
0 commit comments