feat: add armature-bend example (edit_bones + LBS closed-form witness)#58
Merged
Conversation
Nothing in the gallery touched rigging, and armature code is where AI-generated Blender Python fails silently most often: edit_bones reads outside edit mode return nothing, and a mistyped vertex-group name deforms nothing without erroring. This example builds a four-bone chain via edit_bones, skins a tapered tube through name-bound vertex groups with smoothstep blend zones, poses a curl, and asserts the armature modifier is exactly linear blend skinning — every depsgraph-evaluated vertex must equal the re-implemented closed form (root ring pinned, tip deflected; a straight tube fails). It also bakes in a portability hazard found while authoring: holding a color-attribute reference across VertexGroup.add() dangles it when the deform layer allocates — a hard crash on 4.5 LTS that 5.1 survives by luck — so all weight writes finish before the attribute is created. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Adds
examples/armature-bend— the highest-priority gallery coverage gap (rigging): a four-bone armature chain built withedit_bonesskins a tapered, segmented tube through name-bound vertex groups with smoothstep blend zones, poses a curl, and reads the result back through the depsgraph.API contract witnessed
edit_boneslifetime — asserted empty in object mode; insidemode_set(mode='EDIT')the chain must exist with heads/tails at closed-form positions. Reads outside edit mode silently return nothing.Σ wᵢ · (pose_bone.matrix @ bone.matrix_local.inverted()) @ rest(max error observed 4.77e-07); the root ring must stay pinned and the tip must deflect. A straight tube exits non-zero.4.5/5.1 divergence: the armature API itself is identical on both — no version gate. A real portability hazard is documented in-code: holding a
color_attributesreference acrossVertexGroup.add()dangles it when the deform CustomData layer allocates — a hardEXCEPTION_ACCESS_VIOLATIONon 4.5.11 that 5.1.2 survives by luck. The script orders all weight writes before creating the attribute.Visual notes
Rest → half curl → full curl left to right; the rigs are rotated so the curl sweeps across the picture plane. Per-bone weight bands (teal → cyan → amber → coral) are a
BoneTintcolor attribute computed from the same weights the LBS check asserts, so the color blends at the joints are the contract. Dark-studio recipe matching the existing gallery. Inspected at full 1280×720 and at 1200×675 preview scale.Test plan
Proven by live run (local):
lbs_max_err=4.77e-07 tip_deflection=3.191--outputrender on 5.1.2 (EEVEE), pixels inspected at full size and thumbnail scalepython scripts/build_gallery.pyregenerated (18 detail pages)validate-counts(12/6/2/17/18) andvalidate-manifest(all paths exist, examples list matches disk, version == VERSION)Established by inspection only:
🤖 Generated with Claude Code