raea/dev_tools

Checks and lints you can run from code: a motion performance's lint report.

View as Markdown

motionLint checks a performance recorded with trace: true against its motion library and reports what breaks the rules, such as moves that overlap or land off the beat; lintReport formats the result. Run them from a test or from raea run.

TS
import { lintReport, motionLint } from "raea/dev_tools"

raea/dev_tools exports 2 functions, 3 types. Bevy's counterpart: bevy_dev_tools, bevy_diagnostic. Source: sdk/raea/src/dev_tools.ts.

Functions

lintReport

A lint as lines: a count by stage and kind, then each finding.

TS
function lintReport(l: Lint, o?: { max?: number; }): string

motionLint

Lint a performance made with trace: true (see the head of the file).

TS
function motionLint(lib: MotionLibrary, perf: Performance, o?: { margin?: number; }): Lint

Types

Finding

FieldTypeWhat it is
frame (required)numberfirst and peak frames
peak (required)numberthe frame it's worst on
frames (required)numberhow many frames it lasts
joint (required)stringthe joint it's on
kind (required)"speed" | "jerk" | "buckle"what's wrong: too fast (speed), a jolt (jerk) or a joint bent past its limit (buckle)
value (required)numberthe peak's value (degrees a frame, a frame², or degrees past the clip's knee) and what the library allows
limit (required)numberwhat the library allows
stage (required)Stagethe first stage that shows it
causes (required)string[]what happened within three frames of it

Lint

FieldTypeWhat it is
findings (required)Finding[]what's wrong, each with its frames, joint and cause
frames (required)numberhow many frames were checked

Stage

TS
type Stage = "clip" | "blend" | "plant" | "elbows" | "gaze"