feat: add vertex-weight-limit example witnessing the 4-influence skinning cap#77
Merged
Conversation
…ning cap Game engines cap skinning at four bone influences per vertex, and AI-generated rigging code violates it silently or reaches for the context-heavy bpy.ops path. This example authors deliberately rich five-bone boot weights on a mech arm, enforces the cap through the data API (top-four keep, VertexGroup.remove, renormalize), and proves the armature modifier is still exact linear blend skinning read back from the mesh's own deform layer — the weights on the mesh are the contract. The vertex-group API is stable across 4.5 LTS and 5.1; the example produces identical measured values on both. Signed-off-by: fOuttaMyPaint <TMhospitalitystrategies@gmail.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third and final example of the "game asset pipeline" arc (after #75, #76): a rigged mech arm — pedestal mount, pauldron, orange armor shells, ribbed flex boots, wrist, claw prongs — with deliberately rich five-bone weight bumps in the boots, pruned to the game-engine max-four-bone-influences cap through the data API.
Contract witnessed
bpy.ops. Each vertex's groups are read, top four kept by weight, the rest dropped withVertexGroup.remove, survivors renormalized. Thebpy.ops.object.vertex_group_limit_totalcontext path is unnecessary — and dropping without renormalizing leaves sums at 0.986 (measured 1.438e-02 off unit), a mesh that shrinks under load.Σ wᵢ · (pose.matrix @ bone.matrix_local.inverted()) @ restwith weights read back from the mesh's own deform layer (v.groups), not the authoring function (measuredlbs_err = 3.0e-07). The weights on the mesh are the contract.Version witness: the vertex-group API (
v.groups,VertexGroup.add/remove) is stable between 4.5 LTS and 5.1 — identical measured values on both binaries.Falsification evidence (temporary breaks in scratch copies, 5.1.2, restored after measurement):
use_vertex_groups = FalseVisual / contact-sheet gate: vertex-weight-limit-contact-sheet.webp — candidate beside the pinned set (armature-bend, damped-track-aim, bmesh-gear). Per-criterion verdicts: stage darkness ✓, wedge warmth ✓ (pool visible right of subject), subject fill ✓ (fills cell height like the tubes), saturation ✓ (hazard orange + teal ring), thumbnail legibility ✓ (bent mech limb + glowing ring reads at 640×360). Mean luminance: candidate 105.0 vs calibration 139.4 / 100.1 / 143.4 (sRGB luma) — inside the range, not the extreme.
Proven by live run vs inspection:
.scratch/blender-5.1.2-windows-x64/blender.exe(Blender 5.1.2, hash ec6e62d40fa9) and.scratch/blender-4.5.11-windows-x64/blender.exe(Blender 4.5.11 LTS, hash 4db51e9d1e1e) — identical measured values (verts=1984 pre_max=5 post_max=4 limited_verts=128). Render path exit 0 on both binaries (EEVEE), pixels iterated on this machine (5 drafts: pose, claw, framing, plaque removed). All three probes live on 5.1.2.Test plan
26 examples)examples/vertex-weight-limit/vertex_weight_limit.py --check-only.scratch/blender-5.1.2-windows-x64/blender.exe(Blender 5.1.2) and.scratch/blender-4.5.11-windows-x64/blender.exe(Blender 4.5.11 LTS)Integration: example dir + README, gallery.json entry, plugin manifest, smoke step, top-level README ("Game asset pipeline" category now 3, counts 25→26), generated gallery pages (read character-by-character: card alt and witnesses callout verified full), ROADMAP shipped entry plus restock (triangulate-tangents direction, glTF skinned-mesh export follow-up, degenerate-bevel weld hazard).
🤖 Generated with Kimi Code