In-game Kerbal Space Program 1.12.5 plugin that exports the active vessel's geometry to a lightweight glTF on vessel load, serves it over a small built-in HTTP listener, and publishes a "model ready" MQTT notification so external consoles, dashboards, or mods can fetch and render the ship.
Pairs with KSPBridge — KSPEVU reuses the same Mosquitto broker for notifications, while KSPBridge continues to publish realtime vessel state (telemetry + staging).
Full pipeline end-to-end. Plugin captures vessels, writes glTF to a content-addressable cache, serves the files over HTTP, publishes an MQTT notification, and a bundled web viewer renders each ship as a clean solid+wireframe schematic with per-design overrides persisted to disk.
- Event hook —
GameEvents.onVesselChange+onVesselWasModified. The initial vessel-change snapshot is deferred by twoFixedUpdateframes so KSP has finished instantiating part models andModuleJettisonhas resolved its transform references before capture. - Snapshot — walks
vessel.parts, pulls each part'sMeshFilterdata. Runs a filter pass that:- drops inactive renderers, hidden layers, particle-system volumes
- bounds-caps general hull meshes at 25 m and 20 000 verts
- tags any mesh under a
ModuleJettisonshroud root withIsShroud / JettisonName / HeuristicallyHidden - relaxes the active/renderer/size checks for shrouds AND children
of any
ModuleDeployablePartso connecting boom/panel meshes survive KSP'sSetActive(false)parking - force-samples
ModuleDeployableSolarPanelanimations to their end-frame so panels export in their deployed pose
- Structural hash — SHA-256 over per-part
persistentId, name, parent,orgPos/orgRot. Content-addressable cache key in<cacheDir>/<hash>.glb. Identical designs share one file. - Custom
.glbwriter — hand-rolled glTF 2.0 packer (GlbWriter.cs). No native deps, Mono-friendly. Emits:- per-part root node with
orgPos+orgRot - one child node per
ModuleJettisonshroud with glTFextras({shroud:true, jettisonName, heuristicallyHidden}) uint16indices when the mesh fits,uint32otherwise- content-hash-based primitive dedup so radially-repeated parts (4 boosters, 8 panels, truss segments) share one buffer range
- per-part root node with
- HTTP serve — in-plugin
HttpListeneron port 8090 (default). Routes:GET /vessel/<hash>.glb— serve cached glbGET /viewer/— the bundled web viewerGET /overrides/<hash>.json— per-design shroud overridesPUT /overrides/<hash>.json— atomic write, 64 KB max, JSON object
- MQTT notification — publishes
ksp/vessel_model/ready(retained) via the same Mosquitto broker KSPBridge uses.
GameData/KSPEVU/viewer/index.html — Three.js r128 + glTF loader +
mqtt.js. Renders each part as a double-sided fill, a bright silhouette
outline via inverted-hull, and feature-edge overlay lines (not full
triangulation). Subscribes to the ready topic, fetches the referenced
glb, fits the camera to the vessel bounds.
Shroud editor: "EDIT SHROUDS" button flips the viewer into a click-to-
toggle mode. Each shroud is visible in edit mode, colour-coded by
current override state. Clicks toggle that shroud's overrides.show
entry and auto-save to the plugin via PUT /overrides/<hash>.json.
Default is "all shrouds hidden" for a clean schematic look; any the
user clicks are persisted per-design-hash.
- docs/ARCHITECTURE.md — full v0.1 plan
- THIRD-PARTY-NOTICES.md — bundled libraries
- Companion plugin: KSPBridge
MIT. See LICENSE.