# `forma-ue`: Optional Unreal Engine 5 & OpenUSD Addon Blueprint - **Status:** Blueprint / Help Wanted (not yet implemented) - **Target:** Opt-in workspace crate (`crates/forma-ue`, excluded from `default-members`) - **Core Impact:** `0 bytes` on core `forma` / `forma.wasm`, `0 tokens` on core `forma-mcp` - **Design Review:** Required before multi-PR implementation (see [`CONTRIBUTING.md`](../CONTRIBUTING.md)) --- ## 1. What Works Today Out of the Box (`v0.4.2`) - **Spec-Compliant `.glb` (glTF 2.0 Y-Up) into UE5 Interchange:** Named `pbrMetallicRoughness` material slots (`baseColorFactor`, `metallicFactor`, `roughnessFactor`) and per-face material assignment. - **Clean Shading Normals:** `smooth(angle=35, weighted=true)` computes area/angle-weighted auto-smooth normals with welded vertices. - **Game-Ready `TEXCOORD_0` UVs:** Pure-Rust LSCM conformal unwrapping + uniform texel density + non-overlapping `[0, 1]^2` atlas packing (`76.32%` Tier-1 / `75.66%` 12-mesh mean utilization, `1.0038` stretch, `0` inversions). - **Multi-Object Named Scene Graphs:** `--scene` / `scene: true` preserves named parts as separate glTF nodes with shared `Arc` buffer instancing. - **Watertight LOD Decimation:** Link-Condition QEM `decimate(ratio=...)`. --- ## 2. Current Gaps vs. a Dedicated UE5 Static-Mesh Pipeline - No `.usda`/`.usd` (OpenUSD) or `.fbx` export yet. - No automatic `UCX_` / `UBX_` collision hulls, no `TEXCOORD_1` lightmap UV2 channel, no auto-bundled `LOD0`–`LOD3` export, and no MikkTSpace-style vertex `TANGENT` attributes. - Core Forma is static hard-surface modeling only — rigging, skeletal animation, and map baking are intentionally out of scope for core and planned for separate companion tooling. --- ## 3. Zero-Bloat `forma-ue` Addon Architecture - **Workspace isolation:** `crates/forma-ue` listed in `workspace.members`, excluded from `default-members` (`0 bytes` & `0 tokens` impact on core `forma` / `forma-mcp` / `forma.wasm`). - **Invocation:** Standalone `forma-ue` CLI, Git-style `forma ue ...` plugin dispatch, opt-in `forma-ue --mcp` (~250–350 tokens), optional `--features ue` flag (~50 KB delta, 0 new crates). - **Core Capabilities:** 1. **UE-Native Scale & Scene Welding:** Centimeter scale (`1 m → 100 cm`) + vertex welding on multi-node scene exports for clean UE5 Interchange import. 2. **Auto Collision Hulls (`UCX_` / `UBX_`):** Pure-Rust 3D QuickHull per connected component/part emitted as sibling nodes matching UE's collision naming (`UCX__00`, `UBX__00`). 3. **Lightmap UV2 (`TEXCOORD_1`):** Second LSCM unwrap pass with wider bleed margin (`0.02–0.04`) written alongside `TEXCOORD_0`. 4. **Auto-LOD Chain (`LOD0`–`LOD3`):** Reuses Link-Condition QEM `decimate_mesh()` at configurable ratios (`1.0 / 0.5 / 0.25 / 0.12`). 5. **Zero-Dep Pure-Rust `.usda` (OpenUSD) Exporter (~250–350 LOC):** `upAxis = "Z"`, `metersPerUnit = 0.01`, `UsdGeomMesh`, `primvars:st` + `primvars:st1`, `UsdPreviewSurface`, `UsdGeomSubset`, and `UCX_` prims — native in UE5 Interchange/USD Stage with zero C++ FBX SDK bloat. 6. **Asset Hygiene:** Optional `SM_` naming, bottom-center/origin pivots, and MikkTSpace-style vertex `TANGENT` attributes.