Skip to main content

Module anim_runtime

Module anim_runtime 

Source
Expand description

Process-wide command queue for runtime animation control (crossfades, graph parameter writes, graph state queries). Mirrors the shape of crate::debug::runtime_spawn, but separate so the AnimationSystem can drain its own commands without contending with GraphicsSystem’s decal / particle queue.

The debug server (binary-only, off the engine thread) pushes commands here; the editor’s per-frame debug drive drains them via AnimationSystem::apply_runtime_commands every frame – including while a menu pauses playback, so a blocked WS client always gets its reply. Each command carries a reply channel the drain fulfils synchronously.

Structs§

CrossfadeRequest
One queued crossfade request. target is the SkinnedMesh asset id the command applies to; weights must match the clip count registered for that target. duration_secs == 0 snaps to the new weights on the next frame. Rejected when the target is graph-driven (use SetParam).
GraphStateReport
Snapshot of a graph target’s live state, answered synchronously to the anim-state debug command. Parameter values are as of the last completed animation step (a pending SetParam shows up after the next step).
SetParamRequest
One queued graph parameter write. target is the SkinnedMesh whose graph declares the parameter; the value lands in the target’s AnimationParams component on the next animation step.

Enums§

AnimCommand
One runtime command pushed onto enqueue by the debug WS server and drained by AnimationSystem::apply_runtime_commands.

Functions§

enqueue
Push a command onto the animation runtime queue. The caller blocks on its own reply receiver to get the result. A poisoned mutex is recovered and used regardless (an unrelated panic must not silently drop commands).