BlendSpace2D

from acron.anim import BlendSpace2D
class BlendSpace2D(points, triangles=None)

Bases: object

Godot’s AnimationNodeBlendSpace2D, in its INTERPOLATED blend mode.

points is [(anim_name, (x, y)), ...] – the blend points as the .tscn authors them. Godot triangulates them (Delaunay, unless the scene stores its own triangles) and blends the three corners of the triangle the sample lands in, by barycentric weight; a sample outside the hull falls back to the two ends of the nearest edge. Every other point gets exactly 0.

This used to be inverse-distance-squared over every point, which is a different function in one way that matters: no point is ever off. On the TPS player’s walk space – Idle (0,0), running_nogun (1,0), running_gun (1,1), Idlecombat (0,1), sampled along y = 0, which is the only line player.gd ever samples – it leaked 17 % of the two COMBAT clips into a plain walk: the character walked with the gun half raised, and two clips Godot never plays sat in the blend.

Inheritance diagram

digraph inheritance5460d4ecaf { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "BlendSpace2D" [URL="acron.anim.BlendSpace2D.html#acron.anim.BlendSpace2D",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 ``AnimationNodeBlendSpace2D``, in its INTERPOLATED blend mode."]; }