|
|
||
|---|---|---|
| docs | ||
| lzxmockup | ||
| runtime | ||
| schema | ||
| scripts | ||
| tests | ||
| .gitignore | ||
| CHANGELOG.md | ||
| lzx-mockup.spec | ||
| pyproject.toml | ||
| README.md | ||
| run.py | ||
LZX Mockup
Product mockup renderer for LZX Housing and
LZX Stackup. A mockup file stores source paths
only: a Housing .lzx_housing, a Stackup .lzx_stackup, a linked FreeCAD .FCStd, or a linked KiCad .kicad_pcb.
Geometry and finishes are read from those sources at render time. A Stackup board linked to an LZX Designer project is exported with lzx-designer-cli (pcb export glb) and drawn in place of the green outline. Shots use the same studio photography rig as the monorepo (lib/lib-kicad/scripts/lzx_product/blender),
vendored under runtime/pipeline/rig/.
The application shell matches Housing and Stackup: a .lzx_mockup project file, schema / regen, a PySide6 editor,
and the LZX dark theme from data/brand/.
Run
pip install -e . -e ../lzx-housing -e ../lzx-stackup
python run.py
python run.py open path/to/case.lzx_housing -o mockup.lzx_mockup
python run.py open path/to/project.lzx_stackup --mockup mockup.lzx_mockup
python run.py render mockup.lzx_mockup -o out
python run.py render mockup.lzx_mockup --draft --run
python run.py render mockup.lzx_mockup --product --run -o photos
render prints the Blender command. --run starts it.
--product writes website plates: the front three-quarter (product shot), fitted whole into a 1:1 square with a transparent background. A Housing source is rendered three times, as natural aluminum, matte black powder coat, and black anodize. The saved design is not changed. --finishes natural,powder keeps a subset.
Mockup file (version 2)
sources:[{ "path", "format" }]— one or more Housing (.lzx_housing) or Stackup (.lzx_stackup) projects, or a FreeCAD part (.FCStd, formatfreecad-part) or KiCad board (.kicad_pcb, formatkicad-pcb) linked the way Stackup links them.arrangeisrow(shared floor, fronts aligned,gap_mmbetween them) ormanual(each source'sx,y,z,yaw).background:transparent(a cutout),studio(the photography sweep stays in frame), or one of the 144 LZX palette names (for exampleLZX Red), which tints that sweep.shots: catalog shot names,product(front three-quarter on a square canvas), or objects that name a view and set its camera (yaw,pitch,lens,margin,frame,aspect,fstop,ground,transparent). A name that is not in the catalog is rendered from those fields. A new file lists the preview set (hero and the four elevations). An empty list still means the full catalog, which does not includeproduct. Akit(orkit-*) shot lays each Housing source's parts flat and draws one PNG per finish with Housing's renderer. It runs with--runbefore the Blender pass, needs no Blender, and is never part of the catalog.composite: optional{ "columns", "gap", "name" }. After the batch, the frames are laid up in shot order intoname.png (a 3-column sheet whencolumnsis 3).studio: optional{ "root" }, a studio photography project passed to the pipeline as--studio. Left out when empty.- Paths in
sourcesare stored relative to the mockup file when they sit under that folder.
Housing and Stackup are imported from installed packages, or from sibling checkouts
../lzx-housing and ../lzx-stackup when those packages are not installed.
Blender
Put blender.exe in runtime/blender/ so the app is self-contained. Resolution order is that file, then
LZX_BLENDER, then an install under Program Files\Blender Foundation. The executable is gitignored.
Render quality
Cycles runs GPU-only (OptiX, CUDA, HIP, Metal or oneAPI, whichever the machine has; the CPU is never
ticked alongside it), with adaptive sampling off and OpenImageDenoise on the same GPU. The one quality
knob is RENDER_SAMPLES in runtime/pipeline/rig/settings.py, applied to every shot. The pipeline is
not tuned per shot, so the count is calibrated against the most demanding shot in the catalog and
halved or doubled, never fine-tuned.
To recalibrate: render the hardest shot at the delivered resolution with --samples at the current
value and at half of it, and compare the crops (every render prints <shot> render: N samples in S s).
Keep the lower count if nothing smears or sparkles. More pixels need fewer samples per pixel, so a
calibration done at --scale 0.5 is conservative for the full canvas.
Measured 2026-10-20 on an RTX PRO 2000 laptop GPU, Example VCA hero at --scale 0.5: the GPU-only,
non-adaptive rig rendered 256 samples in 26 s where the previous CPU+GPU adaptive rig took 86 s for the
same image, and 64 samples took 13 s.
Blender's Python is its own. The compose script also looks in %LOCALAPPDATA%\lzx-mockup\blender-site for
the geometry libraries it doesn't ship (shapely, build123d) and for Pillow and skia-python (pcb2blender's SVG
rasteriser; never borrowed from Blender's extensions folder, which Blender re-syncs at start-up). Install them with
Blender's Python:
& "C:\Program Files\Blender Foundation\Blender 5.1\5.1\python\bin\python.exe" -m pip install --target "$env:LOCALAPPDATA\lzx-mockup\blender-site" shapely build123d fonttools pyclipper jsonschema pillow skia-python==138.0
Layout
| Path | Role |
|---|---|
lzxmockup/model.py |
Mockup JSON (sources, shots) |
lzxmockup/resolve.py |
Housing / Stackup tessellation and KiCad paths |
lzxmockup/kit.py |
Kit shots: Housing parts laid flat, software-rendered per finish |
lzxmockup/render.py |
Builds the Blender command |
lzxmockup/product.py |
Website plates, one PNG per sheet finish |
lzxmockup/crop.py |
Fit a render into a square |
runtime/pipeline/compose.py |
Blender entry |
runtime/pipeline/rig/ |
Vendored studio rig |
lzxmockup/gui/ |
Branded Qt shell |