:github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the AnimationNode.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _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` **Category:** Core Brief Description ----------------- Base resource for :ref:`AnimationTree` nodes. Properties ---------- +-------------------------+--------------------------------------------------------------------+ | :ref:`bool` | :ref:`filter_enabled` | +-------------------------+--------------------------------------------------------------------+ Methods ------- +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 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:`String` | :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 **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- .. _class_AnimationNode_signal_removed_from_graph: - **removed_from_graph** **(** **)** Called when the node was removed from the graph. ---- .. _class_AnimationNode_signal_tree_changed: - **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`. Enumerations ------------ .. _enum_AnimationNode_FilterAction: .. _class_AnimationNode_constant_FILTER_IGNORE: .. _class_AnimationNode_constant_FILTER_PASS: .. _class_AnimationNode_constant_FILTER_STOP: .. _class_AnimationNode_constant_FILTER_BLEND: 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 :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. Property Descriptions --------------------- .. _class_AnimationNode_property_filter_enabled: - :ref:`bool` **filter_enabled** +----------+---------------------------+ | *Setter* | set_filter_enabled(value) | +----------+---------------------------+ | *Getter* | is_filter_enabled() | +----------+---------------------------+ Returns whether filtering is enabled. Method Descriptions ------------------- .. _class_AnimationNode_method_add_input: - void **add_input** **(** :ref:`String` name **)** Add an input to the node. This is only useful for nodes created for use in an :ref:`AnimationNodeBlendTree` ---- .. _class_AnimationNode_method_blend_animation: - 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 mas be passed, as well as whether seek happened. ---- .. _class_AnimationNode_method_blend_input: - :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`. Time is a delta, unless "seek" is ``true``, in which case it is absolute. A filter mode may be optionally passed. ---- .. _class_AnimationNode_method_blend_node: - :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 animaiton 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. ---- .. _class_AnimationNode_method_get_caption: - :ref:`String` **get_caption** **(** **)** virtual Get the text caption for this node (used by some editors) ---- .. _class_AnimationNode_method_get_child_by_name: - :ref:`Object` **get_child_by_name** **(** :ref:`String` name **)** virtual Get the a child node by index (used by editors inheriting from :ref:`AnimationRootNode`). ---- .. _class_AnimationNode_method_get_child_nodes: - :ref:`Dictionary` **get_child_nodes** **(** **)** virtual Get all children nodes, in order as a name:node dictionary. Only useful when inheriting :ref:`AnimationRootNode`. ---- .. _class_AnimationNode_method_get_input_count: - :ref:`int` **get_input_count** **(** **)** const Amount of inputs in this node, only useful for nodes that go into :ref:`AnimationNodeBlendTree`. ---- .. _class_AnimationNode_method_get_input_name: - :ref:`String` **get_input_name** **(** :ref:`int` input **)** Get the name of an input by index. ---- .. _class_AnimationNode_method_get_parameter: - :ref:`Variant` **get_parameter** **(** :ref:`String` name **)** const Get the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. ---- .. _class_AnimationNode_method_get_parameter_default_value: - :ref:`Variant` **get_parameter_default_value** **(** :ref:`String` name **)** virtual 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. ---- .. _class_AnimationNode_method_get_parameter_list: - :ref:`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 :ref:`Object.get_property_list`. ---- .. _class_AnimationNode_method_has_filter: - :ref:`String` **has_filter** **(** **)** virtual Returns ``true`` whether you want the blend tree editor to display filter editing on this node. ---- .. _class_AnimationNode_method_is_path_filtered: - :ref:`bool` **is_path_filtered** **(** :ref:`NodePath` path **)** const Returns ``true`` whether a given path is filtered. ---- .. _class_AnimationNode_method_process: - void **process** **(** :ref:`float` time, :ref:`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 :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 returns the time left for the current animation to finish (if unsure, just pass the value from the main blend being called). ---- .. _class_AnimationNode_method_remove_input: - void **remove_input** **(** :ref:`int` index **)** Remove an input, call this only when inactive. ---- .. _class_AnimationNode_method_set_filter_path: - void **set_filter_path** **(** :ref:`NodePath` path, :ref:`bool` enable **)** Add/Remove a path for the filter. ---- .. _class_AnimationNode_method_set_parameter: - void **set_parameter** **(** :ref:`String` name, :ref:`Variant` value **)** Set a custom parameter. These are used as local storage, because resources can be reused across the tree or scenes.