24 lines
1.7 KiB
Python
24 lines
1.7 KiB
Python
"""Item models batch 8 (2026-11-25, Noctis error report): 18 Octo weapon/shield models placed ON their native FileDataIDs
|
|
(ModelFileData already names them, e.g. mace_2h_blood_a_01 146756; skins 8811800+), for 25 displays / 26 Turtle items.
|
|
Converted by item-displays-20261123/build8.py (two_texture_rule + legacy_replaceable_types). Art only: no table changes."""
|
|
import json, hashlib, struct, sys
|
|
from pathlib import Path
|
|
H = Path(__file__).resolve().parent; sys.path.insert(0, str(H))
|
|
import frozen_store as fs
|
|
sha = lambda b: hashlib.sha256(b).hexdigest(); md5 = lambda b: hashlib.md5(b).hexdigest()
|
|
ART = json.load(open('/mnt/Games/@project/gateway/runtime/continuation-20261113/claude-lane/item-displays-20261123/add8-models.json'))['art']
|
|
store = fs.Store(); root = store.root; assert store.layout['root_md5'] == fs.ROOT
|
|
have = set()
|
|
for g in store.layout['groups']:
|
|
f = 0
|
|
for (d,) in struct.iter_unpack('<I', memoryview(root)[g['ids_offset']:g['ckeys_offset']]): f += d; have.add(f); f += 1
|
|
assets = []
|
|
for a in ART:
|
|
raw = Path(a['file']).read_bytes(); assert md5(raw) == a['ckey'] and a['file_data_id'] not in have, a['file_data_id']
|
|
assets.append(dict(a, sha256=sha(raw)))
|
|
(H / 'pins').mkdir(exist_ok=True)
|
|
art = H / 'pins' / 'models8.json'; raw = (json.dumps(dict(type='art', parent_root=fs.ROOT, assets=assets), indent=1) + '\n').encode(); art.write_bytes(raw)
|
|
(H / 'components.json').write_text(json.dumps([dict(file=str(art), sha256=sha(raw), type='art')], indent=2) + '\n')
|
|
(H / 'selected-root.json').write_text(json.dumps(dict(parent_build=fs.BUILD, parent_root=fs.ROOT, decoded_root_sha256=sha(root), parent_root_sha256=sha(root)), indent=2) + '\n')
|
|
print('assets', len(assets))
|