37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def main() -> int:
|
|
parser = argparse.ArgumentParser(description="Render renameable item previews from resource pack model JSON.")
|
|
parser.add_argument("--manifest", default="build/renameable-items.json", help="Path to the generated manifest")
|
|
parser.add_argument("--pack-root", default="resourcepack", help="Path to the resource pack root")
|
|
parser.add_argument("--output-dir", default="build", help="Directory where renders should be written")
|
|
args = parser.parse_args()
|
|
|
|
repo_root = Path(__file__).resolve().parents[2]
|
|
renderer_script = repo_root / "build" / "scripts" / "render_models.py"
|
|
|
|
command = [
|
|
sys.executable,
|
|
str(renderer_script),
|
|
"--manifest",
|
|
str((repo_root / args.manifest).resolve()),
|
|
"--pack-root",
|
|
str((repo_root / args.pack_root).resolve()),
|
|
"--output-dir",
|
|
str((repo_root / args.output_dir).resolve()),
|
|
]
|
|
|
|
completed = subprocess.run(command, cwd=repo_root)
|
|
|
|
return completed.returncode
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main()) |