Skip to main content

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 is currently a scaffold: scene model, geometry math, engine base/registry, and CLI are in place. The three render engines (Blender, pygfx, Playwright) are registered stubs that raise NotImplementedError.

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 by gap, captions on) and compact (head-on, plates collapsed to MIN_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 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/playwright stubs
├── images.py       # Pillow overlay compositing (reused from vexy-stax2)
├── juicy.py        # per-channel color match (reused from vexy-stax2)
└── 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

vexy_stax-0.1.0.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vexy_stax-0.1.0-py3-none-any.whl (37.1 kB view details)

Uploaded Python 3

File details

Details for the file vexy_stax-0.1.0.tar.gz.

File metadata

  • Download URL: vexy_stax-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 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

Hashes for vexy_stax-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8608fb8c0ba0bed95a1dcb3d4d028e5eb5b84cc3ac3341e69e8bfc52ecbc0c13
MD5 6c6baf2c77f386fc529eb1c6fc19f332
BLAKE2b-256 1673fceda2e44428b847dd5d476501cc168fad9490c45786c3e535805689bd98

See more details on using hashes here.

File details

Details for the file vexy_stax-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vexy_stax-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.1 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

Hashes for vexy_stax-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c541f3ba43dc1ca5a2fd8943595a2fe9e0558abe4a69934fa444387419cd617f
MD5 4466f122184a8b9ec09490944b6ec693
BLAKE2b-256 5d2c2cbeb2eae8c6ad3d97a6c86f03ac5050b5c8854ada7482da1be8c655c665

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page