AnimationNode

Hereda: Resource < RefCounted < Object

Heredado por: AnimationNodeExtension, AnimationNodeOutput, AnimationNodeSync, AnimationNodeTimeScale, AnimationNodeTimeSeek, AnimationRootNode

Clase base para los nodos AnimationTree. No está relacionado con los nodos de escena.

Descripción

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 animation nodes mainly for use in AnimationNodeBlendTree, otherwise 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 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"]

Tutoriales

Propiedades

bool

filter_enabled

Métodos

String

_get_caption() virtual const

AnimationNode

_get_child_by_name(name: StringName) virtual const

Dictionary

_get_child_nodes() virtual const

Variant

_get_parameter_default_value(parameter: StringName) virtual const

Array

_get_parameter_list() virtual const

bool

_has_filter() virtual const

bool

_is_parameter_read_only(parameter: StringName) virtual const

float

_process(time: float, seek: bool, is_external_seeking: bool, test_only: bool) virtual

bool

add_input(name: String)

void

blend_animation(animation: StringName, time: float, delta: float, seeked: bool, is_external_seeking: bool, blend: float, looped_flag: LoopedFlag = 0)

float

blend_input(input_index: int, time: float, seek: bool, is_external_seeking: bool, blend: float, filter: FilterAction = 0, sync: bool = true, test_only: bool = false)

float

blend_node(name: StringName, node: AnimationNode, time: float, seek: bool, is_external_seeking: bool, blend: float, filter: FilterAction = 0, sync: bool = true, test_only: bool = false)

int

find_input(name: String) const

int

get_input_count() const

String

get_input_name(input: int) const

Variant

get_parameter(name: StringName) const

int

get_processing_animation_tree_instance_id() const

bool

is_path_filtered(path: NodePath) const

bool

is_process_testing() const

void

remove_input(index: int)

void

set_filter_path(path: NodePath, enable: bool)

bool

set_input_name(input: int, name: String)

void

set_parameter(name: StringName, value: Variant)


Señales

animation_node_removed(object_id: int, name: String) 🔗

Emitida por los nodos que heredan de esta clase y que tienen un árbol interno cuando se elimina uno de sus nodos de animación. Los nodos de animación que emiten esta señal son AnimationNodeBlendSpace1D, AnimationNodeBlendSpace2D, AnimationNodeStateMachine y AnimationNodeBlendTree.


animation_node_renamed(object_id: int, old_name: String, new_name: String) 🔗

Emitida por los nodos que heredan de esta clase y que tienen un árbol interno cuando cambia el nombre de uno de sus nodos de animación. Los nodos de animación que emiten esta señal son AnimationNodeBlendSpace1D, AnimationNodeBlendSpace2D, AnimationNodeStateMachine y AnimationNodeBlendTree.


tree_changed() 🔗

Emitida por los nodos que heredan de esta clase y que tienen un árbol interno cuando uno de sus nodos de animación cambia. Los nodos de animación que emiten esta señal son AnimationNodeBlendSpace1D, AnimationNodeBlendSpace2D, AnimationNodeStateMachine, AnimationNodeBlendTree y AnimationNodeTransition.


Enumeraciones

enum FilterAction: 🔗

FilterAction FILTER_IGNORE = 0

No utilizar el filtrado.

FilterAction FILTER_PASS = 1

Las rutas que coincidan con el filtro podrán pasar.

FilterAction FILTER_STOP = 2

Las rutas que coincidan con el filtro serán descartados.

FilterAction FILTER_BLEND = 3

Los caminos que coincidan con el filtro se mezclarán (por el valor de mezcla).


Descripciones de Propiedades

bool filter_enabled 🔗

  • void set_filter_enabled(value: bool)

  • bool is_filter_enabled()

Si es true, el filtrado está activado.


Descripciones de Métodos

String _get_caption() virtual const 🔗

Al heredar de AnimationRootNode, implementa este método virtual para sobrescribir el título de texto para este nodo de animación.


AnimationNode _get_child_by_name(name: StringName) virtual const 🔗

Al heredar de AnimationRootNode, implementa este método virtual para devolver un nodo de animación hijo por su name.


Dictionary _get_child_nodes() virtual const 🔗

Al heredar de AnimationRootNode, implementa este método virtual para devolver todos los nodos de animación secundarios en orden como un diccionario name: node.


Variant _get_parameter_default_value(parameter: StringName) virtual const 🔗

Al heredar de AnimationRootNode, implementa este método virtual para devolver el valor predeterminado de un parameter. Los parámetros son memoria local personalizada utilizada para tus nodos de animación, dado que un recurso puede ser reutilizado en múltiples árboles.


Array _get_parameter_list() virtual const 🔗

Al heredar de AnimationRootNode, implementa este método virtual para devolver una lista de las propiedades de este nodo de animación. Los parámetros son memoria local personalizada utilizada para los nodos de animación; dado que un recurso puede reutilizarse en varios árboles, el formato es similar al de Object.get_property_list().


bool _has_filter() virtual const 🔗

Al heredar de AnimationRootNode, implementa este método virtual para determinar si el editor del árbol de mezcla debe mostrar la edición de filtro en este nodo de animación.


bool _is_parameter_read_only(parameter: StringName) virtual const 🔗

Al heredar de AnimationRootNode, implementa este método virtual para indicar si parameter es de solo lectura. Los parámetros son memoria local personalizada que se utiliza para los nodos de animación, dado que un recurso puede reutilizarse en varios árboles.


float _process(time: float, seek: bool, is_external_seeking: bool, test_only: bool) virtual 🔗

Obsoleto: 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 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 blend_input(), blend_node() or blend_animation() functions. You can also use get_parameter() and set_parameter() to modify local memory.

This function should return the delta.


bool add_input(name: String) 🔗

Añade una entrada al nodo de animación. Esto solo es útil para nodos de animación creados para usarse en un AnimationNodeBlendTree. Si la adición falla, devuelve false.


void blend_animation(animation: StringName, time: float, delta: float, seeked: bool, is_external_seeking: bool, blend: float, looped_flag: LoopedFlag = 0) 🔗

Blends an animation by blend amount (name must be valid in the linked 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.


float blend_input(input_index: int, time: float, seek: bool, is_external_seeking: bool, blend: float, filter: FilterAction = 0, sync: bool = true, test_only: bool = false) 🔗

Blends an input. This is only useful for animation nodes created for an 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.


float blend_node(name: StringName, node: AnimationNode, time: float, seek: bool, is_external_seeking: bool, blend: float, filter: FilterAction = 0, sync: bool = true, test_only: bool = false) 🔗

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


int find_input(name: String) const 🔗

Devuelve el índice de entrada que corresponde a name. Si no se encuentra, devuelve -1.


int get_input_count() const 🔗

Cantidad de entradas en este nodo de animación, solo útil para los nodos de animación que van a AnimationNodeBlendTree.


String get_input_name(input: int) const 🔗

Obtiene el nombre de una entrada por índice.


Variant get_parameter(name: StringName) const 🔗

Obtiene el valor de un parámetro. Los parámetros son memoria local personalizada que se utiliza para los nodos de animación. Dado que un recurso puede reutilizarse en varios árboles, se puede obtener un valor.


int get_processing_animation_tree_instance_id() const 🔗

Devuelve el ID de objeto del AnimationTree propietario de este nodo.

Nota: Este método solo debe llamarse desde dentro del método AnimationNodeExtension._process_animation_node() y, en caso contrario, devolverá un ID no válido.


bool is_path_filtered(path: NodePath) const 🔗

Devuelve true si la ruta dada es filtrada.


bool is_process_testing() const 🔗

Devuelve true si este nodo de animación se está procesando en modo de solo prueba.


void remove_input(index: int) 🔗

Elimina una entrada, llama a esto sólo cuando está inactivo.


void set_filter_path(path: NodePath, enable: bool) 🔗

Añade o elimina una ruta para el filtro.


bool set_input_name(input: int, name: String) 🔗

Establece el nombre de la entrada en el índice input especificado. Si la configuración falla, devuelve false.


void set_parameter(name: StringName, value: Variant) 🔗

Establece un parámetro personalizado. Estos se utilizan como memoria local, ya que los recursos se pueden reutilizar en el árbol o en las escenas.