upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tools/batch_glb.py
diff options
context:
space:
mode:
authorRomain PINSOLLE <romain.pins@gmail.com>2026-11-24 16:11:13 +0100
committerRomain PINSOLLE <romain.pins@gmail.com>2026-11-24 16:11:13 +0100
commit540e522b364b884abc19d7d13ee4e687307de02f (patch)
tree79345be49b7ee291fbcab56d09d676fb2952e1a6 /tools/batch_glb.py
parenta28927849adb4e40dfdec8c32fb6758dcd205a37 (diff)
batch_glb: exit 2 for a bad input or output folder (BATCH-GLB-USAGE-EXIT-STATUS)
A missing input folder or an output path that cannot be created raised ValueError/OSError in batch_convert and main returned 1, the code the docstring reserves for a failed model. Those errors now return 2, like argparse usage errors. Per-model errors are caught in convert_single and still return 1.
Diffstat (limited to 'tools/batch_glb.py')
-rw-r--r--tools/batch_glb.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/batch_glb.py b/tools/batch_glb.py
index 12f1949a0..a9cdeb625 100644
--- a/tools/batch_glb.py
+++ b/tools/batch_glb.py
@@ -6,7 +6,7 @@ and embed textures (.png or .dds) directly into glTF materials. A texture
6that cannot be read or decoded is left out of that model and reported (one 6that cannot be read or decoded is left out of that model and reported (one
7line each, counted in the summary), never dropped silently; a model that 7line each, counted in the summary), never dropped silently; a model that
8fails to convert is named with its error. Exit status is 1 only when a 8fails to convert is named with its error. Exit status is 1 only when a
9model failed. 9model failed. A missing input folder or an output path that cannot be created exits 2.
10 10
11Usage: 11Usage:
12 python -I tools/batch_glb.py <in_dir> <out_dir> [--jobs N] [--up z|y] [--textures <dir>] 12 python -I tools/batch_glb.py <in_dir> <out_dir> [--jobs N] [--up z|y] [--textures <dir>]
@@ -264,7 +264,7 @@ def main(argv: list[str] | None = None) -> int:
264 ) 264 )
265 except (ValueError, OSError) as exc: 265 except (ValueError, OSError) as exc:
266 print(f"ERROR: {exc}", file=sys.stderr) 266 print(f"ERROR: {exc}", file=sys.stderr)
267 return 1 267 return 2
268 elapsed = time.monotonic() - t0 268 elapsed = time.monotonic() - t0
269 269
270 for path, err in stats["failures"]: 270 for path, err in stats["failures"]: