AnimationNode

    Inherited By: AnimationNodeAdd2, , AnimationNodeBlend2, , AnimationNodeOneShot, , AnimationNodeTimeScale, , AnimationNodeTransition,

    Base resource for AnimationTree nodes.

    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 , otherwise AnimationRootNode should be used instead.

    Tutorials

    Methods

    • removed_from_graph ( )

    Emitted when the node was removed from the graph.


    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, , AnimationNodeStateMachine, and .

    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).

    • bool filter_enabled

    If , filtering is enabled.

    Method Descriptions

    • void add_input ( String name )

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


    • void blend_animation ( String animation, time, float delta, seeked, float blend )

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


    • float blend_input ( input_index, float time, seek, float blend, filter=0, bool optimize=true )

    Blend an input. This is only useful for nodes created for an . The time parameter is a relative delta, unless seek is true, in which case it is absolute. A filter mode may be optionally passed (see FilterAction for options).


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


    • String get_caption ( ) virtual

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


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


    Gets all children nodes in order as a dictionary. Only useful when inheriting .


    • int get_input_count ( ) const

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


    • String get_input_name ( input )

    Gets the name of an input by index.


    • Variant get_parameter ( name ) const

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


    • Variant get_parameter_default_value ( name ) virtual

    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.


    • Array get_parameter_list ( ) virtual

    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 .


    • String has_filter ( ) virtual

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


    • is_path_filtered ( NodePath path ) const

    Returns whether the given path is filtered.


    • void process ( time, bool seek ) virtual

    User-defined callback called when a custom node is processed. The time parameter is a relative delta, unless seek is , in which case it is absolute.

    Here, call the , blend_node or functions. You can also use get_parameter and to modify local memory.

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


    • void remove_input ( int index )

    Removes an input, call this only when inactive.


    Adds or removes a path for the filter.


    • void set_parameter ( name, Variant value )

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