39 lines
3.1 KiB
Python
39 lines
3.1 KiB
Python
"""#28 (2026-11-25): Tauren male /rude from Octo TaurenMale anim 73 with explicit digitigrade leg map (hip/knee/hock), replacing 9e58 (Undead source, legs mis-chained: ankle->knee)."""
|
|
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
|
|
C=fs.casc
|
|
SP=Path('/tmp/claude-1000/-home-praxis-Projects/8c775e16-46f6-4cfc-9a63-844a8b79c754/scratchpad')
|
|
BAKE=Path('/mnt/Games/@project/gateway/runtime/continuation-20261113/claude-lane/db2-bake-20261122')
|
|
INPUTS={968705:('character/tauren/male/taurenmale_hd.m2',H/'inputs/before-tm_hd.new.m2',H/'inputs/hd.m2','Octo TaurenMale /rude (anim 73) retargeted onto native Tauren male; explicit leg map hip/knee/hock (owner #28: legs static)'),
|
|
968734:('taurenmale_hd 0073-00.anim',H/'inputs/before-tm_rude.new.anim',H/'inputs/hd.anim','Octo TaurenMale /rude (anim 73) retargeted onto native Tauren male; explicit leg map hip/knee/hock (owner #28: legs static)'),
|
|
122055:('character/tauren/male/taurenmale.m2',H/'inputs/before-tm_sd.new.m2',H/'inputs/sd.m2','Octo TaurenMale /rude (anim 73) retargeted onto native Tauren male; explicit leg map hip/knee/hock (owner #28: legs static)'),
|
|
472114:('taurenmale 0073-00.anim',H/'inputs/before-tm_sd_rude.new.anim',H/'inputs/sd.anim','Octo TaurenMale /rude (anim 73) retargeted onto native Tauren male; explicit leg map hip/knee/hock (owner #28: legs static)')}
|
|
root=(fs.PARENT/'decoded/root.bin').read_bytes(); lay=C.root_groups(root); assert lay['root_md5']==fs.ROOT
|
|
md5=lambda b:hashlib.md5(b).hexdigest(); sha=lambda b:hashlib.sha256(b).hexdigest()
|
|
cells={f:[] for f in INPUTS}
|
|
for g in lay['groups']:
|
|
f=0
|
|
for i,(delta,) in enumerate(struct.iter_unpack('<I',memoryview(root)[g['ids_offset']:g['ckeys_offset']])):
|
|
f+=delta
|
|
if f in cells: cells[f].append((g,g['ckeys_offset']+i*16))
|
|
f+=1
|
|
patched=bytearray(root);pins=[]
|
|
for fid,(name,before,after,why) in sorted(INPUTS.items()):
|
|
old=before.read_bytes();new=after.read_bytes()
|
|
en=[(g,at) for g,at in cells[fid] if g['locale']&2 and not g.get('flags1')]
|
|
assert len(en)==1,(fid,len(en)); g,at=en[0]; ckey=root[at:at+16].hex()
|
|
assert ckey==md5(old),(fid,ckey,md5(old))
|
|
assert sum(1 for g2,a2 in cells[fid] if root[a2:a2+16].hex()==ckey)==1
|
|
patched[at:at+16]=bytes.fromhex(md5(new))
|
|
d=H/'pins'/str(fid); d.mkdir(parents=True,exist_ok=True)
|
|
(d/'before.bin').write_bytes(old);(d/'after.bin').write_bytes(new)
|
|
pin=dict(fdid=fid,table=name,parent_root=fs.ROOT,selected_group={},original_decoded=dict(file='before.bin',md5=ckey,sha256=sha(old)),encrypted_original=False,
|
|
after_decoded=dict(file='after.bin',md5=md5(new),sha256=sha(new)),reason=why)
|
|
(d/'pin.json').write_text(json.dumps(pin,indent=1)+'\n')
|
|
pins.append(dict(file=str(d/'pin.json'),sha256=sha((d/'pin.json').read_bytes()),type='wdc_enus'))
|
|
(H/'components.json').write_text(json.dumps(pins,indent=2)+'\n')
|
|
(H/'selected-root.json').write_text(json.dumps(dict(parent_build=fs.BUILD,parent_root=fs.ROOT,decoded_root_sha256=sha(bytes(patched)),parent_root_sha256=sha(root)),indent=2)+'\n')
|
|
print('pins',len(pins))
|