# Bob side rig — notes

Open: `file:///root/tmp/anim/side-rig/bob.html` (one file, 590 KB, art embedded as webp).

## Pipeline
| step | file | what |
|---|---|---|
| gen | `gen.py` | one Gemini call, hard cap 20 (counts `gen/calls.jsonl`). Key read from file, never printed. |
| cut | `cut.py` | flood-fill white bg, split parts sheet, round caps at joints, pivots. Heads + 3/4 sprite too. Out `parts/`, `parts.json`, `debug-pivots.png` |
| align | `align.py` | ECC-align edit outputs onto base head/torso |
| build | `build.py` | embed parts into `bob.tpl.html` -> `bob.html` |
| shots | `shoot.sh` | agent-browser, paused + stepped deterministically via `window.bob` |

Gemini: 8 of 20 calls. Model `gemini-3-pro-image-preview`. See CALLS.md.

## What worked
- Parts sheet in one call (call 2): style + outfit match story art. Profile head real.
- Face edits = "change only expression" on the head crop. Pixel-stable (ECC cc 0.998). Swap = crossfade same-size heads, no ghost hair.
- Same edit trick closed torso arm hole (call 8).
- Legs = 2-bone IK to ankle targets, toe/heel pivot roll. Stance foot world x constant, IK error 0 px -> walk feet do NOT slide.
- Blending: snapshot of on-screen pose -> live target pose, cubic ease, 0.34-0.65 s. No frame-0 position jumps (tested all 56 state pairs).
- Crossfade order trick (top fades in first half, bottom fades out second half): no see-through mid swap.
- 3/4 turn: c01 sprite (call 1, came out 3/4 by accident) fits rig height well.
- Pick up: arm IK, fingertips land on crystal, grip point slides fingertip->fist as hand closes.

## Flaws (honest)
- Parts are not one consistent drawing: torso is ~3/4 (zipper visible) while head is pure profile. Reads OK, but torso looks "turned" a bit.
- Far limbs = same art darkened. No real far-side arm/leg art.
- Arms short vs legs (source sheet proportion). Forced deep stoop for pick up; stoop pose looks crouchy/animal-ish.
- Elbow/knee joints = overlapping round caps. At strong bends (squat, think) cap edge visible, no cloth fold.
- Crossed arms (think) fake: near forearm squashed to 0.62 length for foreshortening. Far fist at chin OK, far upper arm mostly hidden.
- Happy = fists at hips + bounce. Profile akimbo reads weak.
- Hand open<->fist swap: ~0.15 s ghost fingers mid blend (visible in shots/10-blend-walk-to-think.png).
- 3/4 turn = sprite crossfade, not a rig turn. ~0.1 s double head. Idle only; turned sprite has neutral face, no breathing, no blink.
- Leaving walk: stance foot slides during the 0.34 s blend (root still coasting). Swing foot velocity stops at frame 0 (position continuous).
- Edge turnaround = paper flip (scaleX through 0). Old-school, not a real turn.
- Crystal = canvas drawing, not Gemini art. Can overlap boot toe in reach->pickup blend.
- Blink uses neutral blink head, only when face is neutral.
- Neutral head is upscaled 1x sheet; expression heads are native 2x -> slightly sharper face on swap. Minor.
- Idle breathing tiny. No secondary motion (hair, jacket).
- No Lottie export. Plain canvas JS.

## Shots
`shots/` full stage, `shots/crop/` around Bob, `shots/contact-1..4.png` sheets. All looked at.
