Environment Package
Tools for attaching a baked scene environment to a Luxar store. The environment
lights meshes authored with material="physical" and is stored as a root-level
sidecar rather than as scene geometry.
Baked scene environments (luxar env bake / luxar env attach).
The scene environment lights material="physical" meshes
(docs/guides/specs/MESH_PHYSICAL_MATERIALS_SPEC.md §3.3). A live viewer can
capture it from the scene itself; this package moves that cost off the viewer
for a published scene by storing the six captured cube faces in the store as a
root-level environment/ sidecar group. luxar.environment.container defines the
blob the viewer hands back, luxar.environment.attach writes it into a store, and
the luxar env bake CLI drives the headless capture end to end.
- class luxar.environment.AttachReport(store: Path, status: str, array_name: str, digest: str, scene_content_hash: str, resolution: int, removed: List[str] = <factory>)[source]
Bases:
objectWhat
attach_environment()did.
- luxar.environment.attach_environment(store: str | Path, faces: str | Path | bytes, *, force: bool = False) AttachReport[source]
Attach the container at
faces(a path or its bytes) tostore.Refuses a non-scene store, a malformed container (see
luxar.environment.container), and — unlessforce— a map whosescene_content_hashis not the store’s current rootcontent_hash: the viewer would ignore such a map as stale anyway, so writing it would only look like success.
- luxar.environment.pack(header: Dict[str, Any], faces: ndarray) bytes[source]
Serialize
header+facesinto one container blob.facesmust beuint16of shape(6, H, W, 4)withH == W == header["resolution"]; the header must carryREQUIRED_HEADER_KEYS. Validated up front so a malformed blob is never produced.
- luxar.environment.unpack(data: bytes) Tuple[Dict[str, Any], ndarray][source]
Parse a container blob into
(header, faces).Raises
ValueErrornaming the first thing wrong: magic, header length, header JSON, a missing required key, or a sample payload whose length does not match6 * resolution² * 4halves.
See Also
Luxar CLI Reference — the
luxar env bakeandluxar env attachcommandsMesh Package — the geometry type that consumes scene environments