"""Re-imports every exported FBX into an empty scene and reports what Unreal will get. Headless: blender.exe -b --factory-startup --python pd_verify_fbx.py Writes fbx/verify_report.json.""" import bpy, os, math, json F = r"D:\HADAL - The Descent\models\pressure-door\fbx" out = {} for fn in sorted(os.listdir(F)): if not fn.endswith(".fbx"): continue bpy.ops.wm.read_homefile(use_empty=True) bpy.ops.import_scene.fbx(filepath=os.path.join(F, fn)) objs = list(bpy.context.scene.objects) meshes = [o for o in objs if o.type == 'MESH' and not o.name.startswith("UCX_")] rep = {"objects": len(objs), "ucx": sorted(o.name for o in objs if o.name.startswith("UCX_"))[:3] + ["..."] if len([o for o in objs if o.name.startswith("UCX_")]) > 3 else sorted(o.name for o in objs if o.name.startswith("UCX_"))} parts = {} for m in meshes: me = m.data ws = [m.matrix_world @ v.co for v in me.vertices] parts[m.name] = dict(loc=[round(c, 3) for c in m.location], rot_deg=[round(math.degrees(c), 1) for c in m.rotation_euler], scale=[round(c, 3) for c in m.scale], bbox_lo=[round(min(p[i] for p in ws), 3) for i in range(3)], bbox_hi=[round(max(p[i] for p in ws), 3) for i in range(3)], uvs=[l.name for l in me.uv_layers], mats=[x.name for x in me.materials], tris=sum(len(p.vertices) - 2 for p in me.polygons), ngons=sum(1 for p in me.polygons if len(p.vertices) > 4)) rep["meshes"] = parts if len(parts) <= 2 else {k: dict(tris=v["tris"], loc=v["loc"]) for k, v in parts.items()} out[fn] = rep with open(os.path.join(F, "verify_report.json"), "w", encoding="utf-8") as f: json.dump(out, f, indent=1) print("VERIFY OK", len(out))