Livery Export and Application System
Relevant source files
The following files were used as context for generating this wiki page:
The Livery Export and Application System manages the transformation of dynamic sponsor artwork into immutable 3D assets for use in simulator recordings and video renders. This system extracts confirmed bids from the live auction website, fits them to physical car panels, and generates render-ready Blender and glTF models.
Sources: apps/website/LIVERY-EXPORT.md:3-8, apps/mini-livery/README.md:1-5
System Architecture and Data Flow
The system operates as a multi-stage pipeline that bridges the live web auction with the 3D simulation environment. It ensures that the current state of paid placements is frozen into a revision-controlled snapshot.
Asset Pipeline Overview
The following diagram illustrates the flow from web-based auction data to baked 3D models.
This pipeline produces an immutable revision/layout pair that cannot be changed by later bids.
Sources: apps/website/LIVERY-EXPORT.md:10-21, apps/website/README.md:118-120
Livery Layout and Projection
The system uses layout.json to define panel locations and sizes in Blender Z-up coordinates. A reprojection script, rebuild-layout.py, maps these panels onto the original CARLA Mini Cooper S 2021 geometry.
Projection Logic
- Ray Casting: The script casts rays from the defined panel centers toward the car body mesh to find hit points.
- UV Mapping: It generates 0–1 UV coordinates for each logo surface, ensuring artwork fits without stretching.
- Surface Verification: The system verifies that the projected mesh covers at least 90% of the intended panel area.
- Markers: It generates "availability markers" (dashed borders and placeholder text) for unclaimed spots.
Sources: apps/mini-livery/rebuild-layout.py:35-80, apps/mini-livery/README.md:7-13
Export and Snapshot Creation
Running npm run export:livery creates a directory containing the specific revision data.
| Component | Description |
|---|---|
livery.json | Manifest listing advertisers, mesh names, and physical dimensions. |
textures/ad-XX.png | Transparent PNGs fitted to panels with 5% margins. |
source-mini.glb | The untextured source model used as a base. |
sha256.json | Checksums for verifying the integrity of all exported assets. |
Sources: apps/website/LIVERY-EXPORT.md:5-10, apps/mini-livery/sponsors/r7-layout4/manifest.json
Sponsor Model Generation
The apply-livery.py script executes in Blender background mode to embed textures into the geometry. It performs the following actions:
- Verification: Validates asset checksums against
sha256.jsonbefore processing. - Cleanup: Removes all
availability_markermeshes and panels belonging to unpaid or retired spots. - Material Application: Creates a new "Principled BSDF" material for each paid slot, setting
Roughness(0.55) andMetallic(0.05). - Alpha Blending: Sets
surface_render_methodto "DITHERED" and ensures alpha transparency is preserved to reveal the underlying car paint. - Immutable Export: Saves the result as
sponsored-mini.blendandsponsored-mini.glb.
Sources: apps/website/scripts/apply-livery.py:15-68, apps/website/LIVERY-EXPORT.md:17-25
Simulator Integration
The exported assets are intended for direct use in high-fidelity renderers but require specific handling for native CARLA integration.
For native CARLA rendering, the sponsor surfaces must be integrated as attached decal components or baked into CARLA material UV maps, as the simulator does not support multiple independent UV-mapped surfaces on a single material by default.
Sources: apps/website/LIVERY-EXPORT.md:33-45, apps/mini-livery/sponsors/README.md:17-24
Summary
The Livery Export and Application System provides a deterministic path for moving real-world auction winners into a virtual environment. It prioritizes data integrity through SHA-256 validation and maintains visual consistency by baking specific transforms and margins into exported textures. The resulting assets are immutable snapshots, ensuring that a specific video recording can always be traced back to its corresponding livery revision.