Skip to Content
DocsMotion as code

Motion as code

A person’s performance is composed from the engine’s motion primitives through @automovie/motions, so any human action is a few typed lines. An action the vocabulary lacks is a row over a shipped action, or a law built from the same primitives. The cast, sets, staging and camera are TypeScript the agent writes against typed packages as well, so a motion is a module: tested once, accepted on stills, and reused by any scene and any body.

Actions

An action, such as walk, approach, look, gesture, sit, pick up, punch or guard, is a law that brings the hands, feet and body onto their targets. It is scaled to the body that performs it, so one composition fits people of different stature and proportion. An action can be interrupted mid-motion, and the performance refuses an interruption the action does not allow.

Each action’s JSDoc names its source in the motor-control, gait or sports literature and marks the values that are provisional. Motions shows every family of the vocabulary performed.

A performance

HumanPerformance places a composition on the film clock and samples it:

import { HumanChain, HumanPerformance } from "@automovie/motions"; const performance = new HumanPerformance({ seed: "scene-12", performers: [ { subject: "a", body, at: { x: 0, y: 0, z: 0 }, yaw: 0, proficiency: { level: "trained" } }, ], composition: HumanChain.subject("a").walk({ to: { x: 0, y: 0, z: 4 } }).stand({ seconds: 2 }).node, }); const pose = performance.pose("a", 1.5);

The body is generated by @automovie/human from typed parameters, and @automovie/render draws it as the polygon man, plain rigid primitives over its joints. Positions are world metres on the floor, and yaw is degrees about +Y with 0 facing +Z. Composing actions describes the composition grammar.

A new action

An action the vocabulary lacks is registered with it. A row is a shipped action under a name of its own, with some parameters fixed, so it writes no motion:

import { HumanActionRow, HumanChain, HumanPerformance, handToFace, touch } from "@automovie/motions"; // A touch with its target, effector, kind, hand and elbow fixed. const salute = HumanActionRow.of("salute", touch, { target: { kind: "self", region: "templeRight" }, with: "forefinger", // the hand continues the forearm, palm down kind: "hold", side: "right", elbow: "level", // the upper arm horizontal }); // An entry a table lacks, given as the table's own row type. const shave = HumanActionRow.of("shave", handToFace, { task: { region: "jawRight", effector, kind: "rub", count: 3, hold: 0.2, tangent: "up", head: 0, at: "atJaw" }, }); const Chain = HumanChain.extend({ salute, shave }); new HumanPerformance({ seed, performers, laws: [salute, shave], composition: Chain.subject("a").walk({ to }).salute({ hold: 1.5 }).stand().node, });

The chain method takes the parameters the row leaves open. Extending the vocabulary gives the routes, the lexicon of ready rows and the laws.

Reproducibility

Poses depend only on the composition, the seed and the bodies. Nothing is regenerated: a defect is found on a still, corrected at its cause in the module and recomputed, and the correction is judged at the same second and camera.

These inputs vary a take without changing what is done:

InputChanges
seedWhen each step falls and how far each arm swings
proficiencyTiming, path and balance, at novice, amateur, trained or elite, without widening any joint’s range
bodyThe scale and proportion the same chain is performed at

A refusal never depends on the seed, so a composition that plans under one seed plans under every seed. Scene studies shows each scene replayed with other seeds, bodies and proficiency.

Verifying a performance

A composition that plans can still perform badly. A scene is checked on three things before it is accepted:

  1. HumanVerdicts reads every physical bound that holds for human motion, such as a hand passing into the body, a foot skating or a joint leaving its range, and places each finding on the performer and the action. Only a clean report is accepted.
  2. HumanSignature reads what human-movement studies measure, such as the trunk’s inclination, a joint’s flexion, the centre of mass and the cadence, for a unit test to assert.
  3. Stills of the performance show a pose that reads wrongly, which numbers do not.

From module to scene

A production accepts each entity and reusable motion module in a catalog case before any scene composes it. A case isolates one module with its target, partner response and outcome, and the catalog film, src/composition/films/catalog.ts, gives it a labeled interval and replays every case after a repair. Accepted cases are recorded in docs/acceptance/catalog.md.

A scene then only composes accepted modules. A defect the scene shows is fixed in the module and its case, never patched in the scene. Each scene composition cites the screenplay sections and beats it realizes, as Writing scenes shows.

Last updated on