27 lines
1.5 KiB
Python
27 lines
1.5 KiB
Python
#!/usr/bin/env python3
|
|
"""Prepare an empty composed scene; original room data will replace it later."""
|
|
import json
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
registry_path = ROOT / "assets/.prometeu/index.json"
|
|
registry = json.loads(registry_path.read_text())
|
|
link = next(a for a in registry["assets"] if a["asset_uuid"] == "9bc59c58-4f6b-4b48-bffb-9dfc16ee44d8")
|
|
scene_uuid = "43b397da-4416-488e-85b1-d3bad43abbc0"
|
|
scene_root = "scenes/movement"
|
|
layers = [{"active": True, "glyph_asset_id": link["asset_id"], "tile_size": 16,
|
|
"parallax_factor_x": 1.0, "parallax_factor_y": 1.0,
|
|
"width": 1, "height": 1,
|
|
"tiles": [{"active": False, "glyph_id": 0, "palette_id": 0,
|
|
"flip_x": False, "flip_y": False}]} for _ in range(4)]
|
|
request = {"schema_version": 1, "format": "SCENE/tilemap_v1", "version": 1, "layers": layers}
|
|
(ROOT / "assets" / scene_root / "scene-bank.pack-request.json").write_text(json.dumps(request, indent=2) + "\n")
|
|
if not any(a["asset_uuid"] == scene_uuid for a in registry["assets"]):
|
|
if any(a["root"] == scene_root for a in registry["assets"]):
|
|
raise ValueError("Scene root already registered with a different identity")
|
|
registry["assets"].append({"asset_id": registry["next_asset_id"], "asset_uuid": scene_uuid,
|
|
"root": scene_root, "included_in_build": True})
|
|
registry["next_asset_id"] += 1
|
|
registry_path.write_text(json.dumps(registry, indent=2) + "\n")
|
|
print("Prepared empty movement scene with Link glyph-bank dependency")
|