Skip to content

feat: add parent-inverse-orrery example (matrix_parent_inverse contract)#55

Merged
TMHSDigital merged 1 commit into
mainfrom
feat/parent-inverse-orrery
Jul 18, 2026
Merged

feat: add parent-inverse-orrery example (matrix_parent_inverse contract)#55
TMHSDigital merged 1 commit into
mainfrom
feat/parent-inverse-orrery

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Summary

Adds examples/parent-inverse-orrery/ — the sixteenth smoke-gated example. A brass tabletop orrery (sun, three planets on pivot arms inside orbit rings, one moon) assembled entirely through bpy.data, where the object hierarchy itself is the subject: every arm, planet, and the two-level moon assembly is parented with the keep-world idiom and then spun to its display angle by rotating only the pivots.

No existing example covers object parenting or the transform-update contract, and both are things AI-generated Blender code reliably gets wrong.

API contract witnessed

  1. The trap is realprobe.parent = pivot alone re-interprets the probe's local matrix in the pivot's space: the check asserts the probe jumps (> 0.5 units).
  2. The fix is exactprobe.matrix_parent_inverse = pivot.matrix_world.inverted() restores the world position to within 1e-5.
  3. matrix_world is the last-evaluated matrix — after a transform edit it must stay stale until bpy.context.view_layer.update(), then reflect the edit.
  4. Closed-form orbits — every planet lands exactly on Rz(theta) @ p0, and the moon on the two-level composition pc + Rz(theta1 + thetam) @ (m0 - pc0), proving the parenting algebra carries a real hierarchy.

Exits non-zero (codes 3–7) on any violation. Check-only by default; --output renders the gallery still (EEVEE, --engine cycles for GPU-less hosts).

Visual notes

Dark-studio recipe from bmesh-gear: key/fill/rim area lights, floor + wall, faint warm world. Brass column, arms, and POLY-circle orbit rings; emissive sun crowning the column; lapis/terracotta/jade planets on three ring levels; silver moon on its rod beside the outer planet. Verified at full size and thumbnail scale — subject silhouette and hierarchy read clearly in both.

Test plan

  • blender --background --python examples/parent-inverse-orrery/parent_inverse_orrery.py -- exits 0 on Blender 5.1.2 (local)
  • Same check-only run exits 0 on Blender 4.5.11 LTS (local)
  • -- --output orrery.png renders on both 5.1.2 and 4.5.11; final image visually inspected at 1280×720 and thumbnail size
  • python scripts/build_gallery.py regenerated docs/gallery/ (index + 16 detail pages)
  • gallery.json, plugin manifest, smoke workflow step, README row + counts, AGENTS.md/CLAUDE.md counts all updated
  • CI: validate (structure/counts/manifest), drift-check, Blender 4.5 + 5.1 smoke jobs green

🤖 Generated with Claude Code

Generated Blender code constantly writes `child.parent = pivot` and is
surprised the child teleports, then reads `matrix_world` before the
depsgraph has evaluated it. No existing example covers object parenting
or the transform-update contract, so this one witnesses both with a
brass orrery whose hierarchy is the subject: arms, planets, and a
two-level moon parented with the keep-world idiom
(matrix_parent_inverse = parent.matrix_world.inverted()), spun to
closed-form orbit positions the check verifies exactly. The trap itself
is asserted too - a bare-parented probe must jump, and the fix must
restore its world position to within 1e-5.

Runs check-only headless on Blender 4.5 LTS and 5.1 (both verified
locally on 4.5.11 and 5.1.2); --output renders the gallery still.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci labels Jul 18, 2026
@TMHSDigital
TMHSDigital merged commit 3120077 into main Jul 18, 2026
9 checks passed
@TMHSDigital
TMHSDigital deleted the feat/parent-inverse-orrery branch July 18, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant