AnimationNode

Inherits: Resource < Reference < Object

Inherited By: AnimationNodeAdd2, AnimationNodeAdd3, AnimationNodeBlend2, AnimationNodeBlend3, AnimationNodeOneShot, AnimationNodeOutput, AnimationNodeTimeScale, AnimationNodeTimeSeek, AnimationNodeTransition, AnimationRootNode

Category: Core

Brief Description

Base resource for AnimationTree nodes.

Properties

bool filter_enabled

Methods

void add_input ( String name )
void blend_animation ( String animation, float time, float delta, bool seeked, float blend )
float blend_input ( int input_index, float time, bool seek, float blend, FilterAction filter=0, bool optimize=true )
float blend_node ( String name, AnimationNode node, float time, bool seek, float blend, FilterAction filter=0, bool optimize=true )
String get_caption ( ) virtual
Object get_child_by_name ( String name ) virtual
Dictionary get_child_nodes ( ) virtual
int get_input_count ( ) const
String get_input_name ( int input )
Variant get_parameter ( String name ) const
Variant get_parameter_default_value ( String name ) virtual
Array get_parameter_list ( ) virtual
String has_filter ( ) virtual
bool is_path_filtered ( NodePath path ) const
void process ( float time, bool seek ) virtual
void remove_input ( int index )
void set_filter_path ( NodePath path, bool enable )
void set_parameter ( String name, Variant value )

Signals

  • removed_from_graph ( )

Called when the node was removed from the graph.


  • tree_changed ( )

Emitted by nodes that inherit from this class and that have an internal tree when one of their nodes changes. The nodes that emit this signal are AnimationNodeBlendSpace1D, AnimationNodeBlendSpace2D, AnimationNodeStateMachine, and AnimationNodeBlendTree.

Enumerations

enum FilterAction:

  • FILTER_IGNORE = 0 — Do not use filtering.
  • FILTER_PASS = 1 — Paths matching the filter will be allowed to pass.
  • FILTER_STOP = 2 — Paths matching the filter will be discarded.
  • FILTER_BLEND = 3 — Paths matching the filter will be blended (by the blend value).

Description

Base resource for AnimationTree nodes. In general it’s not used directly but you can create custom ones with custom blending formulas.

Inherit this when creating nodes mainly for use in AnimationNodeBlendTree, otherwise AnimationRootNode should be used instead.

Property Descriptions

  • bool filter_enabled
Setter set_filter_enabled(value)
Getter is_filter_enabled()

Returns whether filtering is enabled.

Method Descriptions

  • void add_input ( String name )

Add an input to the node. This is only useful for nodes created for use in an AnimationNodeBlendTree


Blend an animation by “blend” amount (name must be valid in the linked AnimationPlayer). A time and delta mas be passed, as well as whether seek happened.


Blend an input. This is only useful for nodes created for an AnimationNodeBlendTree. Time is a delta, unless “seek” is true, in which case it is absolute. A filter mode may be optionally passed.


Blend another animaiton node (in case this node contains children animation nodes). This function is only useful if you inherit from AnimationRootNode instead, else editors will not display your node for addition.


  • String get_caption ( ) virtual

Get the text caption for this node (used by some editors)


Get the a child node by index (used by editors inheriting from AnimationRootNode).


Get all children nodes, in order as a name:node dictionary. Only useful when inheriting AnimationRootNode.


  • int get_input_count ( ) const

Amount of inputs in this node, only useful for nodes that go into AnimationNodeBlendTree.


Get the name of an input by index.


Get the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.


Get the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.


  • Array get_parameter_list ( ) virtual

Get the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to Object.get_property_list.


  • String has_filter ( ) virtual

Returns true whether you want the blend tree editor to display filter editing on this node.


Returns true whether a given path is filtered.


  • void process ( float time, bool seek ) virtual

Called when a custom node is processed. The argument “time” is relative, unless “seek” is true (in which case it is absolute).

Here, call the blend_input, blend_node or blend_animation functions.

You can also use get_parameter and set_parameter to modify local memory.

This function returns the time left for the current animation to finish (if unsure, just pass the value from the main blend being called).


  • void remove_input ( int index )

Remove an input, call this only when inactive.


Add/Remove a path for the filter.


Set a custom parameter. These are used as local storage, because resources can be reused across the tree or scenes.