ws-3d2/fbx: model/fbx (binary 7.x + ASCII read, binary 7.4 / 7.5 + ASCII write): node tree, Objects / Connections -> Scene (full transform model, layer elements, materials, textures, skins, blend shapes, animation stacks, cameras, lights); tests against assimp + Blender, round trips, fuzz; bench lines
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
75c677074a
commit
8e2e96e198
14 files changed
+4403
No files matched your search
@@ -0,0 +1,31 @@
|
||||
# tools/fixtures/_fbx_blender_stats: run by tools/fixtures/fbx.py inside Blender (blender -b --python <this> -- <json
|
||||
# list of paths>): imports each FBX with Blender's importer and prints one JSON line "STATS <list>" with per file
|
||||
# counts: mesh objects, polygons, vertices, materials, bones, actions, shape keys, cameras, lights, images; or
|
||||
# {"failed": message}.
|
||||
import bpy, sys, json
|
||||
paths = json.loads(sys.argv[sys.argv.index("--") + 1])
|
||||
res = []
|
||||
for p in paths:
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
try:
|
||||
r = bpy.ops.import_scene.fbx(filepath=p)
|
||||
if "FINISHED" not in r:
|
||||
raise RuntimeError(str(r))
|
||||
except Exception as e:
|
||||
res.append({"failed": str(e)[:200]})
|
||||
continue
|
||||
obs = bpy.context.scene.objects
|
||||
meshes = [o for o in obs if o.type == "MESH"]
|
||||
res.append({
|
||||
"meshes": len(meshes),
|
||||
"polygons": sum(len(o.data.polygons) for o in meshes),
|
||||
"vertices": sum(len(o.data.vertices) for o in meshes),
|
||||
"materials": len([m for m in bpy.data.materials if m.users > 0]),
|
||||
"bones": sum(len(o.data.bones) for o in obs if o.type == "ARMATURE"),
|
||||
"actions": len(bpy.data.actions),
|
||||
"shapeKeys": sum(len(o.data.shape_keys.key_blocks) - 1 for o in meshes if o.data.shape_keys),
|
||||
"cameras": len([o for o in obs if o.type == "CAMERA"]),
|
||||
"lights": len([o for o in obs if o.type == "LIGHT"]),
|
||||
"images": len([i for i in bpy.data.images if i.users > 0]),
|
||||
})
|
||||
print("STATS " + json.dumps(res))
|
||||
Reference in new issue
Block a user