Files
animation/characters/work/lena/08_export.py
T
jeremy 3d8825f5a9 reorg(characters): ship-time folders — lena_base_v01 ships, lane moves to work/lena
REGISTRY rewritten around the central rule: a character folder is born only
when a body ships to ariki-game (<character>_base_v<NN> = ship ordinal).
lena_nude dissolves accordingly:
- characters/female/lena_base_v01/ — SHIPPED 2026-08-10: AccuRig GLB carrier,
  T-pose/rig FBX + JSON, previews, frozen README
- characters/work/lena/ — the live lane: recipes 01-47 (incl. new 36-47:
  refill/sheets/clay/despeckle/musculature/spin/AccuRig export/graft/pose QC),
  masters (athletic_v04 blend + textures, accurig blend), lane-history README
- hires_claude/hires_work intermediates (blends, logs, probes) pruned

Supporting docs: AGENTS.md, working-files rule, rig-graft plan addendum,
originals README, prune_lane.py.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 07:17:15 -07:00

33 lines
1.0 KiB
Python

# Stage 8: export the finished hires nude sculpt as a packed GLB.
# blender --background --python 08_export.py -- <07_polished.blend> <out.glb>
import bpy, sys, time
import numpy as np
argv = sys.argv[sys.argv.index("--") + 1:]
BLEND, OUT = argv[0], argv[1]
t0 = time.time()
bpy.ops.wm.open_mainfile(filepath=BLEND)
ob = max([o for o in bpy.data.objects if o.type == 'MESH'],
key=lambda o: len(o.data.vertices))
me = ob.data
co = np.empty(len(me.vertices) * 3)
me.vertices.foreach_get("co", co)
co = co.reshape(-1, 3)
print(f"[export] {ob.name}: {len(me.vertices)}v {len(me.polygons)}f "
f"height {co[:,2].max()-co[:,2].min():.4f} units, "
f"images {[i.name for i in bpy.data.images if i.has_data]}")
bpy.ops.export_scene.gltf(
filepath=OUT,
export_format='GLB',
export_image_format='AUTO',
export_yup=True,
export_apply=False,
export_animations=False,
export_skins=True,
export_morph=False,
)
print(f"[export] WROTE {OUT} ({time.time()-t0:.1f}s)")
print("EXPORT_DONE")