Composing actions
A person’s performance is a chain of actions, and a scene is several chains performed at once. HumanChain writes those chains. Every action of the vocabulary is a typed method of the chain, so an editor lists the actions and their parameters, and the type checker rejects a misspelt action, a parameter the action does not take and a value outside a closed set.
One person
HumanChain.subject(id) starts a chain. Each method appends one action with that action’s own parameters. act(name, params) appends an action named as data, typed by the name:
import { HumanChain } from "@automovie/motions";
const a = HumanChain.subject("a")
.walk({ to: { x: 0, y: 0, z: 4 } })
.act("gesture", { kind: "wave" })
.stand({ seconds: 2 });AutoMovieMotionHumanActionName from @automovie/interface lists the vocabulary with one line per action, and IAutoMovieMotionHumanActionParams maps each name to its parameters. What an action is directed at is an IAutoMovieMotionTarget: a region of another person, a region of the performer’s own body, a named point of a prop, a point in the world, or none.
HumanChain.subject("a").approach({
target: { kind: "person", subject: "b", region: "sternum" },
at: "personal",
});approach stops at a named distance band, here personal distance, the way the screenplay names it.
The operators
These operators join actions:
| To | Write |
|---|---|
| Perform one action after another | chain.sit({ seat }).rise() |
| Interrupt the last action | chain.walk({ to }).until({ share: 0.5 }).stand() |
| Do two things at once with one body | chain.walk({ to }).over((u) => u.handToFace({ task: "read" })) |
| Run two people at once | a.with(b) |
| Join people in one action | HumanChain.pair(a, b).handshake() |
| Let another chain align to an action | Pass an anchor id as the last argument, chain.punch(params, "jab") |
| Time an action to another action’s instant | b.stand().flinch().sync({ of: "jab", event: "contact" }) |
| Time an action to speech or music | a.stand().gesture({ kind: "wave" }).sync({ of: "dialogue", event: "accent", index: 2 }) |
| Cut an action on a cue | chain.stand().until({ of: "music", event: "beat", index: 4 }) |
Cuts
until cuts the last action: at a share of it, at one of its events, at another action’s event, or when a region comes near a target. The action’s own cancel table decides which cuts it allows, and the performance refuses the others.
Overlays
With over, the last action carries the body, and the actions put over it take only the parts they move. A walk keeps the pelvis and the legs and yields its arms, hands and head. Each action’s overlay and yields in HUMAN_ACTIONS say which actions can ride a carrier and what a carrier gives up. Two overlays that need one hand at one time are refused, naming both.
Sync
sync puts one instant of the action, align or its start when absent, on the instant named, and starts the action as early as its body needs for that. Where the performer’s previous action still runs then, it is cut there, which its cancel table must allow. Cut an action with until and put overlays on it with over before syncing it.
Speech and music as cues
Speech and music are cue tracks given to the performance. The screenplay and the score decide their seconds:
import { HumanCue, HumanPerformance } from "@automovie/motions";
new HumanPerformance({
seed,
performers,
cues: {
dialogue: HumanCue.dialogue([{ from: 1, to: 4, accents: [2.0, 3.2] }]), // lineStart, accent, phraseEnd, lineEnd
music: HumanCue.beats({ bpm: 96, count: 16 }), // beat, downbeat
},
composition,
});Several people
a.with(b) runs two chains side by side. A mutual action defines roles and the action each role performs, and HumanChain.mutual starts those actions together after every cast member’s entry chain:
import { HumanChain, HumanMutual } from "@automovie/motions";
HumanChain.mutual(HumanMutual.handOver, { giver: a, receiver: b }, { prop: "cup", handle: "body" });The meeting laws in HumanMutual include handshake, highFive and handOver, which solve a shared meeting. HumanChain.pair(a, b) is a shorthand for the handshake and the handover. A production can define its own IAutoMovieMotionHumanMutual over its registered actions.
What the composition can say
The grammar’s axes and operators, read from the installed package:
The axes an action is decided on
| Name | Decides | Carried by |
|---|---|---|
base | what carries the body | IHumanEntryState.supports, HumanObject.seat |
travel | whether and how the body goes somewhere | walk, run, approach, HumanGait, HumanPursuit |
action | which action, and which entry of its table | HumanActionName, HUMAN_LEXICON, HumanActionRow |
effector | which part of the body performs it | touch.With, hand and side parameters |
target | a region of a person, a place on an object, a point or none | AutoMovieMotionTarget |
object | the object involved and the contact on it | HumanObject, IHumanProp |
partner | the role in an action done together | IHumanMutual roles |
manner | effort, pace, count and hold | AutoMovieMotionManner.IManner |
layer | what runs under everything the person does | IHumanLayer, IHumanLayer.IScheduled |
timing | when, against other actions, speech and music | HumanChain.sync, until, HumanCue |
seed | which take of the same composition | HumanPerformance.IInput.seed, HumanVariation |
The operators that join actions
| Name | Decides | Carried by |
|---|---|---|
sequence | one action, then the next | HumanChain methods in order |
cut | an action ended early inside a window it declares | HumanChain.until |
overlay | two things at once with one body | HumanChain.over |
layer | something added under every action | HumanPerformance.IInput.layers |
parallel | several people at once | HumanChain.with |
mutual | one action several people do together | HumanChain.mutual, HumanChain.pair |
attach | an action on an object's affordance | HumanObject.seat, HumanObject.prop |
sync | an action timed to another instant | HumanChain.sync |
When a composition is refused
Building a HumanPerformance throws a HumanRefusal when the vocabulary cannot perform the composition. The refusal names the performer, the action and its occurrence, the axis at fault, the value given, what the axis accepts and one sentence saying what to change:
a.handshake#1 hand: handshake needs the right hand, which holds bottle since pickUp (pickUp); feasible: left; fix: put bottle down or hand it over first, or perform handshake with the free handRepair a refusal at the axis it names. Playground shows a refusal on the action it names, with its fix, and Extending the vocabulary covers a beat that no repair realizes.