[DOCS] Add descriptions to AnimationNodeStateMachine[Playback]

This commit is contained in:
Chris Bradfield 2019-05-20 19:45:23 -07:00 committed by Rémi Verschelde
parent eaff86f8bd
commit 47b8615a2e
2 changed files with 37 additions and 4 deletions

View File

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeStateMachine" inherits="AnimationRootNode" category="Core" version="3.2"> <class name="AnimationNodeStateMachine" inherits="AnimationRootNode" category="Core" version="3.2">
<brief_description> <brief_description>
State machine for control of animations.
</brief_description> </brief_description>
<description> <description>
Contains multiple root nodes as children in a graph. Each node is used as a state, and provides multiple functions to alternate between states. Retrieve the AnimationNodeStateMachinePlayback object from the [AnimationTree] node to control it programmatically. Contains multiple nodes representing animation states, connected in a graph. Nodes transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the AnimationNodeStateMachinePlayback object from the [AnimationTree] node to control it programatically. Example:
[codeblock] [codeblock]
var state_machine = anim_tree["parameters/StateMachine/playback"] var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("SomeState") state_machine.travel("some_state")
[/codeblock] [/codeblock]
</description> </description>
<tutorials> <tutorials>
@ -22,6 +23,7 @@
<argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )"> <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument> </argument>
<description> <description>
Adds a new node to the graph. The [code]position[/code] is used for display in the editor.
</description> </description>
</method> </method>
<method name="add_transition"> <method name="add_transition">
@ -34,18 +36,21 @@
<argument index="2" name="transition" type="AnimationNodeStateMachineTransition"> <argument index="2" name="transition" type="AnimationNodeStateMachineTransition">
</argument> </argument>
<description> <description>
Adds a transition between the given nodes.
</description> </description>
</method> </method>
<method name="get_end_node" qualifiers="const"> <method name="get_end_node" qualifiers="const">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Returns the graph's end node.
</description> </description>
</method> </method>
<method name="get_graph_offset" qualifiers="const"> <method name="get_graph_offset" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Returns the draw offset of the graph. Used for display in the editor.
</description> </description>
</method> </method>
<method name="get_node" qualifiers="const"> <method name="get_node" qualifiers="const">
@ -54,6 +59,7 @@
<argument index="0" name="name" type="String"> <argument index="0" name="name" type="String">
</argument> </argument>
<description> <description>
Returns the animation node with the given name.
</description> </description>
</method> </method>
<method name="get_node_name" qualifiers="const"> <method name="get_node_name" qualifiers="const">
@ -62,6 +68,7 @@
<argument index="0" name="node" type="AnimationNode"> <argument index="0" name="node" type="AnimationNode">
</argument> </argument>
<description> <description>
Returns the given animation node's name.
</description> </description>
</method> </method>
<method name="get_node_position" qualifiers="const"> <method name="get_node_position" qualifiers="const">
@ -70,12 +77,14 @@
<argument index="0" name="name" type="String"> <argument index="0" name="name" type="String">
</argument> </argument>
<description> <description>
Returns the given node's coordinates. Used for display in the editor.
</description> </description>
</method> </method>
<method name="get_start_node" qualifiers="const"> <method name="get_start_node" qualifiers="const">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Returns the graph's end node.
</description> </description>
</method> </method>
<method name="get_transition" qualifiers="const"> <method name="get_transition" qualifiers="const">
@ -84,12 +93,14 @@
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Returns the given transition.
</description> </description>
</method> </method>
<method name="get_transition_count" qualifiers="const"> <method name="get_transition_count" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the number of connections in the graph.
</description> </description>
</method> </method>
<method name="get_transition_from" qualifiers="const"> <method name="get_transition_from" qualifiers="const">
@ -98,6 +109,7 @@
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Returns the given transition's start node.
</description> </description>
</method> </method>
<method name="get_transition_to" qualifiers="const"> <method name="get_transition_to" qualifiers="const">
@ -106,6 +118,7 @@
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Returns the given transition's end node.
</description> </description>
</method> </method>
<method name="has_node" qualifiers="const"> <method name="has_node" qualifiers="const">
@ -114,6 +127,7 @@
<argument index="0" name="name" type="String"> <argument index="0" name="name" type="String">
</argument> </argument>
<description> <description>
Returns [code]true[/code] if the graph contains the given node.
</description> </description>
</method> </method>
<method name="has_transition" qualifiers="const"> <method name="has_transition" qualifiers="const">
@ -124,6 +138,7 @@
<argument index="1" name="to" type="String"> <argument index="1" name="to" type="String">
</argument> </argument>
<description> <description>
Returns [code]true[/code] if there is a transition between the given nodes.
</description> </description>
</method> </method>
<method name="remove_node"> <method name="remove_node">
@ -132,6 +147,7 @@
<argument index="0" name="name" type="String"> <argument index="0" name="name" type="String">
</argument> </argument>
<description> <description>
Deletes the given node from the graph.
</description> </description>
</method> </method>
<method name="remove_transition"> <method name="remove_transition">
@ -142,6 +158,7 @@
<argument index="1" name="to" type="String"> <argument index="1" name="to" type="String">
</argument> </argument>
<description> <description>
Deletes the given transition.
</description> </description>
</method> </method>
<method name="remove_transition_by_index"> <method name="remove_transition_by_index">
@ -150,6 +167,7 @@
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Deletes the given transition.
</description> </description>
</method> </method>
<method name="rename_node"> <method name="rename_node">
@ -160,6 +178,7 @@
<argument index="1" name="new_name" type="String"> <argument index="1" name="new_name" type="String">
</argument> </argument>
<description> <description>
Renames the given node.
</description> </description>
</method> </method>
<method name="set_end_node"> <method name="set_end_node">
@ -168,6 +187,7 @@
<argument index="0" name="name" type="String"> <argument index="0" name="name" type="String">
</argument> </argument>
<description> <description>
Sets the given node as the graph end point.
</description> </description>
</method> </method>
<method name="set_graph_offset"> <method name="set_graph_offset">
@ -176,6 +196,7 @@
<argument index="0" name="offset" type="Vector2"> <argument index="0" name="offset" type="Vector2">
</argument> </argument>
<description> <description>
Sets the draw offset of the graph. Used for display in the editor.
</description> </description>
</method> </method>
<method name="set_node_position"> <method name="set_node_position">
@ -186,6 +207,7 @@
<argument index="1" name="position" type="Vector2"> <argument index="1" name="position" type="Vector2">
</argument> </argument>
<description> <description>
Sets the node's coordinates. Used for display in the editor.
</description> </description>
</method> </method>
<method name="set_start_node"> <method name="set_start_node">
@ -194,6 +216,7 @@
<argument index="0" name="name" type="String"> <argument index="0" name="name" type="String">
</argument> </argument>
<description> <description>
Sets the given node as the graph start point.
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -1,8 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeStateMachinePlayback" inherits="Resource" category="Core" version="3.2"> <class name="AnimationNodeStateMachinePlayback" inherits="Resource" category="Core" version="3.2">
<brief_description> <brief_description>
Playback control for AnimationNodeStateMachine.
</brief_description> </brief_description>
<description> <description>
Allows control of [AnimationTree] state machines created with [AnimationNodeStateMachine]. Retrieve with [code]$AnimationTree.get("parameters/playback")[/code]. Example:
[codeblock]
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
[/codeblock]
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
@ -11,6 +17,7 @@
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Returns the currently playing animation state.
</description> </description>
</method> </method>
<method name="get_travel_path" qualifiers="const"> <method name="get_travel_path" qualifiers="const">
@ -23,6 +30,7 @@
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns [code]true[/code] if an animation is playing.
</description> </description>
</method> </method>
<method name="start"> <method name="start">
@ -31,12 +39,14 @@
<argument index="0" name="node" type="String"> <argument index="0" name="node" type="String">
</argument> </argument>
<description> <description>
Starts playing the given animation.
</description> </description>
</method> </method>
<method name="stop"> <method name="stop">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Stops the currently playing animation.
</description> </description>
</method> </method>
<method name="travel"> <method name="travel">
@ -45,7 +55,7 @@
<argument index="0" name="to_node" type="String"> <argument index="0" name="to_node" type="String">
</argument> </argument>
<description> <description>
Transition from the current state to another one, while visiting all the intermediate ones. This is done via the A* algorithm. Transitions from the current state to another one, following the shortest path.
</description> </description>
</method> </method>
</methods> </methods>