import struct, numpy as np, json from rbxm import parse def load_mesh(path): d=open(path,'rb').read() nl=d.index(b'\n')+1 hs,vs,fs,nv,nf=struct.unpack(' dict(V world verts, F, cf, attachments{name:(R,pos local)}) (R15Fixed pose)""" pk={'376532000':'torso','376530220':'larm','376531012':'rarm','376531300':'lleg','376531703':'rleg'} out={} for pid in pk: inst,props,parent=parse(open(f'ref/{pid}.bin','rb').read()) # find Fixed folder fixed=[r for r in inst if inst[r]=='Folder' and props[r].get('Name')==b'R15Fixed'][0] for r in inst: if inst[r]=='MeshPart' and parent.get(r)==fixed: p=props[r]; name=p['Name'].decode() mid=p['MeshId'].decode().split('id=')[1] pos,nor,F=load_mesh(f'ref/m{mid}.mesh') R=rot(p['CFrame'][0]); t=np.array(p['CFrame'][1],float) size=np.array(p['InitialSize'],float) att={} for a in inst: if inst[a]=='Attachment' and parent.get(a)==r: ap=props[a]; att[ap['Name'].decode()]=(rot(ap['CFrame'][0]).tolist(),[float(x) for x in ap['CFrame'][1]]) out[name]=dict(Vl=pos,F=F,R=R,t=t,size=size,att=att,mesh=mid) return out if __name__=='__main__': ref=load_ref() for n,d in ref.items(): V=d['Vl']; print(n,len(V),len(d['F']),'bbox',V.min(0).round(3),V.max(0).round(3),'size',d['size'].round(3),'t',d['t'].round(3),len(d['att']),list(d['att'])[:12]) pos,nor,F=load_mesh('ref/head.mesh'); print('head',pos.min(0),pos.max(0),len(F))