experiments/mechs: planted feet, shots that fit the bounding sphere, rib chains, a re-hero script

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Nibu (Fable) 2026-12-01 21:37:40 +01:00
commit 13f47e4f47
3 changed files with 15 additions and 5 deletions

View file

@ -141,9 +141,5 @@ for side, L in legs.items():
g = M.sockets(L["foot"])["heel" if L["rams"][-1] is None or "instep" in str(L["rams"][-1]) else "instep"]
M.hose_bundle(f"Hose{side}F", f, g, 2, 0.014)
for side, L in legs.items(): # toe caps
name = f"Toe{side}"
M.shell(name, [M.arc(0.37, 0.26, 0, 180, 5, z=z, y=y, power=5.0) for z, y in ((0.1, 0.3), (0.25, 0.4), (0.37, 0.42))], L["foot"], closed=False, thickness=0.04, levels=3, mat=W, inside=(0, 0.3, 0.3), ring_crease={1: 0.7})
M.finish(name)
print("build s", round(time.time() - t0, 1))
M.finale("heron", t0)

View file

@ -0,0 +1,14 @@
"""Render one more view of a saved mech .blend: MECH_NAME, MECH_VIEW="az,el,w,h,margin,lens,suffix"."""
import os, sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
import bpy
import mechlib as M
name = os.environ["MECH_NAME"]
out = Path(os.environ["MECH_OUT"]) / name
bpy.ops.wm.open_mainfile(filepath=str(out / f"{name}.blend"))
lo, hi = M.bounds()
radius = (hi - lo).length / 2
for view in os.environ["MECH_VIEW"].split(";"):
az, el, w, h, margin, lens, suffix = view.split(",")
M.shot(bpy.data.objects["Rig"], bpy.data.objects["Cam"], radius, float(az), float(el), out / f"{name}_{suffix}.png", (int(w), int(h)), margin=float(margin), lens=float(lens))

View file

@ -130,4 +130,4 @@ for tag, L in legs.items():
a, b = M.sockets(femur)["side_l"] @ Matrix.Translation((0, 0.3, 0)), M.sockets(tibia)["side_l"] @ Matrix.Translation((0, -0.5, 0))
M.hose_bundle(f"Knee.{tag}", a, b, 3, 0.02)
print("build s", round(time.time() - t0, 1))
M.finale("tarantula", t0, hero=(32.0, 12.0), quick_views=((32, 12), (-150, 22)))
M.finale("tarantula", t0, hero=(62.0, 14.0), quick_views=((32, 12), (-150, 22)), hero_size=(2400, 1600))