skeleton
The skeleton namespace — the engine's Luau API reference for skeleton.
The skeleton namespace — 10 functions.
globals/skeleton/applyPose
globals/skeleton/applyPose(sinkHandle: number, bufferHandle: number) -> boolean
Snapshot the buffer's first layout.total_floats values and
queue a pending apply for the next ECS drain. Returns false on
unknown sink/buffer or buffer too small for the layout. The
Buffer is unchanged.
globals/skeleton/bindClip
globals/skeleton/bindClip(zanimBytes: string, boneOrder: { string }) -> ClipBindInfo?
Decode a zanim payload and bind it to boneOrder,
precomputing which of the clip's channels feed each bone so
per-frame sampleClip is allocation-free. Returns
{ handle, matched, total, duration }, or nil on a malformed
payload / empty bone order. Check matched: 0 means the clip
drives none of these bones.
globals/skeleton/bindPose
globals/skeleton/bindPose(entityId: string?, opts: SkeletonLayout) -> number?
Register a pose sink targeting entityId. The opts table
carries the layout: boneOrder is the bone-name array
({"hip", "spine", ...}), stride defaults to 10
(translation.xyz + rotation.xyzw + scale.xyz). Pass entityId
as nil to use the current component's owning entity.
globals/skeleton/clipBones
globals/skeleton/clipBones(zanimBytes: string) -> { string }?
Decode a zanim payload and return its bone-name array. Pure:
build a bind order or a retarget map from a clip without binding a
sampler. Returns nil on bytes that aren't a valid zanim payload.
globals/skeleton/clipDecode
globals/skeleton/clipDecode(zanimBytes: string) -> string?
Decode a zanim payload to its readable JSON form
({ name, duration, channels, bone_names }). The binary parse is
the engine's; json.decode the result to inspect or transform a
clip's channels (e.g. the retarget bake) in Luau. Returns nil on
bytes that aren't a valid zanim payload. Inverse of clipEncode.
globals/skeleton/clipEncode
globals/skeleton/clipEncode(jsonString: string) -> string?
Encode a clip's JSON form (the shape clipDecode returns) back
to a zanim payload — the bytes a .animation stores and
bindClip/sampleClip consume. Inverse of clipDecode. Returns
nil on invalid JSON.
globals/skeleton/jointTransforms
globals/skeleton/jointTransforms(entityId: string) -> table
Read a skinned entity's per-joint world transforms for the current animated pose.
globals/skeleton/sampleClip
globals/skeleton/sampleClip(handle: number, time: number, buffer: number) -> boolean
Sample the bound clip at time (clamped to [0, duration])
and write one stride-10 pose record per bound bone into the
Buffer, starting at index 0. Bones the clip does not drive are
written as identity. Returns false on unknown handle/buffer or a
buffer too small for the bone count.
globals/skeleton/unbindClip
globals/skeleton/unbindClip(handle: number) -> boolean
Drop the bound clip sampler from the registry.
globals/skeleton/unbindPose
globals/skeleton/unbindPose(sinkHandle: number) -> boolean
Remove the sink from the registry.