import struct d=open("content/VIDEO/GEO/BLX_COP.BGF","rb").read() def walk(d,p,end,depth,out): while p+3<=end: tw=struct.unpack_from("end:return ln=d[p] if lw==1 else (struct.unpack_from("end:return out.append((depth,cid,p,ln,d[p:p+ln])) if cid in (0x03,0x40,0x41,0x42,0x46,0x20,0x30,0x31,0x10,0x70,0x48,0x21): walk(d,p,p+ln,depth+1,out) p+=ln if cid==0x0005:break out=[]; walk(d,8,len(d),0,out) # For each PMESH: read verts (XYZ_UV, stride20), faces from PCONN(ppf) + CONN(tris) # Collect global stats: uv range, bbox, boundary edges per pmesh import collections pm_idx=0 tot_uv_min=[1e9,1e9]; tot_uv_max=[-1e9,-1e9] bbmin=[1e9]*3; bbmax=[-1e9]*3 i=0 while i < len(out): depth,cid,p,ln,body=out[i] if cid==0x88: # vertex XYZ_UV inside a pmesh cnt=ln//20 verts=[struct.unpack_from("<5f",body,k*20) for k in range(cnt)] # gather following face chunks until next vertex/pmesh boundary faces=[] j=i+1 while j=1: # PCONN ppf=b2[0]; n=(l2-1)//4 idx=[struct.unpack_from("=12: # CONN trilist n=l2//4 idx=[struct.unpack_from("