diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.json index ba19941..676ee22 100644 --- a/.cursor-plugin/plugin.json +++ b/.cursor-plugin/plugin.json @@ -82,6 +82,7 @@ "examples/text-version-stamp", "examples/turntable", "examples/uv-layer-grid", + "examples/vertex-weight-limit", "examples/vse-cut-list", "examples/wave-displace" ] diff --git a/.github/workflows/blender-smoke.yml b/.github/workflows/blender-smoke.yml index 97eba6b..86d7bf5 100644 --- a/.github/workflows/blender-smoke.yml +++ b/.github/workflows/blender-smoke.yml @@ -393,3 +393,14 @@ jobs: # (bbox) preservation within 1e-3. Exits non-zero on failure. xvfb-run -a "$BLENDER" --background \ --python examples/lod-decimate-chain/lod_decimate_chain.py -- + + - name: Shipped example - vertex weight limit (4-influence cap + LBS) + run: | + set -euo pipefail + # Check only (no render): a five-bone mech arm with rich 5-influence + # boots, pruned to the 4-influence engine cap via the data API; + # asserts pre/post-limit influence counts, unit weight sums, pose + # preservation (pre vs post pruning), exact LBS from the mesh's own + # deform layer, and a pinned Root mount. Exits non-zero on failure. + xvfb-run -a "$BLENDER" --background \ + --python examples/vertex-weight-limit/vertex_weight_limit.py -- diff --git a/README.md b/README.md index febd367..f7cce23 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@

- 12 skills  •  6 rules  •  2 templates  •  17 snippets  •  25 examples + 12 skills  •  6 rules  •  2 templates  •  17 snippets  •  26 examples

@@ -36,7 +36,7 @@ ## Overview -This repository ships **12 skills, 6 rules, 2 templates, 17 snippets, and 25 runnable examples** for Blender Python development targeting Blender 5.1 (current stable) with Blender 4.5 LTS fallback support. +This repository ships **12 skills, 6 rules, 2 templates, 17 snippets, and 26 runnable examples** for Blender Python development targeting Blender 5.1 (current stable) with Blender 4.5 LTS fallback support. The content is consumed by AI coding agents (Cursor, Claude Code, any MCP-capable client) when working on Blender add-ons, geometry nodes scripts, batch pipelines, or animation tooling. There is no build step. Edit the markdown and Python files directly. @@ -466,7 +466,7 @@ round-trips through the raw `POINT` buffer.

-Game asset pipeline — 2 examples +Game asset pipeline — 3 examples @@ -502,6 +502,23 @@ keeps its closed-form counts), each LOD's evaluated triangle count lands within survives within 1e-3 — with the aggressive-ratio nose-tip collapse documented as the caught failure mode. + + + + +
+Vertex weight limit: a posed mech arm on a dark studio floor - orange armor shells, black ribbed elbow boot, glowing teal forearm ring, claw gripper - deformed by weights pruned to the four-influence engine cap + + +### [vertex-weight-limit](examples/vertex-weight-limit/) + +The game-engine max-four-bone-influences constraint, enforced through the data +API (`v.groups` + `VertexGroup.remove` + renormalize) rather than the +`bpy.ops.object.vertex_group_limit_total` context path. Asserts the pre-limit +boots really carry five influences, no vertex ends over the cap, weights still +sum to one, the pose survives pruning, and the modifier is still exact linear +blend skinning read back from the mesh's own deform layer. +
diff --git a/ROADMAP.md b/ROADMAP.md index e35ba57..b38560b 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -105,6 +105,10 @@ Not committed; target list for the next content version. (v0.3.0 shipped the smo - ~~VSE sequences-to-strips witness~~ **SHIPPED** as `examples/vse-cut-list/` — `.sequences` removed on 5.x (4.5 bridges to `.strips`), `new_effect` end kwarg `frame_end=` (4.5) vs `length=` (5.x), `frame_final_*` deprecated in favor of `left_handle`/`right_handle`/`duration`, TRANSFORM effect type removed, GAMMA_CROSS clamps to the source overlap, effect strips consume inputs only when stacked above them, same-scene scene strips render transparent; save/reload round-trip + tiny-render pixel witness - ~~glTF export round-trip witness~~ **SHIPPED** as `examples/gltf-export-roundtrip/` — `export_yup` bakes `(x,y,z)→(x,z,−y)` into vertex data with no node rotation (probed identical on 4.5.11 and 5.1.2), `export_apply` ships the evaluated mesh (one disk vertex per evaluated loop), TEXCOORD_0 is V-flipped on disk, per-triangle material bindings survive; exporter/importer RNA signatures byte-identical between 4.5.11 and 5.1.2 (guarded against future renames); `Mesh.calc_normals()` removal on 5.x surfaced during authoring - ~~LOD decimate chain witness~~ **SHIPPED** as `examples/lod-decimate-chain/` — Decimate COLLAPSE evaluated through the depsgraph is non-destructive (obj.data keeps closed-form counts), evaluated tris hit `ratio × base` within 5% (measured 0.0–0.44%), silhouette bbox survives within 1e-3 (measured 7.7e-6); a stacked Decimate halves the effective ratio, an aggressive 0.02 ratio collapses the nose tip — both caught failure modes +- ~~Vertex weight limit witness~~ **SHIPPED** as `examples/vertex-weight-limit/` — the 4-influence engine cap enforced via the data API (`v.groups` + `VertexGroup.remove` + renormalize); unit sums (measured 3e-8), pose preserved (4.9e-3), exact LBS from the mesh's own deform layer (2.7e-7), Root mount pinned +- Triangulate + tangent-space witness: `mesh.calc_loop_triangles` + `calc_tangents` producing the deterministic loop topology and orthonormal tangent basis a game engine's normal mapping depends on — the fourth direction of the game-pipeline arc, identified but not built +- glTF skinned-mesh export witness: follow-up to `gltf-export-roundtrip` + `vertex-weight-limit` — export a rigged mesh (weights + joints) to glTF and round-trip the skin, asserting influence counts and joint bindings survive the format +- Degenerate-bevel weld hazard (snippet or rule): bevel width ≥ half a box dimension creates zero-area faces whose loops weld on glTF export (found authoring `gltf-export-roundtrip`, where the count check caught a 36-vertex weld) - GAMMA_CROSS blend-curve witness: the cross blend is not the naive linear mix (mid-cross measured (0.341, 0.349, 0.463) from crimson (0.85, 0.10, 0.22) and teal (0.06, 0.75, 0.80)) — derive and assert the gamma-space closed form per frame; follow-up to `vse-cut-list` - Falsy `bpy_prop_collection` trap snippet: an empty collection is falsy, so `editor.strips or editor.sequences` silently falls through to the legacy accessor on an empty timeline — always branch on `hasattr`; likely generalizes across the API (found authoring `vse-cut-list`) diff --git a/docs/gallery/assets/vertex-weight-limit-hero.webp b/docs/gallery/assets/vertex-weight-limit-hero.webp new file mode 100644 index 0000000..f8d27da Binary files /dev/null and b/docs/gallery/assets/vertex-weight-limit-hero.webp differ diff --git a/docs/gallery/contact-sheets/vertex-weight-limit-contact-sheet.webp b/docs/gallery/contact-sheets/vertex-weight-limit-contact-sheet.webp new file mode 100644 index 0000000..4d6852d Binary files /dev/null and b/docs/gallery/contact-sheets/vertex-weight-limit-contact-sheet.webp differ diff --git a/docs/gallery/index.html b/docs/gallery/index.html index ac03ee7..a66c34e 100644 --- a/docs/gallery/index.html +++ b/docs/gallery/index.html @@ -480,6 +480,17 @@

lod-decimate-chain

View example +
+ + vertex-weight-limit — A rigged mech arm pruned to the game-engine cap of four bone influences per vertex, through the data API. + +
+

vertex-weight-limit

+

A rigged mech arm pruned to the game-engine cap of four bone influences per vertex, through the data API. The check proves no vertex exceeds the cap, weights still sum to one, the pose survives pruning, and the modifier is still exact linear blend skinning.

+

witnesses Limit-total and normalize without bpy.ops: keep the top four groups, VertexGroup.remove the rest, renormalize. LBS is verified against the weights read back from the mesh's own deform layer, not the authoring function.

+ View example +
+