github_url: | hide |
---|
Inherits: :ref:`Resource<class_Resource>` < :ref:`Reference<class_Reference>` < :ref:`Object<class_Object>`
Inherited By: :ref:`AnimationNodeAdd2<class_AnimationNodeAdd2>`, :ref:`AnimationNodeAdd3<class_AnimationNodeAdd3>`, :ref:`AnimationNodeBlend2<class_AnimationNodeBlend2>`, :ref:`AnimationNodeBlend3<class_AnimationNodeBlend3>`, :ref:`AnimationNodeOneShot<class_AnimationNodeOneShot>`, :ref:`AnimationNodeOutput<class_AnimationNodeOutput>`, :ref:`AnimationNodeTimeScale<class_AnimationNodeTimeScale>`, :ref:`AnimationNodeTimeSeek<class_AnimationNodeTimeSeek>`, :ref:`AnimationNodeTransition<class_AnimationNodeTransition>`, :ref:`AnimationRootNode<class_AnimationRootNode>`
Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes.
Base resource for :ref:`AnimationTree<class_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<class_AnimationNodeBlendTree>`, otherwise :ref:`AnimationRootNode<class_AnimationRootNode>` should be used instead.
:ref:`bool<class_bool>` | :ref:`filter_enabled<class_AnimationNode_property_filter_enabled>` |
- 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 :ref:`AnimationNodeBlendSpace1D<class_AnimationNodeBlendSpace1D>`, :ref:`AnimationNodeBlendSpace2D<class_AnimationNodeBlendSpace2D>`, :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`, and :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
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).
- :ref:`bool<class_bool>` filter_enabled
Setter | set_filter_enabled(value) |
Getter | is_filter_enabled() |
If true
, filtering is enabled.
- void add_input ( :ref:`String<class_String>` name )
Adds an input to the node. This is only useful for nodes created for use in an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
- void blend_animation ( :ref:`StringName<class_StringName>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`float<class_float>` blend )
Blend an animation by blend
amount (name must be valid in the linked :ref:`AnimationPlayer<class_AnimationPlayer>`). A time
and delta
may be passed, as well as whether seek
happened.
- :ref:`float<class_float>` blend_input ( :ref:`int<class_int>` input_index, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true )
Blend an input. This is only useful for nodes created for an :ref:`AnimationNodeBlendTree<class_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<enum_AnimationNode_FilterAction>` for options).
- :ref:`float<class_float>` blend_node ( :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_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<class_AnimationRootNode>` instead, else editors will not display your node for addition.
- :ref:`String<class_String>` get_caption ( ) virtual
Gets the text caption for this node (used by some editors).
- :ref:`Object<class_Object>` get_child_by_name ( :ref:`String<class_String>` name ) virtual
Gets a child node by index (used by editors inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`).
- :ref:`Dictionary<class_Dictionary>` get_child_nodes ( ) virtual
Gets all children nodes in order as a name: node
dictionary. Only useful when inheriting :ref:`AnimationRootNode<class_AnimationRootNode>`.
- :ref:`int<class_int>` get_input_count ( ) const
Amount of inputs in this node, only useful for nodes that go into :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
- :ref:`String<class_String>` get_input_name ( :ref:`int<class_int>` input )
Gets the name of an input by index.
- :ref:`Variant<class_Variant>` get_parameter ( :ref:`StringName<class_StringName>` 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.
- :ref:`Variant<class_Variant>` get_parameter_default_value ( :ref:`StringName<class_StringName>` 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.
- :ref:`Array<class_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 :ref:`Object.get_property_list<class_Object_method_get_property_list>`.
- :ref:`bool<class_bool>` has_filter ( ) virtual
Returns true
whether you want the blend tree editor to display filter editing on this node.
- :ref:`bool<class_bool>` is_path_filtered ( :ref:`NodePath<class_NodePath>` path ) const
Returns true
whether a given path is filtered.
- void process ( :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek ) virtual
User-defined callback called when a custom 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<class_AnimationNode_method_blend_input>`, :ref:`blend_node<class_AnimationNode_method_blend_node>` or :ref:`blend_animation<class_AnimationNode_method_blend_animation>` functions. You can also use :ref:`get_parameter<class_AnimationNode_method_get_parameter>` and :ref:`set_parameter<class_AnimationNode_method_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).
- void remove_input ( :ref:`int<class_int>` index )
Removes an input, call this only when inactive.
- void set_filter_path ( :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable )
Adds or removes a path for the filter.
- void set_parameter ( :ref:`StringName<class_StringName>` name, :ref:`Variant<class_Variant>` value )
Sets a custom parameter. These are used as local storage, because resources can be reused across the tree or scenes.