Files
sow-module-tilesets/wgt01/flake.nix
T
archvillainetteandClaude Opus 4.8 60af184be5 wgt01: tileset build guide + 40-tile generator kit
AGENTS.md: NWN:EE tileset construction reference (constraints, .mdl/.wok
walkmesh rules, .set format, Blender->NWN pipeline, prototype->NWN mapping).

wgt01/: Westgate Urban Foundation MVP kit.
- generator/tiles.py: single source of truth (40-tile table, materials,
  12x12 test map, pure paint/height/walkmesh/.set derivations).
- generator/build.py: Blender 4.0.2 scene generator (VIS_/WOK_/BLOCK_ per
  tile, edge metadata, library grid + 12x12 district previews).
- generator/make_wok.py: ASCII walkmesh emitter (verts+faces+surfacemat+AABB
  tree) from the same geometry.
- generator/make_set.py: first-pass twu01.set (CRLF) from the tile grammar.
- flake.nix: build/wok/set apps + dev shell (pinned Blender 4.0.2, NWN tools).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-04 16:55:43 +02:00

84 lines
2.2 KiB
Nix

{
description = "Westgate Urban Foundation MVP — Blender 4.0.2 tileset generator kit";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# Reuse the machine's pinned Blender 4.0.2 + NWN toolchain via the repo overlay.
theorem.url = "git+file:///nix/nixos";
};
outputs =
{
self,
nixpkgs,
theorem,
}:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [ theorem.overlays.default ];
};
blender = pkgs.blender-402-bin; # /bin/blender-4.0.2 (NWN needs 4.0.x, not 5.x)
py = pkgs.python3.withPackages (ps: [ ps.mcp ]);
gen = ./generator; # whole dir so tiles.py sits beside each script for import
build = pkgs.writeShellApplication {
name = "wgt-build";
runtimeInputs = [ blender ];
text = ''
out="''${1:-westgate_urban_foundation_mvp.blend}"
exec blender-4.0.2 --background --python ${gen}/build.py -- "$out"
'';
};
mkset = pkgs.writeShellApplication {
name = "wgt-set";
runtimeInputs = [ py ];
text = ''exec python ${gen}/make_set.py "$@"'';
};
mkwok = pkgs.writeShellApplication {
name = "wgt-wok";
runtimeInputs = [ py ];
text = ''exec python ${gen}/make_wok.py "$@"'';
};
in
{
packages.${system}.default = build;
apps.${system} = {
default = {
type = "app";
program = "${build}/bin/wgt-build";
};
build = {
type = "app";
program = "${build}/bin/wgt-build";
};
set = {
type = "app";
program = "${mkset}/bin/wgt-set";
};
wok = {
type = "app";
program = "${mkwok}/bin/wgt-wok";
};
};
devShells.${system}.default = pkgs.mkShell {
packages = [
blender
py
pkgs.neverwinter-nim
pkgs.cleanmodels
];
shellHook = ''
export BLENDER_BIN=${blender}/bin/blender-4.0.2
echo "wgt01 dev shell — build: blender-4.0.2 --background --python generator/build.py -- out.blend" >&2
'';
};
};
}