railyard/slice/scripts/inspect.py
caelum0x b5658cd322 feat: Anubis 3D finishing vertical slice (retopo -> rig -> anim -> cel shader, headless)
Takes the champion "Anubis, Warden of Scales" end-to-end through the game-ready
finishing pipeline, fully headless, as a proof before batching all 47:

- Retopo: TRELLIS 13,966 tris -> 10,500 clean tris, UV atlas + PBR textures preserved
  (Blender decimate/collapse with UV-boundary delimit; weld + recalc normals).
- Rig: scripted 22-bone humanoid skeleton (Mixamo-compatible names), automatic
  bone-heat weights, built in Blender --background.
- Animation: procedural Idle (2s) + Walk (1s) clips baked into ONE GLB
  (+Y up, quaternion, no Draco).
- Shader/render (PRIMARY): standalone headless Bevy 0.19 app using
  bevy_shader_mtoon 0.4 (banded toon diffuse + fresnel rim) + bevy_mod_outline 0.13,
  HDR + Bloom(OLD_SCHOOL), render-to-Image -> Screenshot -> PNG on Metal, no window.
- Shader/render (CROSS-CHECK): Blender EEVEE cel (Shader-to-RGB 3-band + Freestyle
  outline + fresnel rim), clearly labelled as a proxy.
- SLICE.html: side-by-side TRELLIS -> retopo wire -> rigged skeleton -> animated
  cel turntable (engine + proxy), with pipeline facts and an honest quality read.

72 engine frames + 72 proxy frames (walk/idle turntables). Build artifacts ignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-26 06:59:21 +03:00

43 lines
1.4 KiB
Python

import bpy, sys, json
argv = sys.argv[sys.argv.index("--")+1:]
src = argv[0]
bpy.ops.wm.read_factory_settings(use_empty=True)
bpy.ops.import_scene.gltf(filepath=src)
info = {"objects": [], "total_tris": 0, "total_verts": 0, "materials": set()}
import bmesh
for ob in bpy.data.objects:
if ob.type == 'MESH':
me = ob.data
me.calc_loop_triangles()
tris = len(me.loop_triangles)
info["objects"].append({
"name": ob.name,
"verts": len(me.vertices),
"tris": tris,
"materials": [m.name for m in me.materials],
"dims": [round(d,3) for d in ob.dimensions],
"loc": [round(c,3) for c in ob.location],
})
info["total_tris"] += tris
info["total_verts"] += len(me.vertices)
for m in me.materials:
if m: info["materials"].add(m.name)
# world bounds
import mathutils
mn = [1e9,1e9,1e9]; mx=[-1e9,-1e9,-1e9]
for ob in bpy.data.objects:
if ob.type=='MESH':
for v in ob.bound_box:
w = ob.matrix_world @ mathutils.Vector(v)
for i in range(3):
mn[i]=min(mn[i],w[i]); mx[i]=max(mx[i],w[i])
info["materials"]=sorted(info["materials"])
info["world_min"]=[round(x,3) for x in mn]
info["world_max"]=[round(x,3) for x in mx]
info["world_size"]=[round(mx[i]-mn[i],3) for i in range(3)]
print("INSPECT_JSON="+json.dumps(info))