Base resource for AnimationTree nodes.
    public class AnimationNode : Resource

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.

Inheritance Chain

Derived Classes

Constructors

    public AnimationNode()

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.

Properties

    public bool FilterEnabled { get; set; }

Returns whether filtering is enabled.

    public Collections.Array Filters { get; set; }

Methods

    public void AddInput(string name)

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

    public void BlendAnimation(string animation, float time, float delta, bool seeked, float blend)

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.

    public float BlendInput(int inputIndex, float time, bool seek, float blend, FilterAction filter = FilterAction.Ignore, bool optimize = true)

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.

    public float BlendNode(string name, AnimationNode node, float time, bool seek, float blend, FilterAction filter = FilterAction.Ignore, bool optimize = true)

Blend another animation 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.

    public virtual string GetCaption()

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

    public virtual Object GetChildByName(string name)

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

    public virtual Dictionary GetChildNodes()

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

    public int GetInputCount()

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

    public string GetInputName(int input)

Gets the name of an input by index.

    public object GetParameter(string name)

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

    public virtual object GetParameterDefaultValue(string name)

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

    public virtual Godot.Collections.Array GetParameterList()

Gets 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.GetPropertyList().

    public virtual string HasFilter()

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

    [Obsolete("IsFilterEnabled is deprecated. Use the FilterEnabled property instead.")]
    public bool IsFilterEnabled()

Getter for FilterEnabled

    public bool IsPathFiltered(NodePath path)

Returns true whether a given path is filtered.

    public virtual void Process(float time, bool seek)

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 BlendInput(int, float, bool, float, Godot.AnimationNode.FilterAction, bool), BlendNode(string, Godot.AnimationNode, float, bool, float, Godot.AnimationNode.FilterAction, bool) or BlendAnimation(string, float, float, bool, float) functions.

You can also use GetParameter(string) and SetParameter(string, object) 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).

    public void RemoveInput(int index)

Removes an input, call this only when inactive.

    [Obsolete("SetFilterEnabled is deprecated. Use the FilterEnabled property instead.")]
    public void SetFilterEnabled(bool enable)

Setter for FilterEnabled

    public void SetFilterPath(NodePath path, bool enable)

Adds or removes a path for the filter.

    public void SetParameter(string name, object value)

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

Inner Types

FilterAction

Name Value Description
Ignore 0 Do not use filtering.
Pass 1 Paths matching the filter will be allowed to pass.
Stop 2 Paths matching the filter will be discarded.
Blend 3 Paths matching the filter will be blended (by the blend value).
Tags: