Render layered PNGs as 3D glass plates in two views, from a shared JSON scene format
Project description
vexy-stax
Render a deck of layered PNG slides as 3D glass plates — in two views and the
transitions between them — from a single shared JSON scene format. This is the
offline Python package; a browser sibling (vexy-stax-js) consumes the same
scene format. See the repo-level SPEC.md for the binding contract.
This package implements the scene model, geometry math, CLI, and three fully functional render backends: Blender, pygfx, and Playwright.
Install
uv venv --python 3.12 && uv sync
Concepts
- A scene is an ordered list of slides (back-to-front; index 0 is farthest from the camera) plus camera, floor, and transition settings.
- Two views:
expanded(angled, plates spaced bygap, captions on) andcompact(head-on, plates collapsed toMIN_GAP ≈ 3 pt). - A transition morphs between the views (
expand,collapse,expand_collapse,collapse_expand), interpolating camera, spacing, and per-slide opacity with a shared easing curve.
CLI
vexy-stax dir2scene assets/ --out scene.json # generate scene JSON from directory
vexy-stax render scene.json --view expanded --engine pygfx --out beauty.png
vexy-stax render scene.json --view compact --engine blender --out stack.png
vexy-stax video scene.json --engine blender --out morph.mp4
vexy-stax overlay scene.json --out flat.png # pure-Pillow flat composite
vexy-stax engines # list available engines
Defaults: still ⇒ pygfx, video ⇒ blender. A missing/unimplemented engine
fails with an actionable message, not a crash.
Library
from vexy_stax.scene import load_scene
from vexy_stax import geometry as g
scene = load_scene("scene.json") # validates + resolves slide paths
plan = g.frame_plan(scene) # per-frame camera/spacing/opacity
pose = g.expanded_camera(scene) # CameraPose dataclass
vexy_stax.scene is a strict pydantic v2 model (extra="forbid" everywhere —
unknown fields fail loud at the boundary). vexy_stax.geometry holds the pure,
engine-agnostic view math (SPEC.md §3), mirrored by the JS geometry.js against
shared fixture vectors.
Layout
src/vexy_stax/
├── scene.py # pydantic v2 scene model + loader
├── geometry.py # §3 camera/spacing/opacity math (pure, engine-agnostic)
├── engines/ # base.py protocol + registry; blender, pygfx, and playwright renderers
├── images.py # Composites 2D flat preview overlays using Pillow
├── juicy.py # Matches colors between 3D renders and 2D overlays
└── cli.py # fire + rich CLI
Test
uv run pytest -q
License
MIT.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vexy_stax-3.1.2.tar.gz.
File metadata
- Download URL: vexy_stax-3.1.2.tar.gz
- Upload date:
- Size: 11.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a322368acc2d3c948245676724e3bd061404fddc8a969ed740f4ebaaca85a7d
|
|
| MD5 |
8d12bb4166210324c9b64d30dced5c0f
|
|
| BLAKE2b-256 |
bee14969799fb6c8690de6c513ab7363a7361048298f8337e6cb2299055a0e0e
|
File details
Details for the file vexy_stax-3.1.2-py3-none-any.whl.
File metadata
- Download URL: vexy_stax-3.1.2-py3-none-any.whl
- Upload date:
- Size: 112.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5deb7562465630579daec6daa782666df2f69877e8dbe51d5d3a31345ca0200b
|
|
| MD5 |
949271da1b838d0cb4fd8b83e3ecee1f
|
|
| BLAKE2b-256 |
7746b9e8c7dcdaa0da60a1db1749ba0189a4e8444ff6c1817953cdeeb2f4fd31
|