46 lines
1.5 KiB
Python
46 lines
1.5 KiB
Python
"""Validate a scene package (or a legacy import) without a GPU.
|
|
|
|
Stage 2 deliverable (``docs/architecture/studio-3d-stages.md``): the checks the
|
|
loader and the compiler must agree on, runnable on a build machine and in CI.
|
|
|
|
Until stage 2 lands, importing an asset is not implemented; the argument parsing
|
|
and the exit contract exist so the CI job can be wired now.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import json
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
_STAGE = "stage 2 (asset contracts)"
|
|
|
|
|
|
def main(argv: list[str] | None = None) -> int:
|
|
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
|
parser.add_argument("asset", type=Path, help="scene package or legacy asset directory")
|
|
parser.add_argument("--housing", type=Path, default=None, help="housing GLB to check")
|
|
parser.add_argument("--json", action="store_true", help="machine-readable output")
|
|
args = parser.parse_args(argv)
|
|
|
|
report = {
|
|
"status": "not_implemented",
|
|
"asset": str(args.asset),
|
|
"stage": _STAGE,
|
|
"note": (
|
|
"Checks: manifest/schema, signature and entry hashes, coordinate frame "
|
|
"and units, part roles, index ranges, binding weights and domain, "
|
|
"geometry/domain match against the device description."
|
|
),
|
|
}
|
|
if args.json:
|
|
print(json.dumps(report, indent=2, ensure_ascii=False))
|
|
else:
|
|
print(f"{report['status']}: {report['note']}")
|
|
return 2
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|