OneShot¶
from acron.anim import OneShot
- class OneShot(anim, length: float, fadein: float = 0.0, fadeout: float = 0.0)¶
Bases:
objectGodot’s
AnimationNodeOneShot: one clip faded over a base blend.A one-shot is a layer, not a state: it takes whatever the rest of the tree is doing as its base, fades a single clip in over it on
request, and fades back out at the end – so a robot that is hit keeps walking underneath the flinch.mix_modeis left at its default,MIX_MODE_BLEND, which is a plain lerp from base to shot: the same operation a filteredBlend2performs, so it goes throughlayered().The fades can overlap, and what happens then is the one place this and Godot differ. Godot’s node runs its fade-IN first and only then asks whether it should be fading out, so on a clip shorter than the two fades together the weight steps down in one frame (measured on the TPS player’s 0.433 s hard-landing clip against two 0.25 s fades: 1.0 to 0.73). This takes the smaller of the two ramps instead, so the shot rises as far as the clip allows and comes back down without the step. Where the fades do not overlap the two agree exactly.
Inheritance diagram
digraph inheritance455ceace88 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "OneShot" [URL="acron.anim.OneShot.html#acron.anim.OneShot",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Godot's ``AnimationNodeOneShot``: one clip faded over a base blend."]; }