wgt01: real .mdl/.wok export via Neverblender

Neverblender is installed + enabled in this machine's Blender 4.0.2 config and
confirmed working headless via the flake. Add generator/export_mdl.py:
assembles each tile as a Neverblender-native model (AuroraBase dummy/tile,
trimesh, single aabb walkmesh) in its own scene and calls scene.nvb_mdlexport
to emit real ASCII <resref>.mdl + <resref>.wok for all 40 tiles.

Walkmesh surfacemats via create_wok_materials() slot order (walkable Stone=4,
Nonwalk=7) -> verified correct per tile (CP1 all 4, CN1 all 7, BR_1/CE_S mixed).

flake.nix: add `export` app (nix run .#export -- <blend> <outdir> [CODE...]).
AGENTS.md: record the Neverblender node/surfacemat facts and the kit's tools;
note the slot-index (not material-name) surfacemat gotcha.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-04 17:04:41 +02:00
co-authored by Claude Opus 4.8
parent 60af184be5
commit 1284f15595
3 changed files with 148 additions and 8 deletions
+18
View File
@@ -44,6 +44,20 @@
runtimeInputs = [ py ];
text = ''exec python ${gen}/make_wok.py "$@"'';
};
# Real .mdl + .wok export via the Neverblender addon (must be enabled in
# this Blender's user config — confirmed working headless).
mkmdl = pkgs.writeShellApplication {
name = "wgt-export";
runtimeInputs = [ blender ];
text = ''
blend="''${1:?usage: wgt-export <blend> <outdir> [CODE...]}"
outdir="''${2:-mdl}"
shift 2 || true
exec blender-4.0.2 --background "$blend" --python ${gen}/export_mdl.py \
--python-exit-code 1 -- "$outdir" "$@"
'';
};
in
{
packages.${system}.default = build;
@@ -65,6 +79,10 @@
type = "app";
program = "${mkwok}/bin/wgt-wok";
};
export = {
type = "app";
program = "${mkmdl}/bin/wgt-export";
};
};
devShells.${system}.default = pkgs.mkShell {