AnimationNodeStateMachine

Inherits: AnimationRootNode < AnimationNode < Resource < Reference < Object State machine for control of animations.

Description

AnimationNodeStateMachinePlayback object from the AnimationTree node to control it programmatically. Example:

  1. var state_machine = $AnimationTree.get("parameters/playback")state_machine.travel("some_state")

Tutorials

  • Using AnimationTree

    Methods

    Method Descriptions

  • add_node ( String name, AnimationNode node, Vector2 position=Vector2( 0, 0 ) ) position is used for display in the editor.

  • add_transition ( String from, String to, AnimationNodeStateMachineTransition transition ) Adds a transition between the given nodes.

  • String get_end_node ( ) const Returns the graph’s end node.

  • Vector2 get_graph_offset ( ) const Returns the draw offset of the graph. Used for display in the editor.

  • AnimationNode get_node ( String name ) const Returns the animation node with the given name.

  • String get_node_name ( AnimationNode node ) const Returns the given animation node’s name.

  • Vector2 get_node_position ( String name ) const Returns the given node’s coordinates. Used for display in the editor.

  • String get_start_node ( ) const Returns the graph’s end node.

  • AnimationNodeStateMachineTransition get_transition ( int idx ) const Returns the given transition.

  • int get_transition_count ( ) const Returns the number of connections in the graph.

  • String get_transition_from ( int idx ) const Returns the given transition’s start node.

  • String get_transition_to ( int idx ) const Returns the given transition’s end node.

  • bool has_node ( String name ) const true if the graph contains the given node.

  • bool has_transition ( String from, String to ) const true if there is a transition between the given nodes.

  • remove_node ( String name ) Deletes the given node from the graph.

  • remove_transition ( String from, String to ) Deletes the transition between the two specified nodes.

  • remove_transition_by_index ( int idx ) Deletes the given transition by index.

  • rename_node ( String name, String new_name ) Renames the given node.

  • replace_node ( String name, AnimationNode node ) Replaces the node and keeps its transitions unchanged.

  • set_end_node ( String name ) Sets the given node as the graph end point.

  • set_graph_offset ( Vector2 offset ) Sets the draw offset of the graph. Used for display in the editor.

  • set_node_position ( String name, Vector2 position ) Sets the node’s coordinates. Used for display in the editor.

  • set_start_node ( String name ) Sets the given node as the graph start point.