Skip to content

Blender→three authoring pipeline - #101

Merged
mracette merged 73 commits into
devfrom
blender-three-workflow
Aug 1, 2026
Merged

mracette merged 73 commits into
devfrom
blender-three-workflow

Conversation

@mracette

Copy link
Copy Markdown
Owner

What this is

The complete Blender→three authoring pipeline (phases 0–5): dual three.js versions (three = modern for new content, three-legacy = 0.108 pinned for the original scenes), the binding schema (src/bindings/), the runtime evaluator and RuntimeScene host (src/viz/runtime/), headless audio bake tooling, a full Blender addon (tools/blender/addon/ — authoring N-panel, bake orchestration, in-viewport preview), the pre-baked per-stem "snappy" hybrid signal source, and a stem inspector dev tool.

The prelude test song has been removed. It was scaffolding to prove the pipeline end-to-end and was never meant to ship — its config entry, icon, landing tile, scene GLB, committed bakes, palette, CanvasViz wiring, and e2e spec are all gone (Remove the prelude test song, keeping the authoring pipeline). The pipeline itself is untouched and fully tested; the next song will wire into it fresh. The landing page is exactly dev's design-system version, Information & Updates card included.

Merge conflict resolutions

Merged origin/dev (the design-system overhaul, #97). Textual conflicts:

  • CLAUDE.md — kept both additions: dev's external-link convention and the branch's three.js dual-version section.
  • src/components/LandingPage.tsx — took dev's version wholesale (SongCards, sky scene, routes). The branch's pre-overhaul selection panel and LandingPageMobile.tsx (deleted on dev) are gone.
  • src/viz/subjects/LandingPageParticles.ts — took dev's rewrite, imported from three-legacy. Also switched dev's new LandingPageFog.ts and LandingPageConstellations.ts from three to three-legacy: on dev, three is still 0.108, but on this branch three is modern — the landing scene runs on the legacy renderer stack (it uses PlaneBufferGeometry, removed in modern three). All remaining from "three" imports are confined to src/viz/runtime/.

The semantic one: voice position math (AudioPlayerWrapper / stemProvider)

dev's transport can now start voices mid-loop (start(time, offset), used when a toggle lands inside the lookahead window) and change playback rate (Time Warp). The baked-signal position math previously assumed offset 0 and rate 1, which would silently desync visuals from audio. Per the phase-5 design:

position = (startOffset + (audioCtx.currentTime − startedAt) · playbackRate − outputLatency) mod loopDuration
  • AudioPlayerWrapper now records startOffset (the wrapped buffer offset passed to the last start()), kept through stop() like startedAt.
  • createStemProvider applies the formula above; the negative-elapsed rule (scheduled-but-future start excludes the stem) is unchanged. Rate glides are short, so treating the rate as constant since start is within a frame of exact.
  • New unit tests cover offset recording and the offset/rate position math.

Open decisions (surfaced, not resolved)

  • bake-song's parseArgs breaks on a literal -- separator (tools/bake-song.mjs) — npm run bake:song -- <songId> works because npm strips the --, but passing an explicit -- confuses the parser.
  • The handoff's other open items — /info reachability, the prelude DEV gate, and the prelude "extra vs extras" group naming — are mooted by the prelude removal. Group/key-label naming conventions will resurface when the first real song is authored through the pipeline.

Gates (all green, run in the worktree)

  • pnpm typecheck — clean
  • pnpm test — 222 passed (26 files)
  • pnpm test:e2e — 46 tests: 43 passed first run; 3 timeout flakes (swamp/moonrise scene invariants, one music-player spec) passed on immediate retry
  • pnpm test:blender — 10/10 OK sentinels (Blender 5.1 headless)
  • pnpm test:bake, pnpm test:bridge — OK
  • Landing page and scene boot verified visually via Playwright screenshot: dev's design renders correctly on three-legacy, no page errors

https://claude.ai/code/session_018b6DWDjV62yBQaTrKrvDoE

mracette added 30 commits June 27, 2026 21:48
mracette added 27 commits July 2, 2026 11:09
…44100 decode parity, onset in bake contract test
# Conflicts:
#	package.json
#	playwright.config.js
#	pnpm-lock.yaml
#	src/classes/AudioPlayerWrapper.ts
#	src/components/MusicPlayer.tsx
#	vitest.config.ts
# Conflicts:
#	CLAUDE.md
#	src/components/LandingPage.tsx
#	src/components/LandingPageMobile.tsx
#	src/viz/subjects/LandingPageParticles.ts
@mracette

mracette commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Reviewed pre-merge (multi-agent pass over runtime, Blender addon, and build/e2e surface). Pre-merge fixes landed in 8414135:

  • Time Warp desync fix (the important one): the baked-signal position math assumed a constant playback rate since start(), but Time Warp changes it mid-playback — position is the integral of rate. setPlaybackRate now re-bases the position clock (folds the old-rate segment into startOffset, restarts at atTime). Pure bookkeeping — no AudioParam behavior change. New unit tests cover mid-playback and pre-start rate changes.
  • bakeLoader guards against 200-but-wrong-shape JSON (would have thrown in the render loop every frame).
  • RuntimeScene.dispose() now frees material textures, removes the DEV debug handle (was pinning the GL context), and the GLB error callback respects disposed.
  • Binding test fixture used ease: "easeCubicOut" (resolves to silent linear fallback); now "cubicOut".
  • Removed the stale prelude un-ignore stanza from .gitignore.
  • CI now runs test:bake and test:bridge (Node/Chromium/python3 only — free on the existing runner; the Blender-native suite stays local).

Cleared: no production-bundle leakage from the dev harness pages (verified three ways), all legacy-scene changes are pure three → three-legacy import swaps, e2e suite is hermetic, dependency delta is one aliased three.js + type packages.

All gates green post-fix: typecheck, vitest 224/224, e2e 46/46, blender 10/10, bake, bridge.

Deferred findings (Blender interactive-path hardening, bake pipeline robustness, mirror edge cases, runtime host polish): #102

https://claude.ai/code/session_018b6DWDjV62yBQaTrKrvDoE

@mracette
mracette merged commit 97751bf into dev Aug 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant