"""Exterior of the Manta in its own frame (boom at rest, cabin left out): every 2nd vertex -> checks/manta_points.npy, all triangles -> checks/manta_tris.npz (read by sweep_check.py and clamp_check.py). Runs in the open Blender or headless.""" import bpy, numpy as np, os HERE = r"D:\HADAL - The Descent\models\tender-manta\build" bpy.context.view_layer.update() V, T, NAMES, OFF, P = [], [], [], 0, [] for o in bpy.data.objects: if o.type == 'MESH' and o.name.startswith("SM_Manta") and o.name != "SM_Manta_Cabin": me = o.data me.calc_loop_triangles() M = np.array(o.matrix_world) co = np.empty(len(me.vertices) * 3); me.vertices.foreach_get("co", co) co = co.reshape(-1, 3) @ M[:3, :3].T + M[:3, 3] tr = np.empty(len(me.loop_triangles) * 3, np.int64); me.loop_triangles.foreach_get("vertices", tr) V.append(co); T.append(tr.reshape(-1, 3) + OFF); NAMES += [o.name] * len(me.loop_triangles); OFF += len(co) P.append(co[::2]) np.save(os.path.join(HERE, "checks", "manta_points.npy"), np.concatenate(P)) np.savez(os.path.join(HERE, "checks", "manta_tris.npz"), v=np.concatenate(V), t=np.concatenate(T), names=np.array(NAMES)) print("DUMP", OFF, sum(len(t) for t in T))