simvx.core.animation.blend_space¶
Blend spaces for multi-clip animation blending.
Module Contents¶
Classes¶
Blends between animation clips along a single parameter axis. |
|
Blends between animation clips positioned in 2D parameter space. |
API¶
- class simvx.core.animation.blend_space.BlendSpace1D[source]¶
Blends between animation clips along a single parameter axis.
Each clip is placed at a numeric position on the axis. When the parameter is set, the two nearest clips are blended proportionally.
Example: bs = BlendSpace1D() bs.add_point(idle_clip, 0.0) bs.add_point(walk_clip, 0.5) bs.add_point(run_clip, 1.0)
bs.set_parameter(0.75) # blend walk+run value = bs.sample("speed", 0.5) # sample at t=0.5 in blended clipsInitialization
- add_point(clip: simvx.core.animation.track.AnimationClip, position: float) None[source]¶
Register a clip at a position on the blend axis.
- property parameter: float¶
- class simvx.core.animation.blend_space.BlendSpace2D[source]¶
Blends between animation clips positioned in 2D parameter space.
Uses inverse-distance weighted interpolation across all points for robustness (falls back to exact match when the parameter lands directly on a point).
Example: bs = BlendSpace2D() bs.add_point(idle_clip, (0.0, 0.0)) bs.add_point(walk_fwd_clip, (0.0, 1.0)) bs.add_point(strafe_r_clip, (1.0, 0.0))
bs.set_parameter(0.5, 0.5) value = bs.sample("position", 0.5)Initialization
- add_point(clip: simvx.core.animation.track.AnimationClip, position: tuple[float, float]) None[source]¶
Register a clip at a 2D position.