hero-picker
Public Unreviewedby Caleb
Interactive orientation picker and hero renderer for molecule GLBs. Serves a Hydrogen webview UI with X/Y/Z rotation bars over studio base renders, true-render preview, and one-click 1200x630 hero sav
Hero Picker
Point it at one or more molecule GLBs and pick each board's thumbnail orientation with three bars — Z spin, X tilt, Y tilt — in a Hydrogen webview tab. The flat image rotates live as an approximation; True render preview runs the bundled studio renderer (room-environment lighting, ACES tone mapping, PBR material inference, grey backdrop) at the chosen angles, and Save hero writes a 1200 × 630 hero PNG ready for a wiki page.
The bars map one-to-one to renderer flags, so a picked orientation is always reproducible from the CLI:
bin/glb2png.mjs <board.glb> --view studio --spin -45 --tiltx 10 --tilty 0

Run
hero-picker <board.glb> [more.glb ...] [--port 8848] [--out-dir .]
Then open the printed URL in a Hydrogen webview tab
(adom-cli hydrogen webview open-or-refresh --name "Hero Picker" --url <url>).
Base renders take ~15 s per board; the UI polls until they appear.
A saved hero looks like this (Control Panel: Workcell at spin 40, tiltx -75, tilty 5):

API
Every UI action has a matching endpoint (JSON {status, data, hints[]}):
| Route | Does |
|---|---|
GET /api/boards |
Board list + base-render readiness |
POST /api/preview {board, spin, tiltx, tilty} |
True render at 700 px, returns image URL |
POST /api/save {board, spin, tiltx, tilty} |
Full render, saves <out-dir>/<board>-hero.png (1200×630) |
Install
adom-wiki pkg install caleb/hero-picker && bash ~/project/adom_modules/caleb/hero-picker/install.sh
Needs Node 20+ (npm i puppeteer happens in install.sh) and python3 + Pillow.
Bundled renderer
bin/glb2png.mjs is an extended adom-glb2png with --view studio|studio2,
--spin, --tiltx, --tilty — headless three.js with a Draco loader,
logarithmic depth buffer (kills soldermask/pour z-fighting), and studio
material inference (gold → metallic, soldermask → semi-gloss).
# Hero Picker
Point it at one or more molecule GLBs and pick each board's thumbnail orientation
with three bars — Z spin, X tilt, Y tilt — in a Hydrogen webview tab. The flat
image rotates live as an approximation; **True render preview** runs the bundled
studio renderer (room-environment lighting, ACES tone mapping, PBR material
inference, grey backdrop) at the chosen angles, and **Save hero** writes a
1200 × 630 hero PNG ready for a wiki page.
The bars map one-to-one to renderer flags, so a picked orientation is always
reproducible from the CLI:
```
bin/glb2png.mjs <board.glb> --view studio --spin -45 --tiltx 10 --tilty 0
```

## Run
```
hero-picker <board.glb> [more.glb ...] [--port 8848] [--out-dir .]
```
Then open the printed URL in a Hydrogen webview tab
(`adom-cli hydrogen webview open-or-refresh --name "Hero Picker" --url <url>`).
Base renders take ~15 s per board; the UI polls until they appear.
A saved hero looks like this (Control Panel: Workcell at spin 40, tiltx -75, tilty 5):

## API
Every UI action has a matching endpoint (JSON `{status, data, hints[]}`):
| Route | Does |
|---|---|
| `GET /api/boards` | Board list + base-render readiness |
| `POST /api/preview` `{board, spin, tiltx, tilty}` | True render at 700 px, returns image URL |
| `POST /api/save` `{board, spin, tiltx, tilty}` | Full render, saves `<out-dir>/<board>-hero.png` (1200×630) |
## Install
```
adom-wiki pkg install caleb/hero-picker && bash ~/project/adom_modules/caleb/hero-picker/install.sh
```
Needs Node 20+ (`npm i puppeteer` happens in install.sh) and python3 + Pillow.
## Bundled renderer
`bin/glb2png.mjs` is an extended `adom-glb2png` with `--view studio|studio2`,
`--spin`, `--tiltx`, `--tilty` — headless three.js with a Draco loader,
logarithmic depth buffer (kills soldermask/pour z-fighting), and studio
material inference (gold → metallic, soldermask → semi-gloss).