# Headless compatibility probe for Blosm and MPFB on the pinned Blender 5.2. # # blender -b --factory-startup --python Tools/addon_compat_probe.py # # Checks: Blender version, Blosm add-on loads + version, MPFB extension # enables + version, MPFB can create a default human headless, resulting # object inventory (mesh/armature/materials/uvs). import bpy import sys REPORT = "/tmp/addon-compat-report.txt" lines = [] def log(msg): lines.append(str(msg)) bl = bpy.app.version_string log(f"Blender: {bl}") # --- Blosm (legacy add-on, scripts/addons) --- try: import blosm # noqa info = getattr(blosm, "bl_info", {}) log(f"blosm: import OK, version {info.get('version', '?')}, blender {info.get('blender', '?')}") except Exception as exc: # noqa log(f"blosm: IMPORT FAILED: {exc!r}") # --- MPFB (extension, extensions/blender_org/mpfb) --- try: import addon_utils bpy.ops.preferences.addon_enable(module="bl_ext.blender_org.mpfb") enabled = "bl_ext.blender_org.mpfb" in bpy.context.preferences.addons version = "?" try: import bl_ext.blender_org.mpfb as mpfb_mod version = getattr(mpfb_mod, "MPFB_VERSION", "?") except Exception: pass log(f"mpfb: enable OK (registered={enabled}), version {version}") except Exception as exc: # noqa log(f"mpfb: ENABLE FAILED: {exc!r}") # --- MPFB create-human smoke test --- try: bpy.ops.mpfb.create_human("EXEC_DEFAULT") meshes = [o for o in bpy.data.objects if o.type == "MESH"] armatures = [o for o in bpy.data.objects if o.type == "ARMATURE"] log(f"mpfb.create_human: OK — {len(bpy.data.objects)} objects, " f"{len(meshes)} meshes, {len(armatures)} armatures") for o in meshes: uv = bool(o.data.uv_layers) mats = [m.name for m in o.data.materials] log(f" mesh {o.name}: {len(o.data.vertices)} verts, uv={uv}, materials={mats}") for o in armatures: log(f" armature {o.name}: {len(o.data.bones)} bones") except Exception as exc: # noqa log(f"mpfb.create_human: FAILED: {exc!r}") with open(REPORT, "w") as f: f.write("\n".join(lines) + "\n") print("\n".join(lines))