Skip to content

feat: add color-attribute-wheel example#54

Merged
TMHSDigital merged 1 commit into
mainfrom
feat/example-color-attribute-wheel
Jul 18, 2026
Merged

feat: add color-attribute-wheel example#54
TMHSDigital merged 1 commit into
mainfrom
feat/example-color-attribute-wheel

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Summary

  • New runnable example: examples/color-attribute-wheel/ — an HSV color wheel disc built with bmesh, colored via the modern Mesh.color_attributes.new() API (not the deprecated vertex_colors alias).
  • API contract witnessed: a CORNER-domain FLOAT_COLOR attribute is sized to len(mesh.loops), not len(mesh.vertices) — a domain-size trap AI-generated code hits when it assumes per-vertex sizing. Per-vertex HSV is expanded across face corners with one foreach_get (loop → vertex index) + one foreach_set (loop color). The check also asserts color_attributes.active_color points at it, and that the shader Attribute node (attribute_type='GEOMETRY') is actually linked to Base Color — a step AI code frequently skips, leaving the mesh gray even though the attribute data is correct.
  • Full integration: examples/gallery.json entry, .cursor-plugin/plugin.json examples array, blender-smoke.yml check-only step (both 4.5 LTS and 5.1), README gallery row + aggregate counts (14 → 15), AGENTS.md/CLAUDE.md example counts, hero/preview webp assets, regenerated docs/gallery/.

Visual notes

Rendered with both EEVEE and Cycles locally (portable Blender 5.1.2 and 4.5.11 LTS on Windows) — pixel-identical composition across engines and Blender versions. Key fix during iteration: Blender's default AgX view transform compresses bright regions toward white, which was hiding the saturation gradient this example exists to show off; the render path now explicitly sets view_transform = 'Standard' so the rendered colors match the underlying attribute data. Framing uses a TRACK_TO aim empty (matching the swatch-grid light-aim convention) rather than hand-tuned camera rotation, tilted gently so the disc reads as a wheel rather than foreshortening into an ellipse-dominated shape, on the repo's usual dark-studio floor/wall/three-light rig.

Test plan

  • blender --background --python color_attribute_wheel.py -- exits 0 on Blender 5.1.2 (portable, local)
  • Same check exits 0 on Blender 4.5.11 LTS (portable, local)
  • --output render verified on both engines (EEVEE, Cycles) and both Blender versions; hero/preview pixels visually inspected at full size and thumbnail crop
  • python scripts/build_gallery.py regenerated docs/gallery/ cleanly
  • Local replication of validate-counts and validate-manifest CI checks passes
  • CI: validate.yml, drift-check.yml, blender-smoke.yml (4.5 + 5.1) green on this PR

🤖 Generated with Claude Code

Witnesses the modern color-attributes API (mesh.color_attributes.new on the
CORNER domain) that AI code routinely swaps for the deprecated vertex_colors
alias, and the domain-size trap that follows: a CORNER attribute is sized to
loop count, not vertex count, so per-vertex data must be expanded across face
corners before writing. Also asserts the Attribute node is actually linked to
Base Color, since AI code frequently creates the attribute but forgets to
wire it into the shader.
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci labels Jul 18, 2026
@TMHSDigital
TMHSDigital merged commit f3907d4 into main Jul 18, 2026
9 checks passed
@TMHSDigital
TMHSDigital deleted the feat/example-color-attribute-wheel branch July 18, 2026 20:27
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