railyard/slice/scripts/landmarks.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

40 lines
1.3 KiB
Python

import bpy, sys, json, mathutils
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)
ob = next(o for o in bpy.data.objects if o.type=='MESH')
mw = ob.matrix_world
vs = [mw @ v.co for v in ob.data.vertices]
zs = [v.z for v in vs]
zmin, zmax = min(zs), max(zs)
H = zmax - zmin
# slice into 20 vertical bands, report x-extent, count, x-cluster (bimodal for legs)
bands = 24
out = []
for i in range(bands):
z0 = zmin + H*i/bands
z1 = zmin + H*(i+1)/bands
band = [v for v in vs if z0 <= v.z < z1]
if not band:
out.append({"z": round((z0+z1)/2,3), "n":0}); continue
xs = sorted(v.x for v in band)
ys = [v.y for v in band]
# detect gap in x (bimodal -> legs)
gaps = []
for a,b in zip(xs, xs[1:]):
gaps.append((b-a, a, b))
biggap = max(gaps) if gaps else (0,0,0)
out.append({
"z": round((z0+z1)/2,3), "n": len(band),
"xmin": round(xs[0],3), "xmax": round(xs[-1],3),
"xspan": round(xs[-1]-xs[0],3),
"biggap": round(biggap[0],3), "gap_at_x": round((biggap[1]+biggap[2])/2,3),
"ymid": round(sum(ys)/len(ys),3),
})
print("H=%.4f zmin=%.4f zmax=%.4f"%(H,zmin,zmax))
print("LM_JSON="+json.dumps(out))