"""Inspect a GLB file's objects, vertex groups, and parent hierarchy.""" import sys import bpy if __name__ == "__main__": argv = sys.argv if "--" not in argv: print("Usage: blender --background --python inspect_glb.py -- ") sys.exit(1) args = argv[argv.index("--") + 1:] input_path = args[0] bpy.ops.wm.read_factory_settings(use_empty=True) bpy.ops.import_scene.gltf(filepath=input_path) for obj in bpy.context.scene.objects: print(f"OBJ: {obj.name} type={obj.type} pos={tuple(round(v,3) for v in obj.location)}") if obj.type == 'MESH': vg_names = [vg.name for vg in obj.vertex_groups] print(f" vertex_groups ({len(vg_names)}): {vg_names[:10]}") print(f" parent: {obj.parent.name if obj.parent else 'None'}") print(f" verts: {len(obj.data.vertices)}") # Check skin modifier for mod in obj.modifiers: print(f" modifier: {mod.name} type={mod.type} object={mod.object.name if hasattr(mod, 'object') and mod.object else 'None'}") if obj.type == 'ARMATURE': bones = [b.name for b in obj.data.bones] print(f" bones ({len(bones)}): {bones[:8]}...") # Print head bone position if exists for b in obj.data.bones: if b.name == 'Head': print(f" Head bone head_local: {tuple(round(v,3) for v in b.head_local)}")