:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/4.3/doc/classes/AnimationNode.xml. .. _class_AnimationNode: AnimationNode ============= **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`AnimationNodeOutput`, :ref:`AnimationNodeSync`, :ref:`AnimationNodeTimeScale`, :ref:`AnimationNodeTimeSeek`, :ref:`AnimationRootNode` Base class for :ref:`AnimationTree` nodes. Not related to scene 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 animation nodes mainly for use in :ref:`AnimationNodeBlendTree`, otherwise :ref:`AnimationRootNode` should be used instead. You can access the time information as read-only parameter which is processed and stored in the previous frame for all nodes except :ref:`AnimationNodeOutput`. \ **Note:** If multiple inputs exist in the **AnimationNode**, which time information takes precedence depends on the type of **AnimationNode**. :: var current_length = $AnimationTree[parameters/AnimationNodeName/current_length] var current_position = $AnimationTree[parameters/AnimationNodeName/current_position] var current_delta = $AnimationTree[parameters/AnimationNodeName/current_delta] .. rst-class:: classref-introduction-group Tutorials --------- - :doc:`Using AnimationTree <../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 +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`_get_caption`\ (\ ) |virtual| |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AnimationNode` | :ref:`_get_child_by_name`\ (\ name\: :ref:`StringName`\ ) |virtual| |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`_get_child_nodes`\ (\ ) |virtual| |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`_get_parameter_default_value`\ (\ parameter\: :ref:`StringName`\ ) |virtual| |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`_get_parameter_list`\ (\ ) |virtual| |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_has_filter`\ (\ ) |virtual| |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_is_parameter_read_only`\ (\ parameter\: :ref:`StringName`\ ) |virtual| |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`_process`\ (\ time\: :ref:`float`, seek\: :ref:`bool`, is_external_seeking\: :ref:`bool`, test_only\: :ref:`bool`\ ) |virtual| |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`add_input`\ (\ name\: :ref:`String`\ ) | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`blend_animation`\ (\ animation\: :ref:`StringName`, time\: :ref:`float`, delta\: :ref:`float`, seeked\: :ref:`bool`, is_external_seeking\: :ref:`bool`, blend\: :ref:`float`, looped_flag\: :ref:`LoopedFlag` = 0\ ) | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`blend_input`\ (\ input_index\: :ref:`int`, time\: :ref:`float`, seek\: :ref:`bool`, is_external_seeking\: :ref:`bool`, blend\: :ref:`float`, filter\: :ref:`FilterAction` = 0, sync\: :ref:`bool` = true, test_only\: :ref:`bool` = false\ ) | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`blend_node`\ (\ name\: :ref:`StringName`, node\: :ref:`AnimationNode`, time\: :ref:`float`, seek\: :ref:`bool`, is_external_seeking\: :ref:`bool`, blend\: :ref:`float`, filter\: :ref:`FilterAction` = 0, sync\: :ref:`bool` = true, test_only\: :ref:`bool` = false\ ) | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`find_input`\ (\ name\: :ref:`String`\ ) |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_input_count`\ (\ ) |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_input_name`\ (\ input\: :ref:`int`\ ) |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_parameter`\ (\ name\: :ref:`StringName`\ ) |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_path_filtered`\ (\ path\: :ref:`NodePath`\ ) |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_input`\ (\ index\: :ref:`int`\ ) | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_filter_path`\ (\ path\: :ref:`NodePath`, enable\: :ref:`bool`\ ) | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`set_input_name`\ (\ input\: :ref:`int`, name\: :ref:`String`\ ) | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_parameter`\ (\ name\: :ref:`StringName`, value\: :ref:`Variant`\ ) | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_AnimationNode_signal_animation_node_removed: .. rst-class:: classref-signal **animation_node_removed**\ (\ object_id\: :ref:`int`, name\: :ref:`String`\ ) :ref:`🔗` Emitted by nodes that inherit from this class and that have an internal tree when one of their animation nodes removes. The animation nodes that emit this signal are :ref:`AnimationNodeBlendSpace1D`, :ref:`AnimationNodeBlendSpace2D`, :ref:`AnimationNodeStateMachine`, and :ref:`AnimationNodeBlendTree`. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_signal_animation_node_renamed: .. rst-class:: classref-signal **animation_node_renamed**\ (\ object_id\: :ref:`int`, old_name\: :ref:`String`, new_name\: :ref:`String`\ ) :ref:`🔗` Emitted by nodes that inherit from this class and that have an internal tree when one of their animation node names changes. The animation nodes that emit this signal are :ref:`AnimationNodeBlendSpace1D`, :ref:`AnimationNodeBlendSpace2D`, :ref:`AnimationNodeStateMachine`, and :ref:`AnimationNodeBlendTree`. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_signal_tree_changed: .. rst-class:: classref-signal **tree_changed**\ (\ ) :ref:`🔗` Emitted by nodes that inherit from this class and that have an internal tree when one of their animation nodes changes. The animation nodes that emit this signal are :ref:`AnimationNodeBlendSpace1D`, :ref:`AnimationNodeBlendSpace2D`, :ref:`AnimationNodeStateMachine`, :ref:`AnimationNodeBlendTree` and :ref:`AnimationNodeTransition`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_AnimationNode_FilterAction: .. rst-class:: classref-enumeration enum **FilterAction**: :ref:`🔗` .. _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** :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_filter_enabled**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_filter_enabled**\ (\ ) If ``true``, filtering is enabled. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_AnimationNode_private_method__get_caption: .. rst-class:: classref-method :ref:`String` **_get_caption**\ (\ ) |virtual| |const| :ref:`🔗` When inheriting from :ref:`AnimationRootNode`, implement this virtual method to override the text caption for this animation node. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_private_method__get_child_by_name: .. rst-class:: classref-method :ref:`AnimationNode` **_get_child_by_name**\ (\ name\: :ref:`StringName`\ ) |virtual| |const| :ref:`🔗` When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return a child animation node by its ``name``. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_private_method__get_child_nodes: .. rst-class:: classref-method :ref:`Dictionary` **_get_child_nodes**\ (\ ) |virtual| |const| :ref:`🔗` When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return all child animation nodes in order as a ``name: node`` dictionary. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_private_method__get_parameter_default_value: .. rst-class:: classref-method :ref:`Variant` **_get_parameter_default_value**\ (\ parameter\: :ref:`StringName`\ ) |virtual| |const| :ref:`🔗` When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return the default value of a ``parameter``. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_private_method__get_parameter_list: .. rst-class:: classref-method :ref:`Array` **_get_parameter_list**\ (\ ) |virtual| |const| :ref:`🔗` When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return a list of the properties on this animation node. Parameters are custom local memory used for your animation 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_private_method__has_filter: .. rst-class:: classref-method :ref:`bool` **_has_filter**\ (\ ) |virtual| |const| :ref:`🔗` When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return whether the blend tree editor should display filter editing on this animation node. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_private_method__is_parameter_read_only: .. rst-class:: classref-method :ref:`bool` **_is_parameter_read_only**\ (\ parameter\: :ref:`StringName`\ ) |virtual| |const| :ref:`🔗` When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return whether the ``parameter`` is read-only. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_private_method__process: .. rst-class:: classref-method :ref:`float` **_process**\ (\ time\: :ref:`float`, seek\: :ref:`bool`, is_external_seeking\: :ref:`bool`, test_only\: :ref:`bool`\ ) |virtual| |const| :ref:`🔗` **Deprecated:** Currently this is mostly useless as there is a lack of many APIs to extend AnimationNode by GDScript. It is planned that a more flexible API using structures will be provided in the future. When inheriting from :ref:`AnimationRootNode`, implement this virtual method to run some code when this animation 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 delta. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_add_input: .. rst-class:: classref-method :ref:`bool` **add_input**\ (\ name\: :ref:`String`\ ) :ref:`🔗` Adds an input to the animation node. This is only useful for animation nodes created for use in an :ref:`AnimationNodeBlendTree`. If the addition fails, returns ``false``. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_blend_animation: .. rst-class:: classref-method |void| **blend_animation**\ (\ animation\: :ref:`StringName`, time\: :ref:`float`, delta\: :ref:`float`, seeked\: :ref:`bool`, is_external_seeking\: :ref:`bool`, blend\: :ref:`float`, looped_flag\: :ref:`LoopedFlag` = 0\ ) :ref:`🔗` 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 ``seeked`` happened. A ``looped_flag`` is used by internal processing immediately after the loop. See also :ref:`LoopedFlag`. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_blend_input: .. rst-class:: classref-method :ref:`float` **blend_input**\ (\ input_index\: :ref:`int`, time\: :ref:`float`, seek\: :ref:`bool`, is_external_seeking\: :ref:`bool`, blend\: :ref:`float`, filter\: :ref:`FilterAction` = 0, sync\: :ref:`bool` = true, test_only\: :ref:`bool` = false\ ) :ref:`🔗` Blend an input. This is only useful for animation 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**\ (\ name\: :ref:`StringName`, node\: :ref:`AnimationNode`, time\: :ref:`float`, seek\: :ref:`bool`, is_external_seeking\: :ref:`bool`, blend\: :ref:`float`, filter\: :ref:`FilterAction` = 0, sync\: :ref:`bool` = true, test_only\: :ref:`bool` = false\ ) :ref:`🔗` Blend another animation node (in case this animation node contains child animation nodes). This function is only useful if you inherit from :ref:`AnimationRootNode` instead, otherwise editors will not display your animation node for addition. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_find_input: .. rst-class:: classref-method :ref:`int` **find_input**\ (\ name\: :ref:`String`\ ) |const| :ref:`🔗` Returns the input index which corresponds to ``name``. If not found, returns ``-1``. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_get_input_count: .. rst-class:: classref-method :ref:`int` **get_input_count**\ (\ ) |const| :ref:`🔗` Amount of inputs in this animation node, only useful for animation 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**\ (\ input\: :ref:`int`\ ) |const| :ref:`🔗` 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**\ (\ name\: :ref:`StringName`\ ) |const| :ref:`🔗` Gets the value of a parameter. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_is_path_filtered: .. rst-class:: classref-method :ref:`bool` **is_path_filtered**\ (\ path\: :ref:`NodePath`\ ) |const| :ref:`🔗` Returns whether the given path is filtered. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_remove_input: .. rst-class:: classref-method |void| **remove_input**\ (\ index\: :ref:`int`\ ) :ref:`🔗` 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**\ (\ path\: :ref:`NodePath`, enable\: :ref:`bool`\ ) :ref:`🔗` Adds or removes a path for the filter. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_set_input_name: .. rst-class:: classref-method :ref:`bool` **set_input_name**\ (\ input\: :ref:`int`, name\: :ref:`String`\ ) :ref:`🔗` Sets the name of the input at the given ``input`` index. If the setting fails, returns ``false``. .. rst-class:: classref-item-separator ---- .. _class_AnimationNode_method_set_parameter: .. rst-class:: classref-method |void| **set_parameter**\ (\ name\: :ref:`StringName`, value\: :ref:`Variant`\ ) :ref:`🔗` 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.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`