wgt01: add dev-install flake app (build -> export -> set -> development/)

`nix run .#dev-install` runs build.py, export_mdl.py and make_set.py into
./build, then stages the loose .mdl/.wok/.set into ~/Documents/Neverwinter
Nights/development/ for toolset testing without packing a .hak. Replaces only
twu01* files there; keeps build/ for inspection. gitignore build/ + *.blend.

Verified: 40 .mdl + 40 .wok + twu01.set (CRLF intact) staged into development/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-04 17:14:33 +02:00
co-authored by Claude Opus 4.8
parent 94abd80ade
commit 605d0e73b4
3 changed files with 39 additions and 10 deletions
+3
View File
@@ -0,0 +1,3 @@
build/
*.blend
*.blend1
+11 -10
View File
@@ -51,17 +51,18 @@ nix run .#set -- twu01.set # 3. first-pass .set (CRLF)
## Testing in the toolset — no `.hak` needed ## Testing in the toolset — no `.hak` needed
The toolset reads loose files from **`~/Documents/Neverwinter Nights/development/`** The toolset reads loose files from **`~/Documents/Neverwinter Nights/development/`**
(confirmed present). Drop the build outputs there and they're picked up directly: (confirmed present). One command does build → export → `.set` → stage:
```sh ```sh
DEV="$HOME/Documents/Neverwinter Nights/development" cd wgt01
cp mdl/twu01_*.mdl mdl/twu01_*.wok "$DEV"/ nix run .#dev-install # -> build/ (inspectable) + installs 40 .mdl/.wok + twu01.set into development/
cp twu01.set "$DEV"/
``` ```
Then in the toolset: create a small area using the `twu01` tileset, place tiles, It replaces only the `twu01*` files in `development/` (leaves everything else
walk-test pathing/heights. (Packing a `.hak` with `nwn_erf` is deferred until the alone) and keeps the intermediate outputs in `./build/` for inspection. Then in
set is validated.) the toolset: create a small area using the `twu01` tileset, place tiles, walk-test
pathing/heights. (Packing a `.hak` with `nwn_erf` is deferred until the set is
validated.)
## First-pass caveats — tune before shipping ## First-pass caveats — tune before shipping
@@ -87,6 +88,6 @@ wgt01-tileset-kit` to promote). Commits:
## Next passes ## Next passes
1. Author `twu01palstd.itp` palette so tiles show in the toolset palette tree. 1. Author `twu01palstd.itp` palette so tiles show in the toolset palette tree.
2. (optional) A `dev-install` flake app to copy build outputs into `development/`. 2. Walk-test in the toolset (`nix run .#dev-install`) → tune PathNodes, crossers,
3. Walk-test in the toolset → tune PathNodes, crossers, corner terrains. corner terrains.
4. Pack `.hak` (`nwn_erf`) once validated. 3. Pack `.hak` (`nwn_erf`) once validated.
+25
View File
@@ -58,6 +58,27 @@
--python-exit-code 1 -- "$outdir" "$@" --python-exit-code 1 -- "$outdir" "$@"
''; '';
}; };
# One shot: build -> export -> .set, then stage the loose files into the
# toolset's development/ folder (no .hak). Work dir defaults to ./build.
mkdev = pkgs.writeShellApplication {
name = "wgt-dev-install";
runtimeInputs = [ blender py ];
text = ''
work="''${1:-$PWD/build}"
dev="$HOME/Documents/Neverwinter Nights/development"
mkdir -p "$work/mdl" "$dev"
blend="$work/westgate_urban_foundation_mvp.blend"
blender-4.0.2 --background --python ${gen}/build.py --python-exit-code 1 -- "$blend"
blender-4.0.2 --background "$blend" --python ${gen}/export_mdl.py --python-exit-code 1 -- "$work/mdl"
python ${gen}/make_set.py "$work/twu01.set"
# replace only our own prefix in development/, leave everything else alone
rm -f "$dev"/twu01_*.mdl "$dev"/twu01_*.wok "$dev"/twu01.set
cp "$work"/mdl/twu01_*.mdl "$work"/mdl/twu01_*.wok "$work"/twu01.set "$dev"/
n=$(find "$work/mdl" -name 'twu01_*.mdl' | wc -l)
echo "installed $n tiles + twu01.set -> $dev"
'';
};
in in
{ {
packages.${system}.default = build; packages.${system}.default = build;
@@ -83,6 +104,10 @@
type = "app"; type = "app";
program = "${mkmdl}/bin/wgt-export"; program = "${mkmdl}/bin/wgt-export";
}; };
dev-install = {
type = "app";
program = "${mkdev}/bin/wgt-dev-install";
};
}; };
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {