What the .glb holds · PartScript Help ×

What the .glb holds

PartScript writes glTF 2.0 binary (.glb) itself, with no exporter in between. This page is what is in it, for anyone importing the models into an engine or writing a viewer.

Axes and units

Files are written Z up with +Y back (Blender's axes). The .glb is glTF's Y up with -Z forward: a point (x, y, z) is written (x, z, -y). A prop's front, -Y in a file, is +Z in the .glb. Units are metres.

Nodes

Meshes and materials

Each mesh has a primitive per material. Corners are not shared between faces (flat shading), except in a part ... smooth=1, whose normals are shared. Every material has:

Material names are the host's prefix and the material key (zb_steel_dark, x8a6a42_wood for a colour).

Vertex attributes

POSITION, NORMALas above, flat or smooth
TEXCOORD_0texture coordinates (box-projected in metres over each material's tile size, or the shape's own)
COLOR_0the baked tone, RGBA (grey), normalized 16-bit, linear: grounded shading, facing, per-face variation, fade=
TEXCOORD_1only with steps=True: x is the source line's step index + .5, y the face's use-chain index + .5 (Built.origins)

Showing the baked tone. The vertex colour multiplies the texture. For the PSX look, draw unlit: texture times vertex colour (three.js: MeshBasicMaterial({ map, vertexColors: true })). In a lit engine, use vertex colour as albedo (Godot's vertex_color_use_as_albedo) so the baked shading shows under the engine's own lights.

Godot's runtime glTF loader leaves vertex-colour-as-albedo off on a mesh's first primitive, so a mesh can name a lead_material (kitlib Part.lead_material) to put its least visible material first.

Buildings

A building builds into one model like a prop (its pieces merged), and is also placement data (see the Rust API), for a game that places its own copies of the pieces.