Skip to content

Commit 876fe97

Browse files
authored
Merge pull request godotengine#9161 from godotengine/classref/sync-29b3d9e
classref: Sync with current master branch (29b3d9e)
2 parents a22c312 + e41630e commit 876fe97

36 files changed

+1183
-204
lines changed

classes/class_animationnode.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes. In general, i
2525

2626
Inherit this when creating animation nodes mainly for use in :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`, otherwise :ref:`AnimationRootNode<class_AnimationRootNode>` should be used instead.
2727

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+
2838
.. rst-class:: classref-introduction-group
2939

3040
Tutorials
@@ -305,11 +315,13 @@ When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implemen
305315

306316
:ref:`float<class_float>` **_process**\ (\ time\: :ref:`float<class_float>`, seek\: :ref:`bool<class_bool>`, is_external_seeking\: :ref:`bool<class_bool>`, test_only\: :ref:`bool<class_bool>`\ ) |virtual| |const|
307317

318+
**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+
308320
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.
309321

310322
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.
311323

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).
324+
This function should return the delta.
313325

314326
.. rst-class:: classref-item-separator
315327

classes/class_animationnodeanimation.rst

Lines changed: 106 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,21 @@ Properties
4040
.. table::
4141
:widths: auto
4242

43-
+-------------------------------------------------------+-------------------------------------------------------------------+---------+
44-
| :ref:`StringName<class_StringName>` | :ref:`animation<class_AnimationNodeAnimation_property_animation>` | ``&""`` |
45-
+-------------------------------------------------------+-------------------------------------------------------------------+---------+
46-
| :ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` | :ref:`play_mode<class_AnimationNodeAnimation_property_play_mode>` | ``0`` |
47-
+-------------------------------------------------------+-------------------------------------------------------------------+---------+
43+
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
44+
| :ref:`StringName<class_StringName>` | :ref:`animation<class_AnimationNodeAnimation_property_animation>` | ``&""`` |
45+
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
46+
| :ref:`LoopMode<enum_Animation_LoopMode>` | :ref:`loop_mode<class_AnimationNodeAnimation_property_loop_mode>` | |
47+
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
48+
| :ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` | :ref:`play_mode<class_AnimationNodeAnimation_property_play_mode>` | ``0`` |
49+
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
50+
| :ref:`float<class_float>` | :ref:`start_offset<class_AnimationNodeAnimation_property_start_offset>` | |
51+
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
52+
| :ref:`bool<class_bool>` | :ref:`stretch_time_scale<class_AnimationNodeAnimation_property_stretch_time_scale>` | |
53+
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
54+
| :ref:`float<class_float>` | :ref:`timeline_length<class_AnimationNodeAnimation_property_timeline_length>` | |
55+
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
56+
| :ref:`bool<class_bool>` | :ref:`use_custom_timeline<class_AnimationNodeAnimation_property_use_custom_timeline>` | ``false`` |
57+
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
4858

4959
.. rst-class:: classref-section-separator
5060

@@ -103,6 +113,23 @@ Animation to use as an output. It is one of the animations provided by :ref:`Ani
103113

104114
----
105115

116+
.. _class_AnimationNodeAnimation_property_loop_mode:
117+
118+
.. rst-class:: classref-property
119+
120+
:ref:`LoopMode<enum_Animation_LoopMode>` **loop_mode**
121+
122+
.. rst-class:: classref-property-setget
123+
124+
- |void| **set_loop_mode**\ (\ value\: :ref:`LoopMode<enum_Animation_LoopMode>`\ )
125+
- :ref:`LoopMode<enum_Animation_LoopMode>` **get_loop_mode**\ (\ )
126+
127+
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.
128+
129+
.. rst-class:: classref-item-separator
130+
131+
----
132+
106133
.. _class_AnimationNodeAnimation_property_play_mode:
107134

108135
.. rst-class:: classref-property
@@ -116,6 +143,80 @@ Animation to use as an output. It is one of the animations provided by :ref:`Ani
116143

117144
Determines the playback direction of the animation.
118145

146+
.. rst-class:: classref-item-separator
147+
148+
----
149+
150+
.. _class_AnimationNodeAnimation_property_start_offset:
151+
152+
.. rst-class:: classref-property
153+
154+
:ref:`float<class_float>` **start_offset**
155+
156+
.. rst-class:: classref-property-setget
157+
158+
- |void| **set_start_offset**\ (\ value\: :ref:`float<class_float>`\ )
159+
- :ref:`float<class_float>` **get_start_offset**\ (\ )
160+
161+
If :ref:`use_custom_timeline<class_AnimationNodeAnimation_property_use_custom_timeline>` is ``true``, offset the start position of the animation.
162+
163+
This is useful for adjusting which foot steps first in 3D walking animations.
164+
165+
.. rst-class:: classref-item-separator
166+
167+
----
168+
169+
.. _class_AnimationNodeAnimation_property_stretch_time_scale:
170+
171+
.. rst-class:: classref-property
172+
173+
:ref:`bool<class_bool>` **stretch_time_scale**
174+
175+
.. rst-class:: classref-property-setget
176+
177+
- |void| **set_stretch_time_scale**\ (\ value\: :ref:`bool<class_bool>`\ )
178+
- :ref:`bool<class_bool>` **is_stretching_time_scale**\ (\ )
179+
180+
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>`.
185+
186+
.. rst-class:: classref-item-separator
187+
188+
----
189+
190+
.. _class_AnimationNodeAnimation_property_timeline_length:
191+
192+
.. rst-class:: classref-property
193+
194+
:ref:`float<class_float>` **timeline_length**
195+
196+
.. rst-class:: classref-property-setget
197+
198+
- |void| **set_timeline_length**\ (\ value\: :ref:`float<class_float>`\ )
199+
- :ref:`float<class_float>` **get_timeline_length**\ (\ )
200+
201+
If :ref:`use_custom_timeline<class_AnimationNodeAnimation_property_use_custom_timeline>` is ``true``, offset the start position of the animation.
202+
203+
.. rst-class:: classref-item-separator
204+
205+
----
206+
207+
.. _class_AnimationNodeAnimation_property_use_custom_timeline:
208+
209+
.. rst-class:: classref-property
210+
211+
:ref:`bool<class_bool>` **use_custom_timeline** = ``false``
212+
213+
.. rst-class:: classref-property-setget
214+
215+
- |void| **set_use_custom_timeline**\ (\ value\: :ref:`bool<class_bool>`\ )
216+
- :ref:`bool<class_bool>` **is_using_custom_timeline**\ (\ )
217+
218+
If ``true``, :ref:`AnimationNode<class_AnimationNode>` provides an animation based on the :ref:`Animation<class_Animation>` resource with some parameters adjusted.
219+
119220
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
120221
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
121222
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

classes/class_animationnodeoneshot.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ Properties
9696
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
9797
| :ref:`float<class_float>` | :ref:`autorestart_random_delay<class_AnimationNodeOneShot_property_autorestart_random_delay>` | ``0.0`` |
9898
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
99+
| :ref:`bool<class_bool>` | :ref:`break_loop_at_end<class_AnimationNodeOneShot_property_break_loop_at_end>` | ``false`` |
100+
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
99101
| :ref:`Curve<class_Curve>` | :ref:`fadein_curve<class_AnimationNodeOneShot_property_fadein_curve>` | |
100102
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
101103
| :ref:`float<class_float>` | :ref:`fadein_time<class_AnimationNodeOneShot_property_fadein_time>` | ``0.0`` |
@@ -242,6 +244,23 @@ If :ref:`autorestart<class_AnimationNodeOneShot_property_autorestart>` is ``true
242244

243245
----
244246

247+
.. _class_AnimationNodeOneShot_property_break_loop_at_end:
248+
249+
.. rst-class:: classref-property
250+
251+
:ref:`bool<class_bool>` **break_loop_at_end** = ``false``
252+
253+
.. rst-class:: classref-property-setget
254+
255+
- |void| **set_break_loop_at_end**\ (\ value\: :ref:`bool<class_bool>`\ )
256+
- :ref:`bool<class_bool>` **is_loop_broken_at_end**\ (\ )
257+
258+
If ``true``, breaks the loop at the end of the loop cycle for transition, even if the animation is looping.
259+
260+
.. rst-class:: classref-item-separator
261+
262+
----
263+
245264
.. _class_AnimationNodeOneShot_property_fadein_curve:
246265

247266
.. rst-class:: classref-property
@@ -272,6 +291,8 @@ Determines how cross-fading between animations is eased. If empty, the transitio
272291

273292
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.
274293

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+
275296
.. rst-class:: classref-item-separator
276297

277298
----
@@ -306,6 +327,8 @@ Determines how cross-fading between animations is eased. If empty, the transitio
306327

307328
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.
308329

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.
331+
309332
.. rst-class:: classref-item-separator
310333

311334
----

0 commit comments

Comments
 (0)