2018-07-26 09:56:21 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2021-04-26 11:14:51 +00:00
<class name= "AnimationNodeStateMachine" inherits= "AnimationRootNode" version= "3.4" >
2018-07-26 09:56:21 +00:00
<brief_description >
2019-05-21 02:45:23 +00:00
State machine for control of animations.
2018-07-26 09:56:21 +00:00
</brief_description>
<description >
2020-01-23 10:14:14 +00:00
Contains multiple nodes representing animation states, connected in a graph. Node 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 programmatically.
2019-06-21 23:04:47 +00:00
[b]Example:[/b]
2019-04-07 11:21:31 +00:00
[codeblock]
2019-05-21 02:45:23 +00:00
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
2019-05-15 11:00:45 +00:00
[/codeblock]
2018-07-26 09:56:21 +00:00
</description>
<tutorials >
2021-03-26 09:43:43 +00:00
<link > https://docs.godotengine.org/en/3.3/tutorials/animation/animation_tree.html</link>
2018-07-26 09:56:21 +00:00
</tutorials>
<methods >
<method name= "add_node" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<argument index= "1" name= "node" type= "AnimationNode" >
</argument>
2018-08-20 22:35:30 +00:00
<argument index= "2" name= "position" type= "Vector2" default= "Vector2( 0, 0 )" >
</argument>
2018-07-26 09:56:21 +00:00
<description >
2019-05-21 02:45:23 +00:00
Adds a new node to the graph. The [code]position[/code] is used for display in the editor.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "add_transition" >
<return type= "void" >
</return>
<argument index= "0" name= "from" type= "String" >
</argument>
<argument index= "1" name= "to" type= "String" >
</argument>
<argument index= "2" name= "transition" type= "AnimationNodeStateMachineTransition" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Adds a transition between the given nodes.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "get_end_node" qualifiers= "const" >
<return type= "String" >
</return>
<description >
2019-05-21 02:45:23 +00:00
Returns the graph's end node.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "get_graph_offset" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
2019-05-21 02:45:23 +00:00
Returns the draw offset of the graph. Used for display in the editor.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "get_node" qualifiers= "const" >
<return type= "AnimationNode" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Returns the animation node with the given name.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "get_node_name" qualifiers= "const" >
<return type= "String" >
</return>
<argument index= "0" name= "node" type= "AnimationNode" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Returns the given animation node's name.
2018-07-26 09:56:21 +00:00
</description>
</method>
2018-08-20 22:35:30 +00:00
<method name= "get_node_position" qualifiers= "const" >
<return type= "Vector2" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Returns the given node's coordinates. Used for display in the editor.
2018-08-20 22:35:30 +00:00
</description>
</method>
2018-07-26 09:56:21 +00:00
<method name= "get_start_node" qualifiers= "const" >
<return type= "String" >
</return>
<description >
2019-05-21 02:45:23 +00:00
Returns the graph's end node.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "get_transition" qualifiers= "const" >
<return type= "AnimationNodeStateMachineTransition" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Returns the given transition.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "get_transition_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2019-05-21 02:45:23 +00:00
Returns the number of connections in the graph.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "get_transition_from" qualifiers= "const" >
<return type= "String" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Returns the given transition's start node.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "get_transition_to" qualifiers= "const" >
<return type= "String" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Returns the given transition's end node.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "has_node" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Returns [code]true[/code] if the graph contains the given node.
2018-07-26 09:56:21 +00:00
</description>
</method>
2018-08-20 22:35:30 +00:00
<method name= "has_transition" qualifiers= "const" >
<return type= "bool" >
2018-07-26 09:56:21 +00:00
</return>
<argument index= "0" name= "from" type= "String" >
</argument>
<argument index= "1" name= "to" type= "String" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Returns [code]true[/code] if there is a transition between the given nodes.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "remove_node" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Deletes the given node from the graph.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "remove_transition" >
<return type= "void" >
</return>
<argument index= "0" name= "from" type= "String" >
</argument>
<argument index= "1" name= "to" type= "String" >
</argument>
<description >
2020-01-23 10:14:14 +00:00
Deletes the transition between the two specified nodes.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "remove_transition_by_index" >
<return type= "void" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
2020-01-23 10:14:14 +00:00
Deletes the given transition by index.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "rename_node" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<argument index= "1" name= "new_name" type= "String" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Renames the given node.
2018-07-26 09:56:21 +00:00
</description>
</method>
2020-03-25 10:42:15 +00:00
<method name= "replace_node" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<argument index= "1" name= "node" type= "AnimationNode" >
</argument>
<description >
Replaces the node and keeps its transitions unchanged.
</description>
</method>
2018-07-26 09:56:21 +00:00
<method name= "set_end_node" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<description >
2019-05-21 02:45:23 +00:00
Sets the given node as the graph end point.
2018-07-26 09:56:21 +00:00
</description>
</method>
<method name= "set_graph_offset" >
<return type= "void" >
</return>
2019-04-07 11:21:31 +00:00
<argument index= "0" name= "offset" type= "Vector2" >
2018-07-26 09:56:21 +00:00
</argument>
<description >
2019-05-21 02:45:23 +00:00
Sets the draw offset of the graph. Used for display in the editor.
2018-07-26 09:56:21 +00:00
</description>
</method>
2018-08-20 22:35:30 +00:00
<method name= "set_node_position" >
2018-07-26 09:56:21 +00:00
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
2018-08-20 22:35:30 +00:00
<argument index= "1" name= "position" type= "Vector2" >
2018-07-26 09:56:21 +00:00
</argument>
<description >
2019-05-21 02:45:23 +00:00
Sets the node's coordinates. Used for display in the editor.
2018-07-26 09:56:21 +00:00
</description>
</method>
2018-08-20 22:35:30 +00:00
<method name= "set_start_node" >
2018-07-26 09:56:21 +00:00
<return type= "void" >
</return>
2018-08-20 22:35:30 +00:00
<argument index= "0" name= "name" type= "String" >
2018-07-26 09:56:21 +00:00
</argument>
<description >
2019-05-21 02:45:23 +00:00
Sets the given node as the graph start point.
2018-07-26 09:56:21 +00:00
</description>
</method>
</methods>
<constants >
</constants>
</class>