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"]

Tutoriales

Propiedades

bool

abort_on_reset

false

bool

autorestart

false

float

autorestart_delay

1.0

float

autorestart_random_delay

0.0

bool

break_loop_at_end

false

Curve

fadein_curve

float

fadein_time

0.0

Curve

fadeout_curve

float

fadeout_time

0.0

MixMode

mix_mode

0


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

bool abort_on_reset = false 🔗

  • void set_abort_on_reset(value: bool)

  • bool is_aborted_on_reset()

If true, the sub-animation will abort if resumed with a reset after a prior interruption.


bool autorestart = false 🔗

  • void set_autorestart(value: bool)

  • bool has_autorestart()

Si es true, la subanimación se reiniciará automáticamente al finalizar.

En otras palabras, para iniciar el reinicio automático, la animación debe reproducirse una vez con la petición ONE_SHOT_REQUEST_FIRE. La petición ONE_SHOT_REQUEST_ABORT detendrá el reinicio automático, pero no deshabilitará a autorestart en sí. Así que la solicitud ONE_SHOT_REQUEST_FIRE iniciará de nuevo el reinicio automático.


float autorestart_delay = 1.0 🔗

  • void set_autorestart_delay(value: float)

  • float get_autorestart_delay()

El retardo con el cual un reinicio automatico es lanzado, en segundos.


float autorestart_random_delay = 0.0 🔗

  • void set_autorestart_random_delay(value: float)

  • float get_autorestart_random_delay()

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 🔗

  • void set_break_loop_at_end(value: bool)

  • bool is_loop_broken_at_end()

Si es true, interrumpe el bucle al final del ciclo de bucle para la transición, incluso si la animación está en bucle.


Curve fadein_curve 🔗

  • void set_fadein_curve(value: Curve)

  • Curve get_fadein_curve()

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.


float fadein_time = 0.0 🔗

  • void set_fadein_time(value: float)

  • float get_fadein_time()

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.


Curve fadeout_curve 🔗

  • void set_fadeout_curve(value: Curve)

  • Curve get_fadeout_curve()

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.


float fadeout_time = 0.0 🔗

  • void set_fadeout_time(value: float)

  • float get_fadeout_time()

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.


MixMode mix_mode = 0 🔗

El tipo de mezcla.