Skip to Content

Goodnight

A parent steps up to the door, kisses his grown child's forehead and they wave goodnight.

Loading the take.

Each person is a chain of typed actions from @automovie/motions. This is what an agent writes for the scene; Composing motion explains the parts.

import type { IAutoMovieMotionHumanBody, IAutoMovieMotionHumanPerformance } from "@automovie/interface";
import { HumanChain, HumanHabit, HumanObject, HumanPerformance, HumanSocial } from "@automovie/motions";
import * as archetypes from "@automovie/archetypes";

const entryStep = archetypes.createKerb({ height: 0.196, depth: 0.254, kind: "step" });
const entryStepAt = { at: { x: 0, y: 0, z: 0.31 }, yaw: 0 };

// par: body m1, at (0, -3.4) m, facing 0°, trained
const par = HumanChain.subject("par")
  .act("walk", { to: { x: 0, y: 0, z: 0 } })
  .act("climbStairs", {
      count: 1,
      riser: 0.196,
      tread: 0.254,
      start: 0.05,
      on: "entryStep",
    })
  .registered("foreheadKiss", { partner: "kid" })
  .act("look", {
      with: "trunk",
      cue: "seen",
      target: {
        kind: "point",
        frame: "world",
        at: { x: 0.8, y: 1.75, z: 0.54 },
      },
    }, "goodnight-turned")
  .registered("checkWatch", {})
  .act("look", {
      target: {
        kind: "point",
        frame: "world",
        at: { x: 0, y: 1.6, z: 0.9 },
      },
      seconds: 1,
    })
  .act("gesture", { kind: "wave" }, "goodnight-wave");

// kid: body f2, at (0, 0.9) m, facing 180°, trained
const kid = HumanChain.subject("kid")
  .act("look", {
      target: { kind: "person", subject: "par", region: "face" },
      cue: "seen",
      seconds: 1,
    })
  .act("gesture", { kind: "wave" })
  .act("stand", { seconds: 2.5, sway: 0 })
  .registered("flickOff", {
      target: { kind: "person", subject: "par", region: "shoulderLeft" },
    })
  .sync({ of: "goodnight-turned", event: "end" })
  .act("gesture", { kind: "wave", side: "left" })
  .sync({ of: "goodnight-wave", event: "strokeStart", offset: 0.3 });

const scene = par.with(kid);

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanSocial.foreheadKiss, HumanHabit.checkWatch, HumanSocial.flickOff];

const props = [
  HumanObject.prop("entryStep", entryStep, entryStepAt),
];

// Each body id's motion body, prepared from the site's measures.
declare const bodies: Record<string, IAutoMovieMotionHumanBody>;

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "goodnight",
  performers: [
    { subject: "par", body: bodies["m1"]!, at: { x: 0, y: 0, z: -3.4 }, yaw: 0, proficiency: { level: "trained" } },
    { subject: "kid", body: bodies["f2"]!, at: { x: 0, y: 0, z: 0.9 }, yaw: 180, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  props,
  laws,
};
const performance = new HumanPerformance(input);