2022-03-15 13:29:32 +01:00
<?xml version="1.0" encoding="UTF-8" ?>
2024-04-26 17:32:25 +02:00
<class name= "AnimationNodeStateMachine" inherits= "AnimationRootNode" version= "4.4" >
2022-03-15 13:29:32 +01:00
<brief_description >
State machine for control of animations.
</brief_description>
<description >
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.
[b]Example:[/b]
[codeblock]
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
[/codeblock]
</description>
<tutorials >
2023-08-29 22:33:15 +02:00
<link > $DOCS_URL/tutorials/animation/animation_tree.md</link>
2022-03-15 13:29:32 +01:00
</tutorials>
<methods >
<method name= "add_node" >
<return type= "void" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "name" type= "StringName" />
2022-03-15 13:29:32 +01:00
<argument index= "1" name= "node" type= "AnimationNode" />
<argument index= "2" name= "position" type= "Vector2" default= "Vector2( 0, 0 )" />
<description >
2023-12-21 00:48:25 +01:00
Adds a new node to the graph. The [code]position[/code] is used for display in the editor.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "add_transition" >
<return type= "void" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "from" type= "StringName" />
<argument index= "1" name= "to" type= "StringName" />
2022-03-15 13:29:32 +01:00
<argument index= "2" name= "transition" type= "AnimationNodeStateMachineTransition" />
<description >
2023-12-21 00:48:25 +01:00
Adds a transition between the given nodes.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "get_end_node" qualifiers= "const" >
<return type= "String" />
<description >
Returns the graph's end node.
</description>
</method>
<method name= "get_graph_offset" qualifiers= "const" >
<return type= "Vector2" />
<description >
Returns the draw offset of the graph. Used for display in the editor.
</description>
</method>
<method name= "get_node" qualifiers= "const" >
<return type= "AnimationNode" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "name" type= "StringName" />
2022-03-15 13:29:32 +01:00
<description >
2023-12-21 00:48:25 +01:00
Returns the animation node with the given name.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "get_node_name" qualifiers= "const" >
2022-03-24 01:22:45 +01:00
<return type= "StringName" />
2022-03-15 13:29:32 +01:00
<argument index= "0" name= "node" type= "AnimationNode" />
<description >
Returns the given animation node's name.
</description>
</method>
<method name= "get_node_position" qualifiers= "const" >
<return type= "Vector2" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "name" type= "StringName" />
2022-03-15 13:29:32 +01:00
<description >
2023-12-21 00:48:25 +01:00
Returns the given node's coordinates. Used for display in the editor.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "get_start_node" qualifiers= "const" >
<return type= "String" />
<description >
Returns the graph's end node.
</description>
</method>
<method name= "get_transition" qualifiers= "const" >
<return type= "AnimationNodeStateMachineTransition" />
<argument index= "0" name= "idx" type= "int" />
<description >
Returns the given transition.
</description>
</method>
<method name= "get_transition_count" qualifiers= "const" >
<return type= "int" />
<description >
Returns the number of connections in the graph.
</description>
</method>
<method name= "get_transition_from" qualifiers= "const" >
2022-03-24 01:22:45 +01:00
<return type= "StringName" />
2022-03-15 13:29:32 +01:00
<argument index= "0" name= "idx" type= "int" />
<description >
Returns the given transition's start node.
</description>
</method>
<method name= "get_transition_to" qualifiers= "const" >
2022-03-24 01:22:45 +01:00
<return type= "StringName" />
2022-03-15 13:29:32 +01:00
<argument index= "0" name= "idx" type= "int" />
<description >
Returns the given transition's end node.
</description>
</method>
<method name= "has_node" qualifiers= "const" >
<return type= "bool" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "name" type= "StringName" />
2022-03-15 13:29:32 +01:00
<description >
2023-12-21 00:48:25 +01:00
Returns [code]true[/code] if the graph contains the given node.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "has_transition" qualifiers= "const" >
<return type= "bool" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "from" type= "StringName" />
<argument index= "1" name= "to" type= "StringName" />
2022-03-15 13:29:32 +01:00
<description >
2023-12-21 00:48:25 +01:00
Returns [code]true[/code] if there is a transition between the given nodes.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "remove_node" >
<return type= "void" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "name" type= "StringName" />
2022-03-15 13:29:32 +01:00
<description >
2023-12-21 00:48:25 +01:00
Deletes the given node from the graph.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "remove_transition" >
<return type= "void" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "from" type= "StringName" />
<argument index= "1" name= "to" type= "StringName" />
2022-03-15 13:29:32 +01:00
<description >
2023-12-21 00:48:25 +01:00
Deletes the transition between the two specified nodes.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "remove_transition_by_index" >
<return type= "void" />
<argument index= "0" name= "idx" type= "int" />
<description >
Deletes the given transition by index.
</description>
</method>
<method name= "rename_node" >
<return type= "void" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "name" type= "StringName" />
<argument index= "1" name= "new_name" type= "StringName" />
2022-03-15 13:29:32 +01:00
<description >
2023-12-21 00:48:25 +01:00
Renames the given node.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "replace_node" >
<return type= "void" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "name" type= "StringName" />
2022-03-15 13:29:32 +01:00
<argument index= "1" name= "node" type= "AnimationNode" />
<description >
2023-12-21 00:48:25 +01:00
Replaces the node and keeps its transitions unchanged.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "set_end_node" >
<return type= "void" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "name" type= "StringName" />
2022-03-15 13:29:32 +01:00
<description >
2023-12-21 00:48:25 +01:00
Sets the given node as the graph end point.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "set_graph_offset" >
<return type= "void" />
<argument index= "0" name= "offset" type= "Vector2" />
<description >
Sets the draw offset of the graph. Used for display in the editor.
</description>
</method>
<method name= "set_node_position" >
<return type= "void" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "name" type= "StringName" />
2022-03-15 13:29:32 +01:00
<argument index= "1" name= "position" type= "Vector2" />
<description >
2023-12-21 00:48:25 +01:00
Sets the node's coordinates. Used for display in the editor.
2022-03-15 13:29:32 +01:00
</description>
</method>
<method name= "set_start_node" >
<return type= "void" />
2022-03-24 01:22:45 +01:00
<argument index= "0" name= "name" type= "StringName" />
2022-03-15 13:29:32 +01:00
<description >
2023-12-21 00:48:25 +01:00
Sets the given node as the graph start point.
2022-03-15 13:29:32 +01:00
</description>
</method>
</methods>
<constants >
</constants>
</class>