From 48c44abd4ab8ad50f870fc35ff87976df8f92a49 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 20 Aug 2026 14:43:37 +0200 Subject: [PATCH] fix(IconForge): point the texture path at the real dump directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit render.py was lifted from the scratch pipeline with its default TEXDIR still aimed at tools/IconExtract's build output — a tool that is not in the repo. forge.py overrides the value, so the icons built correctly and the staleness was invisible; anyone importing render.py directly would have been sent to a path that never existed. Default now matches where tools/MosswartArt actually writes, and a missing texture prints a warning instead of silently dropping out: a partial texture set renders some parts flat grey, which reads as a lighting bug rather than a missing extraction step. Both icons still reproduce byte-for-byte. Co-Authored-By: Claude Opus 5 --- tools/IconForge/render.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/IconForge/render.py b/tools/IconForge/render.py index 6c454b5a..2dbb8527 100644 --- a/tools/IconForge/render.py +++ b/tools/IconForge/render.py @@ -1,7 +1,7 @@ """Software rasterizer for the exported mosswart mesh. -Loads the JSON dumped by tools/MosswartArt, textures dumped by tools/IconExtract, -and renders a lit, shaded, supersampled image. Deliberately simple: z-buffer, +Loads the geometry and textures dumped by tools/MosswartArt into work/, and +renders a lit, shaded, supersampled image. Deliberately simple: z-buffer, perspective camera, Lambert key/fill/rim + Blinn specular for wet skin. """ import json, glob, os, math @@ -9,8 +9,9 @@ import numpy as np from PIL import Image HERE = os.path.dirname(os.path.abspath(__file__)) -ROOT = os.path.abspath(os.path.join(HERE, "..", "..")) -TEXDIR = os.path.join(ROOT, "tools", "IconExtract", "bin", "Release", "net10.0", "out") +# Default matches where tools/MosswartArt writes its texture dump. forge.py +# overrides this when --work points elsewhere. +TEXDIR = os.path.join(HERE, "work", "textures") # ---------------------------------------------------------------- data loading @@ -19,6 +20,10 @@ def load_textures(ids): for tid in ids: hits = glob.glob(os.path.join(TEXDIR, tid + "_*.png")) if not hits: + # Say so: a partial texture set renders some parts flat grey, which + # is easy to mistake for a lighting problem rather than a missing + # extraction step. + print(f" WARNING: no texture found for {tid} in {TEXDIR}") continue im = Image.open(hits[0]).convert("RGBA") out[tid] = np.asarray(im, dtype=np.float32) / 255.0