Skip to content

elithril/blender-kiln / plugin

Makes and fixes 3D assets in Blender, for games, the web and AR. Use when the user wants a 3D model, prop, character or GLB/glTF/FBX/USDZ file made — from a text brief, a reference image, a free marketplace (PolyHaven, Sketchfab) or AI generation — AND when they bring an existing 3D file to fix: too heavy or too many polygons (optimize, compress, LODs), broken normals, scale or origin, materials lost on glTF export, conversion between GLB, FBX and USDZ, texturing, rigging for animation, animating it (walk and idle cycles, text-to-motion, looping clips, articulated props), or inspection. Drives Blender through a Blender MCP server (ahujasid's or the official Blender Lab one). Batch mode produces many consistent assets unattended. Kiln Studio (`/kiln studio`) opens the project's models in the browser, where the user reviews them and pins notes for Claude to act on.

FileKindSize
.claude-plugin/plugin.jsonconfig1.2 KB
.mcp.jsonconfig236 B
LICENSEother1.0 KB
NOTICEother2.5 KB
SKILL.mdskill md29.0 KB
references/ai-generation.mdmarkdown21.0 KB
references/animation.mdmarkdown21.6 KB
references/batch-mode.mdmarkdown19.5 KB
references/blender-mcp.mdmarkdown9.4 KB
references/characters.mdmarkdown52.8 KB
references/cli-tools.mdmarkdown6.5 KB
references/commands.mdmarkdown10.7 KB
references/export-targets.mdmarkdown14.3 KB
references/log-format.mdmarkdown2.2 KB
references/naming-conventions.mdmarkdown5.8 KB
references/photo-projection.mdmarkdown6.3 KB
references/pipeline-brief.mdmarkdown4.2 KB
references/pipeline-import-cleanup.mdmarkdown6.3 KB
references/pipeline-optimize-export.mdmarkdown6.4 KB
references/pipeline-rig-animate.mdmarkdown5.8 KB
references/pipeline-source.mdmarkdown9.7 KB
references/print.mdmarkdown41.5 KB
references/reference-fidelity.mdmarkdown31.8 KB
references/review-rounds.mdmarkdown10.4 KB
references/setup-install.mdmarkdown2.8 KB
references/setup.mdmarkdown9.2 KB
references/sourcing-strategy.mdmarkdown6.1 KB
references/studio.mdmarkdown38.9 KB
references/texturing-strategy.mdmarkdown14.4 KB
references/topology-rules.mdmarkdown3.9 KB
references/uv-materials.mdmarkdown6.8 KB
references/validation-checklist.mdmarkdown10.5 KB
studio/approval_hook.pyscript14.2 KB
studio/blender_live.pyscript2.3 KB
studio/checks.pyscript38.1 KB
studio/estimate.pyscript4.2 KB
studio/example/barrel/barrel_final.glbbinary111.9 KB
studio/example/barrel/barrel_log.mdmarkdown445 B
studio/handoff.pyscript17.8 KB
studio/mcp_server.pyscript32.7 KB
studio/phoneshare.pyscript17.1 KB
studio/server.pyscript47.9 KB
studio/setup_status.pyscript7.5 KB
studio/static/app.jsscript241.4 KB
studio/static/apple-touch-icon.pngbinary20.6 KB
studio/static/fonts/OFL-JetBrainsMono.txtmarkdown4.3 KB
studio/static/fonts/OFL-Sora.txtmarkdown4.3 KB
studio/static/fonts/jetbrains-mono-latin-ext.woff2binary11.3 KB
studio/static/fonts/jetbrains-mono-latin.woff2binary30.6 KB
studio/static/fonts/sora-latin-ext.woff2binary11.8 KB
studio/static/fonts/sora-latin.woff2binary24.6 KB
studio/static/i18n.jsscript6.2 KB
studio/static/i18n/fr.jsonconfig101.2 KB
studio/static/icon-32.pngbinary2.6 KB
studio/static/icon-64.pngbinary6.6 KB
studio/static/icon-96.pngbinary12.8 KB
studio/static/index.htmlother39.5 KB
studio/static/style.cssother114.5 KB
studio/static/tutorial.jsscript49.0 KB
studio/static/tutorial/barrel_after.glbbinary117.3 KB
studio/static/tutorial/barrel_before.glbbinary111.9 KB
studio/static/tutorial/fixtures.jsonconfig13.5 KB
studio/static/tutorial/lantern_1_blockout.glbbinary83.1 KB
studio/static/tutorial/lantern_2_details.glbbinary101.8 KB
studio/static/tutorial/lantern_3_materials.glbbinary102.0 KB
studio/static/tutorial/lantern_4_final.glbbinary141.1 KB
studio/static/tutorial/make_tutorial.pyscript4.9 KB
studio/static/viewer.jsscript41.4 KB
studio/studio.pyscript29.2 KB
studio/studiolib.pyscript77.8 KB
studio/test_studio.pyscript90.2 KB
studio/test_worker.pyscript31.5 KB
studio/worker.pyscript56.8 KB
studio/worker_blender.pyscript2.7 KB
tools/autorig.pyscript44.1 KB
tools/bind_rigid_parts.pyscript3.6 KB
tools/blender_mcp_start.pyscript1.5 KB
tools/check_usdz.pyscript1004 B
tools/cutout.swiftscript2.0 KB
tools/export_outputs.pyscript5.2 KB
tools/fidelity_check.pyscript39.0 KB
tools/fit_coupon.pyscript11.3 KB
tools/fixtures/skintokens_raw_child.glbbinary88.8 KB
tools/fixtures/skintokens_skeletons.jsonconfig6.5 KB
tools/flatten.pyscript14.9 KB
tools/glb_to_fbx.pyscript2.1 KB
tools/glb_to_usdz.pyscript6.2 KB
tools/motion_loop.pyscript5.9 KB
tools/motion_measure.pyscript15.2 KB
tools/motions/LICENSE-image-to-3dlab.txtmarkdown11.1 KB
tools/motions/cheer.npzbinary48.4 KB
tools/motions/cheer_b.npzbinary48.1 KB
tools/motions/dance.npzbinary78.2 KB
tools/motions/dance_b.npzbinary78.9 KB
tools/motions/death.npzbinary45.9 KB
tools/motions/death_b.npzbinary46.5 KB
tools/motions/fight_stance.npzbinary60.3 KB
tools/motions/fight_stance_b.npzbinary61.3 KB
tools/motions/flying_kick.npzbinary39.7 KB
tools/motions/flying_kick_b.npzbinary39.9 KB
tools/motions/hit_react.npzbinary31.9 KB
tools/motions/hit_react_b.npzbinary31.8 KB
tools/motions/idle.npzbinary51.8 KB
tools/motions/idle_b.npzbinary57.7 KB
tools/motions/jump.npzbinary39.8 KB
tools/motions/jump_b.npzbinary39.9 KB
tools/motions/kata.npzbinary77.4 KB
tools/motions/kata_b.npzbinary75.3 KB
tools/motions/kick.npzbinary32.4 KB
tools/motions/kick_b.npzbinary32.5 KB
tools/motions/presets.jsonconfig9.6 KB
tools/motions/punch.npzbinary32.0 KB
tools/motions/punch_b.npzbinary32.1 KB
tools/motions/punch_combo.npzbinary47.4 KB
tools/motions/punch_combo_b.npzbinary47.5 KB
tools/motions/roll.npzbinary46.7 KB
tools/motions/roll_b.npzbinary47.5 KB
tools/motions/roundhouse.npzbinary39.7 KB
tools/motions/roundhouse_b.npzbinary39.9 KB
tools/motions/run.npzbinary47.2 KB
tools/motions/run_b.npzbinary47.7 KB
tools/motions/sit.npzbinary47.2 KB
tools/motions/sit_b.npzbinary47.2 KB
tools/motions/sneak.npzbinary61.6 KB
tools/motions/sneak_b.npzbinary61.8 KB
tools/motions/strafe_left.npzbinary45.9 KB
tools/motions/strafe_left_b.npzbinary47.1 KB
tools/motions/sword_swing.npzbinary39.7 KB
tools/motions/sword_swing_b.npzbinary39.4 KB
tools/motions/walk.npzbinary62.8 KB
tools/motions/walk_b.npzbinary62.6 KB
tools/motions/walk_woman.npzbinary62.9 KB
tools/motions/wave.npzbinary46.3 KB
tools/motions/wave_b.npzbinary46.3 KB
tools/open_blender.pyscript5.0 KB
tools/photo_project.pyscript37.8 KB
tools/presets.pyscript16.3 KB
tools/print_check.pyscript47.2 KB
tools/quadruped.pyscript19.4 KB
tools/retarget.pyscript46.9 KB
tools/review_renders.pyscript13.8 KB
tools/review_sheet.pyscript11.0 KB
tools/skintokens-requirements.txtmarkdown2.4 KB
tools/skintokens.patchother9.2 KB
tools/template_profile.pyscript5.8 KB
tools/test_autorig.pyscript15.9 KB
tools/test_fidelity_check.pyscript20.7 KB
tools/test_fit_coupon.pyscript6.4 KB
tools/test_flatten.pyscript15.0 KB
tools/test_open_blender.pyscript1.3 KB
tools/test_photo_project.pyscript12.6 KB
tools/test_presets.pyscript17.6 KB
tools/test_print_check.pyscript33.1 KB
tools/test_review_renders.pyscript11.4 KB
tools/test_review_sheet.pyscript4.0 KB
tools/test_template_profile.pyscript3.6 KB
tools/test_uv_check.pyscript5.0 KB
tools/test_verify_docs.pyexecutablescript7.9 KB
tools/unimate.patchother3.5 KB
tools/unimate.pyscript17.5 KB
tools/uv_check.pyscript8.4 KB
tools/verify_blender.pyexecutablescript29.2 KB
tools/verify_docs.pyexecutablescript16.6 KB

tools/template_profile.py

View on GitHub
"""Read a turned object's real profile off a 3D template — a generated mesh, a scan.

    blender -b --factory-startup --python-exit-code 1 --python tools/template_profile.py -- \\
        --template trellis.glb --height <real height, m> [--bands 40] [--json out.json]

A photo bends proportions: a camera above makes every disc's top an ellipse and every
base taller than it is. A generated mesh of the same photo (TRELLIS.2) holds the proportions
in 3D, but its surface is unusable as an asset (facets, smeared texture, broken thin parts
once decimated). So measure it, and model clean from the measures.

The template is scaled to --height (a generated mesh is always 1 m tall), its axis fitted
on the foot's circle, then cut by horizontal planes. Per band, the radial
distances of the cut are grouped into clusters: the first is the body (its outer radius
is the profile to lathe), the next are what stands around it — tubes, a guard, a bail —
with their distance from the axis. Prints one line per band and, with --json, writes them.
"""
import bpy, bmesh, json, math, sys
import numpy as np
from mathutils import Vector


ROUND = 0.75                                # share of 36 sectors: a part turned about the axis


def args():
    a = sys.argv[sys.argv.index("--") + 1:]
    o = {"bands": "40"}
    for k, v in zip(a[::2], a[1::2]):
        o[k.lstrip("-")] = v
    if "template" not in o or "height" not in o:
        sys.exit("template_profile: --template and --height (metres, the object's real height) are required")
    return o


def joined_mesh(path):
    bpy.ops.wm.read_factory_settings(use_empty=True)
    bpy.ops.import_scene.gltf(filepath=path)
    sc = bpy.context.scene
    shapes = {pb.custom_shape for a in sc.objects if a.type == "ARMATURE" for pb in a.pose.bones if pb.custom_shape}
    bm = bmesh.new()
    for ob in [o for o in sc.objects if o.type == "MESH" and o not in shapes]:
        m = ob.evaluated_get(bpy.context.evaluated_depsgraph_get()).to_mesh()
        m.transform(ob.matrix_world)
        bm.from_mesh(m)
    if not bm.verts:
        sys.exit("template_profile: no mesh in the template")
    return bm


def clusters(r, ang, gap):
    """Group a cut's points by distance from the axis; each group with its angular coverage
    — a turned part goes all the way round, a tube or a wire covers a few degrees."""
    k = np.argsort(r); r, ang = r[k], ang[k]; out, start = [], 0
    for i in range(1, len(r) + 1):
        if i == len(r) or r[i] - r[i - 1] > gap:
            sec = (ang[start:i] / (2 * math.pi) * 36).astype(int) % 36
            bins = np.unique(sec)
            # A wire touching a turned part joins its group; it covers a few sectors only,
            # so the turned radius is the median of the sectors' outer radii, not the max.
            outer = np.median([r[start:i][sec == b].max() for b in bins])
            out.append(dict(r_in=float(r[start]), r_out=float(r[i - 1]), r_turned=float(outer), round=len(bins) / 36))
            start = i
    return out


def section(bm, z):
    cut = bm.copy()
    res = bmesh.ops.bisect_plane(cut, geom=cut.verts[:] + cut.edges[:] + cut.faces[:],
                                 plane_co=(0, 0, z), plane_no=(0, 0, 1), dist=1e-7)
    pts = np.array([v.co[:2] for v in res["geom_cut"] if isinstance(v, bmesh.types.BMVert)]).reshape(-1, 2)
    cut.free()
    return pts


def main():
    o = args()
    H, n = float(o["height"]), int(o["bands"])
    bm = joined_mesh(o["template"])
    co = np.array([v.co[:] for v in bm.verts])
    z0, z1 = co[:, 2].min(), co[:, 2].max()
    s = H / (z1 - z0)
    for v in bm.verts:
        v.co = (v.co - Vector((0, 0, z0))) * s
    co = np.array([v.co[:] for v in bm.verts])
    gap = 0.008 * H                         # 0.8 % of the height between two parts
    # The axis: the foot's circle. A bounding-box centre is pulled by anything else reaching
    # the floor (a tube, a leg): start from the median, keep the cut's points that go all
    # the way round, and fit their circle (algebraic least squares).
    low = co[co[:, 2] < 0.08 * H]
    ax = np.median(low[:, :2], 0)
    for _ in range(2):
        pts = section(bm, 0.04 * H)
        d = pts - ax; r = np.hypot(d[:, 0], d[:, 1])
        ring = [q for q in clusters(r, np.arctan2(d[:, 1], d[:, 0]) % (2 * math.pi), gap) if q["round"] >= ROUND]
        if not ring:
            break
        q = ring[-1]; k = (r >= q["r_in"]) & (r <= q["r_out"])
        x, y = pts[k, 0], pts[k, 1]
        A = np.c_[2 * x, 2 * y, np.ones_like(x)]
        cx, cy, _ = np.linalg.lstsq(A, x * x + y * y, rcond=None)[0]
        ax = np.array([cx, cy])
    rows = []
    for i in range(n):
        z = (i + 0.5) * H / n
        pts = section(bm, z)
        if len(pts) < 3:
            rows.append(dict(z=z, parts=[])); continue
        d = pts - ax
        rows.append(dict(z=z, parts=clusters(np.hypot(d[:, 0], d[:, 1]), np.arctan2(d[:, 1], d[:, 0]) % (2 * math.pi), gap)))
    print(f"template scaled x{s:.3f} to {H * 100:.1f} cm · axis at ({ax[0]:+.4f}, {ax[1]:+.4f}) m")
    print("height (cm)  turned (outer radius, cm)   around it: radius from the axis (cm) · coverage")
    for row in reversed(rows):
        turned = [q for q in row["parts"] if q["round"] >= ROUND]
        rest = [q for q in row["parts"] if q["round"] < ROUND]
        t = f"{turned[-1]['r_turned'] * 100:6.2f}" + (f" (shell from {turned[-1]['r_in'] * 100:.2f})"
             if turned[-1]["r_out"] - turned[-1]["r_in"] < 0.004 * H else "") + (
             f" + reaching {turned[-1]['r_out'] * 100:.1f}" if turned[-1]["r_out"] - turned[-1]["r_turned"] > 0.01 * H else ""
             ) if turned else "     —"
        print(f"{row['z'] * 100:9.1f}  {t:<28}  " + "  ".join(
            f"{q['r_in'] * 100:.1f}–{q['r_out'] * 100:.1f} · {q['round']:.0%}" for q in rest))
    if "json" in o:
        json.dump(dict(height_m=H, scale=s, bands=rows), open(o["json"], "w"), indent=1)


main()
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall