ludic.anim: animset_choice names the playing choice's clip as the set does, animset_can says whether the rig carries any of a state's clips (a one-shot with none is not asked for)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 20:19:05 +03:00
parent a22b8a572b
commit a87f20c66e
6 changed files with 35 additions and 3 deletions

View file

@ -20,10 +20,16 @@ export property AnimPlayer {
mix: float = 1.0
fade: float = 0.2
rate: float = 1.0
pick: int = -1 # which of the state's choices plays
}
export function animset_clip(pl: AnimPlayer) -> Clip { return pl.clip }
export function animset_time(pl: AnimPlayer) -> float { return pl.t }
export function animset_rate(pl: AnimPlayer) -> float { return pl.rate }
# the playing choice's clip as the set names it, without the rig ("sit_seat"); "" before a tick
export function animset_choice(pl: AnimPlayer) -> string {
if pl.set < 0 or pl.pick < 0 { return "" }
return AnimSets[pl.set].states[pl.state].choices[pl.pick].clip
}
export function animset_ready(pl: AnimPlayer) -> bool { return pl.ready }
export function animset_bound(pl: AnimPlayer, set: int, rig: string) -> bool { return pl.set == set and pl.rig == rig and pl.names != null }