Struct AnimationNodeStateMachine

State machine for control of animations.

struct AnimationNodeStateMachine ;

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. Example:

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

Methods

NameDescription
_treeChanged
addNode Adds a new node to the graph. The position is used for display in the editor.
addTransition Adds a transition between the given nodes.
getEndNode Returns the graph's end node.
getGraphOffset Returns the draw offset of the graph. Used for display in the editor.
getNode Returns the animation node with the given name.
getNodeName Returns the given animation node's name.
getNodePosition Returns the given node's coordinates. Used for display in the editor.
getStartNode Returns the graph's end node.
getTransition Returns the given transition.
getTransitionCount Returns the number of connections in the graph.
getTransitionFrom Returns the given transition's start node.
getTransitionTo Returns the given transition's end node.
hasNode Returns true if the graph contains the given node.
hasTransition Returns true if there is a transition between the given nodes.
removeNode Deletes the given node from the graph.
removeTransition Deletes the transition between the two specified nodes.
removeTransitionByIndex Deletes the given transition by index.
renameNode Renames the given node.
setEndNode Sets the given node as the graph end point.
setGraphOffset Sets the draw offset of the graph. Used for display in the editor.
setNodePosition Sets the node's coordinates. Used for display in the editor.
setStartNode Sets the given node as the graph start point.