:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/AnimationNode.xml. .. _class_AnimationNode: AnimationNode ============= **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Inherited By:** :ref:`AnimationNodeAdd2`, :ref:`AnimationNodeAdd3`, :ref:`AnimationNodeBlend2`, :ref:`AnimationNodeBlend3`, :ref:`AnimationNodeOneShot`, :ref:`AnimationNodeOutput`, :ref:`AnimationNodeTimeScale`, :ref:`AnimationNodeTimeSeek`, :ref:`AnimationNodeTransition`, :ref:`AnimationRootNode` Base resource for :ref:`AnimationTree` nodes. .. rst-class:: classref-introduction-group Description ----------- Base resource for :ref:`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 :ref:`AnimationNodeBlendTree`, otherwise :ref:`AnimationRootNode` should be used instead. .. rst-class:: classref-introduction-group Tutorials --------- - :doc:`../tutorials/animation/animation_tree` .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------+--------------------------------------------------------------------+ | :ref:`bool` | :ref:`filter_enabled` | +-------------------------+--------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_input` **(** :ref:`String` name **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`blend_animation` **(** :ref:`String` animation, :ref:`float` time, :ref:`float` delta, :ref:`bool` seeked, :ref:`float` blend **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`blend_input` **(** :ref:`int` input_index, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`blend_node` **(** :ref:`String` name, :ref:`AnimationNode` node, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_caption` **(** **)** |virtual| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_child_by_name` **(** :ref:`String` name **)** |virtual| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`get_child_nodes` **(** **)** |virtual| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_input_count` **(** **)** |const| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_input_name` **(** :ref:`int` input **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_parameter` **(** :ref:`String` name **)** |const| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_parameter_default_value` **(** :ref:`String` name **)** |virtual| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_parameter_list` **(** **)** |virtual| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_filter` **(** **)** |virtual| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_path_filtered` **(** :ref:`NodePath` path **)** |const| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`process` **(** :ref:`float` time, :ref:`bool` seek **)** |virtual| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_input` **(** :ref:`int` index **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_filter_path` **(** :ref:`NodePath` path, :ref:`bool` enable **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_parameter` **(** :ref:`String` name, :ref:`Variant` value **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_AnimationNode_signal_removed_from_graph: .. rst-class:: classref-signal **removed_from_graph** **(** **)** Emitted when the node was removed from the graph. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_signal_tree_changed: .. rst-class:: classref-signal **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 :ref:`AnimationNodeBlendSpace1D`, :ref:`AnimationNodeBlendSpace2D`, :ref:`AnimationNodeStateMachine`, and :ref:`AnimationNodeBlendTree`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_AnimationNode_FilterAction: .. rst-class:: classref-enumeration enum **FilterAction**: .. _class_AnimationNode_constant_FILTER_IGNORE: .. rst-class:: classref-enumeration-constant :ref:`FilterAction` **FILTER_IGNORE** = ``0`` Do not use filtering. .. _class_AnimationNode_constant_FILTER_PASS: .. rst-class:: classref-enumeration-constant :ref:`FilterAction` **FILTER_PASS** = ``1`` Paths matching the filter will be allowed to pass. .. _class_AnimationNode_constant_FILTER_STOP: .. rst-class:: classref-enumeration-constant :ref:`FilterAction` **FILTER_STOP** = ``2`` Paths matching the filter will be discarded. .. _class_AnimationNode_constant_FILTER_BLEND: .. rst-class:: classref-enumeration-constant :ref:`FilterAction` **FILTER_BLEND** = ``3`` Paths matching the filter will be blended (by the blend value). .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_AnimationNode_property_filter_enabled: .. rst-class:: classref-property :ref:`bool` **filter_enabled** .. rst-class:: classref-property-setget - void **set_filter_enabled** **(** :ref:`bool` value **)** - :ref:`bool` **is_filter_enabled** **(** **)** If ``true``, filtering is enabled. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_AnimationNode_method_add_input: .. rst-class:: classref-method void **add_input** **(** :ref:`String` name **)** Adds an input to the node. This is only useful for nodes created for use in an :ref:`AnimationNodeBlendTree`. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_blend_animation: .. rst-class:: classref-method void **blend_animation** **(** :ref:`String` animation, :ref:`float` time, :ref:`float` delta, :ref:`bool` seeked, :ref:`float` blend **)** Blend an animation by ``blend`` amount (name must be valid in the linked :ref:`AnimationPlayer`). A ``time`` and ``delta`` may be passed, as well as whether ``seek`` happened. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_blend_input: .. rst-class:: classref-method :ref:`float` **blend_input** **(** :ref:`int` input_index, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** Blend an input. This is only useful for nodes created for an :ref:`AnimationNodeBlendTree`. 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 :ref:`FilterAction` for options). .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_blend_node: .. rst-class:: classref-method :ref:`float` **blend_node** **(** :ref:`String` name, :ref:`AnimationNode` node, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from :ref:`AnimationRootNode` instead, else editors will not display your node for addition. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_get_caption: .. rst-class:: classref-method :ref:`String` **get_caption** **(** **)** |virtual| When inheriting from :ref:`AnimationRootNode`, implement this virtual method to override the text caption for this node. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_get_child_by_name: .. rst-class:: classref-method :ref:`Object` **get_child_by_name** **(** :ref:`String` name **)** |virtual| When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return a child node by its ``name``. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_get_child_nodes: .. rst-class:: classref-method :ref:`Dictionary` **get_child_nodes** **(** **)** |virtual| When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return all children nodes in order as a ``name: node`` dictionary. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_get_input_count: .. rst-class:: classref-method :ref:`int` **get_input_count** **(** **)** |const| Amount of inputs in this node, only useful for nodes that go into :ref:`AnimationNodeBlendTree`. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_get_input_name: .. rst-class:: classref-method :ref:`String` **get_input_name** **(** :ref:`int` input **)** Gets the name of an input by index. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_get_parameter: .. rst-class:: classref-method :ref:`Variant` **get_parameter** **(** :ref:`String` 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. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_get_parameter_default_value: .. rst-class:: classref-method :ref:`Variant` **get_parameter_default_value** **(** :ref:`String` name **)** |virtual| When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return the default value of parameter "``name``". Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_get_parameter_list: .. rst-class:: classref-method :ref:`Array` **get_parameter_list** **(** **)** |virtual| When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return a list of the properties on this node. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to :ref:`Object.get_property_list`. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_has_filter: .. rst-class:: classref-method :ref:`bool` **has_filter** **(** **)** |virtual| When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return whether the blend tree editor should display filter editing on this node. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_is_path_filtered: .. rst-class:: classref-method :ref:`bool` **is_path_filtered** **(** :ref:`NodePath` path **)** |const| Returns whether the given path is filtered. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_process: .. rst-class:: classref-method void **process** **(** :ref:`float` time, :ref:`bool` seek **)** |virtual| When inheriting from :ref:`AnimationRootNode`, implement this virtual method to run some code when this node is processed. The ``time`` parameter is a relative delta, unless ``seek`` is ``true``, in which case it is absolute. Here, call the :ref:`blend_input`, :ref:`blend_node` or :ref:`blend_animation` functions. You can also use :ref:`get_parameter` and :ref:`set_parameter` 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). .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_remove_input: .. rst-class:: classref-method void **remove_input** **(** :ref:`int` index **)** Removes an input, call this only when inactive. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_set_filter_path: .. rst-class:: classref-method void **set_filter_path** **(** :ref:`NodePath` path, :ref:`bool` enable **)** Adds or removes a path for the filter. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_set_parameter: .. rst-class:: classref-method void **set_parameter** **(** :ref:`String` name, :ref:`Variant` value **)** Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`