AnimationNodeOneShot
Hereda: AnimationNodeSync < AnimationNode < Resource < RefCounted < Object
Reproduce una animación una vez en un AnimationNodeBlendTree.
Descripción
A resource to add to an AnimationNodeBlendTree. This animation node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.
After setting the request and changing the animation playback, the one-shot node automatically clears the request on the next process frame by setting its request value to ONE_SHOT_REQUEST_NONE.
# Play child animation connected to "shot" port.
animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE)
# Alternative syntax (same result as above).
animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE
# Abort child animation connected to "shot" port.
animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT)
# Alternative syntax (same result as above).
animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT
# Abort child animation with fading out connected to "shot" port.
animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT)
# Alternative syntax (same result as above).
animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT
# Get current state (read-only).
animation_tree.get("parameters/OneShot/active")
# Alternative syntax (same result as above).
animation_tree["parameters/OneShot/active"]
# Get current internal state (read-only).
animation_tree.get("parameters/OneShot/internal_active")
# Alternative syntax (same result as above).
animation_tree["parameters/OneShot/internal_active"]
// Play child animation connected to "shot" port.
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Fire);
// Abort child animation connected to "shot" port.
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Abort);
// Abort child animation with fading out connected to "shot" port.
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.FadeOut);
// Get current state (read-only).
animationTree.Get("parameters/OneShot/active");
// Get current internal state (read-only).
animationTree.Get("parameters/OneShot/internal_active");
Tutoriales
Propiedades
|
||
|
||
|
||
|
||
|
||
|
||
|
Enumeraciones
enum OneShotRequest: 🔗
OneShotRequest ONE_SHOT_REQUEST_NONE = 0
El estado predeterminado de la petición. No se hace nada.
OneShotRequest ONE_SHOT_REQUEST_FIRE = 1
La petición para reproducir la animación conectada al puerto "shot".
OneShotRequest ONE_SHOT_REQUEST_ABORT = 2
La petición para detener la animación conectada al puerto "shot".
OneShotRequest ONE_SHOT_REQUEST_FADE_OUT = 3
La petición para aplicar un fundido de salida a la animación conectada al puerto "shot".
enum MixMode: 🔗
MixMode MIX_MODE_BLEND = 0
Combina dos animaciones. Véase también AnimationNodeBlend2.
MixMode MIX_MODE_ADD = 1
Combina dos animaciones de forma aditiva. Véase también AnimationNodeAdd2.
Descripciones de Propiedades
If true, the sub-animation will restart automatically after finishing.
In other words, to start auto restarting, the animation must be played once with the ONE_SHOT_REQUEST_FIRE request. The ONE_SHOT_REQUEST_ABORT request stops the auto restarting, but it does not disable the autorestart itself. So, the ONE_SHOT_REQUEST_FIRE request will start auto restarting again.
float autorestart_delay = 1.0 🔗
El retardo con el cual un reinicio automatico es lanzado, en segundos.
float autorestart_random_delay = 0.0 🔗
Si autorestart es true, un retardo aleatorio adicional (en segundos) entre 0 y este valor sera añadido al [member autorestart_delay.
bool break_loop_at_end = false 🔗
Si es true, interrumpe el bucle al final del ciclo de bucle para la transición, incluso si la animación está en bucle.
Determina cómo se suaviza el fundido cruzado (cross-fading) entre animaciones. Si está vacío, la transición será lineal. Debe ser una Curve unitaria.
La duración del fundido de entrada (fade-in). Por ejemplo, si se establece en 1.0 para una animación de 5 segundos de duración, se producirá un fundido cruzado que comienza en el segundo 0 y termina en el segundo 1 durante la animación.
Nota: AnimationNodeOneShot transiciona el estado actual después de que el fundido haya finalizado.
Determina cómo se suaviza el fundido cruzado (cross-fading) entre animaciones. Si está vacío, la transición será lineal. Debe ser una Curve unitaria.
La duración del fundido de salida (fade-out). Por ejemplo, si se establece en 1.0 para una animación de 5 segundos de duración, se producirá un fundido cruzado que comienza en el segundo 4 y termina en el segundo 5 durante la animación.
Nota: AnimationNodeOneShot transiciona el estado actual después de que el fundido haya finalizado.
El tipo de mezcla.