import bpy, os, sys from mathutils import Vector d = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..", "Assets", "Art", "Models")) names = sys.argv[sys.argv.index("--") + 1:] for n in names: bpy.ops.wm.read_factory_settings(use_empty=True) bpy.ops.import_scene.fbx(filepath=os.path.join(d, n + ".fbx")) bpy.context.view_layer.update() mn = Vector((1e9,) * 3); mx = Vector((-1e9,) * 3); tris = 0; kids = []; mats = set() dg = bpy.context.evaluated_depsgraph_get() for o in bpy.context.scene.objects: if o.type != "MESH": continue p = o.matrix_world.translation kids.append(f"{o.name}@({-p.x:.2f},{p.z:.2f},{-p.y:.2f})") tris += sum(len(f.vertices) - 2 for f in o.data.polygons) for m in o.data.materials: if m: mats.add(m.name) for c in o.bound_box: w = o.matrix_world @ Vector(c) mn = Vector(map(min, mn, w)); mx = Vector(map(max, mx, w)) # unity space: x=-bx, y=bz, z=-by ux = (-mx.x, -mn.x); uy = (mn.z, mx.z); uz = (-mx.y, -mn.y) print(f"V2|{n}|{tris}|x[{ux[0]:.2f},{ux[1]:.2f}] y[{uy[0]:.2f},{uy[1]:.2f}] z[{uz[0]:.2f},{uz[1]:.2f}]|{' '.join(sorted(kids))}|{','.join(sorted(mats))}")