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

@ -15,6 +15,17 @@ export function animset_request(pl: AnimPlayer, key: string) -> void {
pl.want = i
}
# the state is in the set and the rig carries one of its clips: a one-shot with none is not asked for
export function animset_can(pl: AnimPlayer, key: string) -> bool {
if pl.set < 0 or pl.clips == null { return false }
let i = as_state(AnimSets[pl.set], key)
if i < 0 { return false }
let d = AnimSets[pl.set].states[i]
if d.choices == null { return false }
for c in 0 .. len(d.choices) { if pl.clips[pl.base[i] + c] != null { return true } }
return false
}
function as_param_at(pl: AnimPlayer, name: string) -> int {
if pl.set < 0 { return -1 }
let s = AnimSets[pl.set]