Logo Mibo

Animation3DClips Module

Functions and values

Function or value Description

boneNamesOf model

Full Usage: boneNamesOf model

Parameters:
Returns: string[]

Skeleton bone names of a loaded Model, indexed by bone index.

raylib 6 clips carry no bone names — a file's animation keyframe poses follow the bone order of that file's model skeleton, which is what this reads. Needed per source file when merging clips from multiple files (see merge).

model : Model
Returns: string[]

buildBoneRemap sourceBoneNames targetBoneNames

Full Usage: buildBoneRemap sourceBoneNames targetBoneNames

Parameters:
    sourceBoneNames : string[]
    targetBoneNames : string[]

Returns: int[] voption

Build the remap that lets a clip authored against one skeleton bone order (sourceBoneNames) be sampled against another (targetBoneNames), matching bones by name.

Returns ValueNone when both orders already match (no remap work at sample time). Otherwise the map is indexed by target bone index and yields the source bone index, or -1 when the source skeleton has no bone with that name (the bone samples as its bind pose, like an out-of-range bone).

sourceBoneNames : string[]
targetBoneNames : string[]
Returns: int[] voption

count clips

Full Usage: count clips

Parameters:
Returns: int
Modifiers: inline

Get the number of animation clips.

clips : Animation3DClips
Returns: int

fromModelAnimations anims

Full Usage: fromModelAnimations anims

Parameters:
Returns: Animation3DClips

Create a clip set from an array of loaded ModelAnimation values.

Use this after loading animations with Raylib.LoadModelAnimations. The ModelAnimation values must be copied to an array before passing — LoadModelAnimations returns a Span which cannot be stored directly.

anims : ModelAnimation[]
Returns: Animation3DClips

isEmpty clips

Full Usage: isEmpty clips

Parameters:
Returns: bool
Modifiers: inline

Check if the clip set has no animations.

clips : Animation3DClips
Returns: bool

merge targetBoneNames sources

Full Usage: merge targetBoneNames sources

Parameters:
    targetBoneNames : string[]
    sources : (string[] * ModelAnimation[])[]

Returns: Animation3DClips

Merge animations loaded from different files into one clip set that samples correctly against the target skeleton's bone order.

Asset packs may split clips across rig files whose skeletons order the same bones differently (e.g. KayKit's Rig_Medium_MovementBasic.glb orders right-side joints first, Rig_Medium_General.glb left-side first). raylib keyframe poses are index-based, so a clip from a differently-ordered file would drive the wrong bones (mirrored limbs). Each entry in sources pairs one file's skeleton bone names (see boneNamesOf) with the animations loaded from that same file; targetBoneNames is the skeleton of the model being animated. Clips whose source order already matches get no remap.

targetBoneNames : string[]
sources : (string[] * ModelAnimation[])[]
Returns: Animation3DClips

names clips

Full Usage: names clips

Parameters:
Returns: string[]
Modifiers: inline

Get the list of animation names in this clip set.

clips : Animation3DClips
Returns: string[]

tryGetClipIndex name clips

Full Usage: tryGetClipIndex name clips

Parameters:
Returns: int voption
Modifiers: inline

Try to get the index for an animation name.

Use at load time to resolve animation names to indices for zero-allocation playback.

name : string
clips : Animation3DClips
Returns: int voption

Type something to start searching.