editor: readable names in tool status and problem texts, waypoint reference buttons shorten to fit, x/y/z fields stack in a narrow inspector, whole-number outliner filter for tiles, z-buffered mesh import preview, gltf export of the selection only and of collision as a separate mesh

This commit is contained in:
MineTec committed 2026-11-07 13:39:54 +01:00
1 parent d12c642b37
commit 01208aa36f
30 files changed
+840 -100

No files matched your search

+19 -5
View File
@@ -88,7 +88,9 @@ Invisible collision volumes (Invisible wall/block, colliders) are drawn transluc
"Invisible collision volumes").
### Mesh import (File → Import mesh)
File chooser, then a dialog: rotatable preview (shown as in game) with a 1-cell grid and a llama-sized marker, source
File chooser, then a dialog: rotatable preview (shown as in game; flat shading with a small z-buffer at
twice the panel size, `PreviewRaster` – before 2026-11-07 the triangles were sorted by centroid and hidden
faces showed as slivers) with a 1-cell grid and a llama-sized marker, source
info, up axis, unit scale and "fit largest side to n cells", turn, mirror, stand on the ground,
texture size and UV precision, double-sided, lit, collision **from the mesh / simplified invisible
box / none** + material, warnings (densest cell vs. the 8000-vertex limit, larger than the grid).
@@ -117,9 +119,19 @@ and keeps the placement.
library tiles, left the re-imported OBJ as a mesh brush).
### glTF export (File → Export level as glTF…, `editor.tools.gltf`)
* `GltfExport.collect(scene, Options(objects), skip)` runs a private `SceneRenderer` on the
* `GltfExport.collect(scene, Options(objects, collision, only), skip)` runs a private `SceneRenderer` on the
scene and takes exactly what the viewport draws: tile instances (scene tiles + compiled brushes and
meshes), optionally object models; `excluded` tiles and (option) hidden nodes are skipped.
* **Selection only** (2026-11-07): `only` = the selected nodes; an instance is exported when its owner
(tile, brush that the compiled tile belongs to, object) is in it. Nothing exportable → status message,
no file.
* **Collision as separate mesh** (2026-11-07): mesh/node `collision` with one primitive per collision
material (`collision_<mat>`, unlit base colour: 0 grey, 16 green, 30 red, others by hue, double-sided,
no UVs). Polygons of scene tiles (`Tile.worldCollisionPolygons`, so "No collision" tiles have none) and of
the compiled brush tiles (`SceneRenderer.brushOutput()`, owner = the brush instance in the same order),
fan-triangulated in game space and wound like the polygon's own plane normal (floors face +y).
`GltfExportTest.selectionOnlyAndCollisionMesh` / `collisionFloorsFaceUp`: validation, box bounds of both
nodes, a single tile's collision ≤ its polygons, round trip through Import mesh, outward box.
Vertices are baked to world (export) space, deduplicated per primitive; one primitive per
page × blend class × double-sided, grouped into the meshes/nodes `level` and `objects`.
* Attributes: POSITION (exact min/max), NORMAL (unit; zero vertex normals → face normal; degenerate
@@ -140,7 +152,9 @@ and keeps the placement.
(local install)** imports the village .glb without complaint: meshes `level` 26 355 tris /
`objects` 9 684, 16 + 15 materials, 14 images, vertex colours and UVs
(`img/editor/geo_gltf_blender.jpg`, Workbench render); the editor's own Import mesh reads it back
(26 403 triangles, 16 materials, 15 textured, `img/editor/geo_gltf_export.jpg`).
(26 403 triangles, 16 materials, 15 textured). `img/editor/geo_gltf_export.jpg` (retaken 2026-11-07): export
dialog with the new options and the village exported with **Collision as separate mesh** read back
(45 558 triangles, 25 materials; red = material 30 under the islands), z-buffered preview.
Village: 36 087 triangles with objects, 2.9 MB .glb; without objects 2.1 MB.
### Handedness of files (fix 2026-11-07)
@@ -245,7 +259,7 @@ between neighbouring floors at the same height; brush compiler warnings.
box/platform/floor tops.
* Library insert keeps tiles cell-aligned (anchor = whole cells); objects are not part of the library
(see the objects agent's prefabs / object catalogue).
* glTF export: whole level only (no "selection" variant), no collision export (the OBJ export has it),
no texture animations, additive surfaces become plain alpha blending. (Handedness: fixed, see
* glTF export: no texture animations, additive surfaces become plain alpha blending; the collision node
has no tile-swap alternatives. (Handedness: fixed, see
"Handedness of files" above.)
* `TextureImport` packs imported textures at one size per insert (largest texture, ≤ 256).