AnimationNodeStateMachine

State machine for control of animations.

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:

More...

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_treeChanged
void _treeChanged()
addNode
void addNode(String name, AnimationNode node, Vector2 position)

Adds a new node to the graph. The position is used for display in the editor.

addTransition
void addTransition(String from, String to, AnimationNodeStateMachineTransition transition)

Adds a transition between the given nodes.

getEndNode
String getEndNode()

Returns the graph's end node.

getGraphOffset
Vector2 getGraphOffset()

Returns the draw offset of the graph. Used for display in the editor.

getNode
Ref!AnimationNode getNode(String name)

Returns the animation node with the given name.

getNodeName
String getNodeName(AnimationNode node)

Returns the given animation node's name.

getNodePosition
Vector2 getNodePosition(String name)

Returns the given node's coordinates. Used for display in the editor.

getStartNode
String getStartNode()

Returns the graph's end node.

getTransition
Ref!AnimationNodeStateMachineTransition getTransition(long idx)

Returns the given transition.

getTransitionCount
long getTransitionCount()

Returns the number of connections in the graph.

getTransitionFrom
String getTransitionFrom(long idx)

Returns the given transition's start node.

getTransitionTo
String getTransitionTo(long idx)

Returns the given transition's end node.

hasNode
bool hasNode(String name)

Returns true if the graph contains the given node.

hasTransition
bool hasTransition(String from, String to)

Returns true if there is a transition between the given nodes.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(AnimationNodeStateMachine other)
opEquals
bool opEquals(typeof(null) n)
removeNode
void removeNode(String name)

Deletes the given node from the graph.

removeTransition
void removeTransition(String from, String to)

Deletes the transition between the two specified nodes.

removeTransitionByIndex
void removeTransitionByIndex(long idx)

Deletes the given transition by index.

renameNode
void renameNode(String name, String new_name)

Renames the given node.

replaceNode
void replaceNode(String name, AnimationNode node)

Replaces the node and keeps its transitions unchanged.

setEndNode
void setEndNode(String name)

Sets the given node as the graph end point.

setGraphOffset
void setGraphOffset(Vector2 offset)

Sets the draw offset of the graph. Used for display in the editor.

setNodePosition
void setNodePosition(String name, Vector2 position)

Sets the node's coordinates. Used for display in the editor.

setStartNode
void setStartNode(String name)

Sets the given node as the graph start point.

toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Static functions

_new
AnimationNodeStateMachine _new()

Construct a new instance of AnimationNodeStateMachine. Note: use memnew!AnimationNodeStateMachine instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Detailed Description

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

Meta