Class reference
AnimationNodeBlendTree
Inherits AnimationRootNode
A sub-tree of many type AnimationNodes used for complex animations. Used by AnimationTree.
Description
This animation node may contain a sub-tree of any other type animation nodes, such as AnimationNodeTransition, AnimationNodeBlend2, AnimationNodeBlend3, AnimationNodeOneShot, etc. This is one of the most commonly used animation node roots. An AnimationNodeOutput node named output is created by default.
Properties
Vector2 graph_offset = Vector2(0, 0)
Vector2 graph_offset = Vector2(0, 0)The global offset of all sub animation nodes.
Methods
void add_node(StringName name, AnimationNode node, Vector2 position = Vector2(0, 0))
StringName name, AnimationNode node, Vector2 position = Vector2(0, 0))Adds an AnimationNode at the given position. The name is used to identify the created sub animation node later.
void connect_node(StringName input_node, int input_index, StringName output_node)
StringName input_node, int input_index, StringName output_node)Connects the output of an AnimationNode as input for another AnimationNode, at the input port specified by input_index.
void disconnect_node(StringName input_node, int input_index)
StringName input_node, int input_index)Disconnects the animation node connected to the specified input.
AnimationNode get_node(StringName name) const
AnimationNode get_node(StringName name) constReturns the sub animation node with the specified name.
StringName[] get_node_list() const
Returns a list containing the names of all sub animation nodes in this blend tree.
Vector2 get_node_position(StringName name) const
Vector2 get_node_position(StringName name) constReturns the position of the sub animation node with the specified name.
bool has_node(StringName name) const
bool has_node(StringName name) constReturns true if a sub animation node with specified name exists.
void remove_node(StringName name)
StringName name)Removes a sub animation node.
void rename_node(StringName name, StringName new_name)
StringName name, StringName new_name)Changes the name of a sub animation node.
void set_node_position(StringName name, Vector2 position)
StringName name, Vector2 position)Modifies the position of a sub animation node.
Signals
node_changed(StringName node_name)
StringName node_name)Emitted when the input port information is changed.
Constants
CONNECTION_OK = 0
The connection was successful.
CONNECTION_ERROR_NO_INPUT = 1
The input node is null.
CONNECTION_ERROR_NO_INPUT_INDEX = 2
The specified input port is out of range.
CONNECTION_ERROR_NO_OUTPUT = 3
The output node is null.
CONNECTION_ERROR_SAME_NODE = 4
Input and output nodes are the same.
CONNECTION_ERROR_CONNECTION_EXISTS = 5
The specified connection already exists.