Files
Igor AherneandClaude Opus 5.5 56d85f6eeb Spellcast3D 0.1.0
A free, open-source Windows app that takes an artist from an idea to game-ready 3D props on their own PC: pictures with Qwen-Image 2.1, 3D models with Pixal3D, an optional repaint of their textures, retopology with TriFlow, LATO.2 or Instant Meshes, and a baker for the final textures. See README.md, and DEVELOPERS.md for building from source.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 02:38:33 +01:00

44 lines
1.8 KiB
Python

"""Score a baked GLB against an analytic fixture.
python -m bakecheck.cli <fixture>/scene.json baked.glb [--policy cage|nearest]
[--basis mikk|per_vertex] [--json report.json]
Run it from code/tests/bake (or with that folder on PYTHONPATH); the fixture folders
come from ``python -m bakecheck.fixtures <dir>``. Exit code 0 = PASS, 1 = FAIL. WARN
lines flag values that pass the hard gates but sit above ~2x the 8-bit floor a correct
baker reaches.
"""
from __future__ import annotations
import argparse
import json
import sys
from collections.abc import Sequence
from pathlib import Path
from . import bakecheck as bc
def main(argv: Sequence[str] | None = None) -> int:
parser = argparse.ArgumentParser(prog="python -m bakecheck.cli", description=__doc__.split("\n\n")[0])
parser.add_argument("scene_json", type=Path, help="scene.json of a plane or sphere fixture")
parser.add_argument("glb", type=Path, help="the baker's output GLB")
parser.add_argument("--policy", choices=bc.POLICIES, default="cage",
help="how the true surface point is found (default: cage, as the baker)")
parser.add_argument("--basis", choices=bc.TANGENT_BASES, default=None,
help="normal-map decoder (default: the basis the GLB declares)")
parser.add_argument("--json", type=Path, help="also write the full report here")
args = parser.parse_args(argv)
spec = json.loads(args.scene_json.read_text(encoding="utf-8"))
verdict, report = bc.score(bc.scene_from_spec(spec["scene"]), args.glb, policy=args.policy, basis=args.basis)
print(verdict)
if args.json:
args.json.write_text(json.dumps(report, indent=1, default=str), encoding="utf-8")
return 0 if verdict.passed else 1
if __name__ == "__main__":
sys.exit(main())