Skip to content

Commit 5fce83f

Browse files
committed
update docs for new animation node observer classes
1 parent 5767932 commit 5fce83f

6 files changed

Lines changed: 248 additions & 1 deletion
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
:github_url: hide
2+
3+
.. DO NOT EDIT THIS FILE!!!
4+
.. Generated automatically from Godot engine sources.
5+
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
6+
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeObserver.xml.
7+
8+
.. _class_AnimationNodeObserver:
9+
10+
AnimationNodeObserver
11+
=====================
12+
13+
**Experimental:** This class may be changed or removed in future versions.
14+
15+
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
16+
17+
**Inherited By:** :ref:`AnimationNodeObserverBlendSpace<class_AnimationNodeObserverBlendSpace>`, :ref:`AnimationNodeObserverOneShot<class_AnimationNodeObserverOneShot>`, :ref:`AnimationNodeObserverTransition<class_AnimationNodeObserverTransition>`
18+
19+
Base class for observer types which relay :ref:`AnimationNode<class_AnimationNode>` events for a particular :ref:`AnimationTree<class_AnimationTree>` node.
20+
21+
.. rst-class:: classref-reftable-group
22+
23+
Properties
24+
----------
25+
26+
.. table::
27+
:widths: auto
28+
29+
+-------------------------+-------------------------+---------------------------------------------------------------------------------------+
30+
| :ref:`bool<class_bool>` | resource_local_to_scene | ``true`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
31+
+-------------------------+-------------------------+---------------------------------------------------------------------------------------+
32+
33+
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
34+
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
35+
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
36+
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
37+
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
38+
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
39+
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
40+
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
41+
.. |void| replace:: :abbr:`void (No return value.)`
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
:github_url: hide
2+
3+
.. DO NOT EDIT THIS FILE!!!
4+
.. Generated automatically from Godot engine sources.
5+
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
6+
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeObserverBlendSpace.xml.
7+
8+
.. _class_AnimationNodeObserverBlendSpace:
9+
10+
AnimationNodeObserverBlendSpace
11+
===============================
12+
13+
**Experimental:** This class may be changed or removed in future versions.
14+
15+
**Inherits:** :ref:`AnimationNodeObserver<class_AnimationNodeObserver>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
16+
17+
Observer for events from :ref:`AnimationNodeBlendSpace1D<class_AnimationNodeBlendSpace1D>` and :ref:`AnimationNodeBlendSpace2D<class_AnimationNodeBlendSpace2D>` instances.
18+
19+
.. rst-class:: classref-section-separator
20+
21+
----
22+
23+
.. rst-class:: classref-descriptions-group
24+
25+
Signals
26+
-------
27+
28+
.. _class_AnimationNodeObserverBlendSpace_signal_closest_point_changed:
29+
30+
.. rst-class:: classref-signal
31+
32+
**closest_point_changed**\ (\ closest_point_name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationNodeObserverBlendSpace_signal_closest_point_changed>`
33+
34+
Emitted when the closest point to the current blend position changes.
35+
36+
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
37+
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
38+
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
39+
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
40+
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
41+
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
42+
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
43+
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
44+
.. |void| replace:: :abbr:`void (No return value.)`
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
:github_url: hide
2+
3+
.. DO NOT EDIT THIS FILE!!!
4+
.. Generated automatically from Godot engine sources.
5+
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
6+
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeObserverOneShot.xml.
7+
8+
.. _class_AnimationNodeObserverOneShot:
9+
10+
AnimationNodeObserverOneShot
11+
============================
12+
13+
**Experimental:** This class may be changed or removed in future versions.
14+
15+
**Inherits:** :ref:`AnimationNodeObserver<class_AnimationNodeObserver>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
16+
17+
Observer for events from :ref:`AnimationNodeOneShot<class_AnimationNodeOneShot>` instances.
18+
19+
.. rst-class:: classref-section-separator
20+
21+
----
22+
23+
.. rst-class:: classref-descriptions-group
24+
25+
Signals
26+
-------
27+
28+
.. _class_AnimationNodeObserverOneShot_signal_fade_in_finished:
29+
30+
.. rst-class:: classref-signal
31+
32+
**fade_in_finished**\ (\ ) :ref:`🔗<class_AnimationNodeObserverOneShot_signal_fade_in_finished>`
33+
34+
Emitted when the one-shot has finished fading in. Only emitted if fade-in time is greater than zero.
35+
36+
.. rst-class:: classref-item-separator
37+
38+
----
39+
40+
.. _class_AnimationNodeObserverOneShot_signal_fade_out_started:
41+
42+
.. rst-class:: classref-signal
43+
44+
**fade_out_started**\ (\ ) :ref:`🔗<class_AnimationNodeObserverOneShot_signal_fade_out_started>`
45+
46+
Emitted when the one-shot has started fading out. Only emitted if fade-out time is greater than zero.
47+
48+
.. rst-class:: classref-item-separator
49+
50+
----
51+
52+
.. _class_AnimationNodeObserverOneShot_signal_finished:
53+
54+
.. rst-class:: classref-signal
55+
56+
**finished**\ (\ ) :ref:`🔗<class_AnimationNodeObserverOneShot_signal_finished>`
57+
58+
Emitted when the one-shot has finished.
59+
60+
.. rst-class:: classref-item-separator
61+
62+
----
63+
64+
.. _class_AnimationNodeObserverOneShot_signal_started:
65+
66+
.. rst-class:: classref-signal
67+
68+
**started**\ (\ ) :ref:`🔗<class_AnimationNodeObserverOneShot_signal_started>`
69+
70+
Emitted when the one-shot has started.
71+
72+
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
73+
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
74+
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
75+
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
76+
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
77+
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
78+
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
79+
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
80+
.. |void| replace:: :abbr:`void (No return value.)`
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
:github_url: hide
2+
3+
.. DO NOT EDIT THIS FILE!!!
4+
.. Generated automatically from Godot engine sources.
5+
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
6+
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeObserverTransition.xml.
7+
8+
.. _class_AnimationNodeObserverTransition:
9+
10+
AnimationNodeObserverTransition
11+
===============================
12+
13+
**Experimental:** This class may be changed or removed in future versions.
14+
15+
**Inherits:** :ref:`AnimationNodeObserver<class_AnimationNodeObserver>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
16+
17+
Observer for events from :ref:`AnimationNodeTransition<class_AnimationNodeTransition>` instances.
18+
19+
.. rst-class:: classref-section-separator
20+
21+
----
22+
23+
.. rst-class:: classref-descriptions-group
24+
25+
Signals
26+
-------
27+
28+
.. _class_AnimationNodeObserverTransition_signal_state_finished:
29+
30+
.. rst-class:: classref-signal
31+
32+
**state_finished**\ (\ state\: :ref:`String<class_String>`\ ) :ref:`🔗<class_AnimationNodeObserverTransition_signal_state_finished>`
33+
34+
Emitted when transitioning out of a state. If crossfade time is greater than zero, emits when the crossfade finishes. Otherwise, emits immediately before :ref:`state_started<class_AnimationNodeObserverTransition_signal_state_started>` emits for the new state.
35+
36+
.. rst-class:: classref-item-separator
37+
38+
----
39+
40+
.. _class_AnimationNodeObserverTransition_signal_state_started:
41+
42+
.. rst-class:: classref-signal
43+
44+
**state_started**\ (\ state\: :ref:`String<class_String>`\ ) :ref:`🔗<class_AnimationNodeObserverTransition_signal_state_started>`
45+
46+
Emitted when a transition to a new state starts.
47+
48+
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
49+
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
50+
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
51+
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
52+
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
53+
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
54+
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
55+
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
56+
.. |void| replace:: :abbr:`void (No return value.)`

classes/index.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ Resources
333333
class_animationnodeblendspace2d
334334
class_animationnodeblendtree
335335
class_animationnodeextension
336+
class_animationnodeobserver
337+
class_animationnodeobserverblendspace
338+
class_animationnodeobserveroneshot
339+
class_animationnodeobservertransition
336340
class_animationnodeoneshot
337341
class_animationnodeoutput
338342
class_animationnodestatemachine
@@ -1220,4 +1224,3 @@ Variant types
12201224
class_vector3i
12211225
class_vector4
12221226
class_vector4i
1223-

tutorials/animation/animation_tree.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,3 +494,26 @@ Then you can set or read them:
494494

495495
.. note:: Advance Expressions from a StateMachine will not be found under the parameters. This is because they are held in another script rather than the
496496
AnimationTree itself. Advance `Conditions` will be found under parameters.
497+
498+
Signals and Animation Node Observers
499+
------------------------------------
500+
501+
Certain animation node types support an :ref:`AnimationNodeObserver <class_AnimationNodeObserver>` parameter which relays animation events through signals.
502+
For example, :ref:`AnimationNodeTransition <class_AnimationNodeTransition>` can be configured with an :ref:`AnimationNodeObserverTransition <class_AnimationNodeObserverTransition>`
503+
which emits signals when a transition state starts and finishes:
504+
505+
.. tabs::
506+
.. code-tab:: gdscript GDScript
507+
508+
var observer := tree.get("parameters/Transition/observer") as AnimationNodeObserverTransition
509+
if observer:
510+
observer.state_started.connect(on_state_started)
511+
observer.state_finished.connect(on_state_finished)
512+
513+
.. code-tab:: csharp
514+
515+
if (tree.Get("parameters/Transition/observer").Obj is AnimationNodeObserverTransition observer)
516+
{
517+
observer.StateStarted += OnStateStarted;
518+
observer.StateFinished += OnStateFinished;
519+
}

0 commit comments

Comments
 (0)