Skip to content

Commit 2c4bdc4

Browse files
TMHSDigitalclaude
andauthored
feat: add grease-pencil-rosette example (GPv3 attribute API drift witness) (#57)
Grease Pencil v3 is the largest bpy API break in the 4.x-to-5.x window and nothing in the gallery touched it. This example draws five nested neon rose curves through the attribute-based GPv3 surface and asserts the divergence each version actually exposes: on 4.5 LTS GPv3 lives at grease_pencils_v3 while bpy.data.grease_pencils is still legacy GPencil (frame.strokes, no .drawing); on 5.x legacy is deleted and GPv3 owns the grease_pencils name. It also witnesses that stroke points are views over lazily materialized attribute layers, round-tripping every closed-form position through the raw POINT buffer. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 3b260da commit 2c4bdc4

13 files changed

Lines changed: 925 additions & 7 deletions

File tree

.cursor-plugin/plugin.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"examples/driver-wave",
6969
"examples/gn-instance-grid",
7070
"examples/gn-sdf-remesh",
71+
"examples/grease-pencil-rosette",
7172
"examples/parent-inverse-orrery",
7273
"examples/shader-node-group",
7374
"examples/shape-key-blend",

.github/workflows/blender-smoke.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,15 @@ jobs:
274274
# on its closed form. Exits non-zero on failure.
275275
xvfb-run -a "$BLENDER" --background \
276276
--python examples/parent-inverse-orrery/parent_inverse_orrery.py --
277+
278+
- name: Shipped example - grease pencil rosette (GPv3 attribute API)
279+
run: |
280+
set -euo pipefail
281+
# Frame-independent check only (no render): five nested rose curves drawn
282+
# as GPv3 strokes; asserts the version-gated datablock address (4.5:
283+
# grease_pencils_v3 with grease_pencils still legacy; 5.x: grease_pencils
284+
# is GPv3, legacy names gone), lazy attribute-layer materialization from
285+
# point writes, and a closed-form round-trip of every position through
286+
# the raw POINT attribute buffer. Exits non-zero on failure.
287+
xvfb-run -a "$BLENDER" --background \
288+
--python examples/grease-pencil-rosette/grease_pencil_rosette.py --

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The content base (counts are CI-enforced against README.md and the manifest):
2727
- 2 templates: `extension-addon-template` for Extensions Platform add-ons,
2828
and `headless-batch-script-template` for unattended batch jobs.
2929
- 17 snippets covering canonical patterns.
30-
- 16 examples under `examples/<name>/`: runnable scripts that assert a real
30+
- 17 examples under `examples/<name>/`: runnable scripts that assert a real
3131
API contract with deterministic checks, exit non-zero on failure, and
3232
optionally render a still via `--output`. Each is executed headless on
3333
Blender 4.5 LTS and 5.1 by `blender-smoke.yml`; its render ships in the
@@ -41,7 +41,7 @@ Blender-Developer-Tools/
4141
rules/<rule-name>.mdc # 6 rule files
4242
templates/<template-name>/ # 2 starter templates
4343
snippets/<snippet-name>.py # 17 standalone Python snippets
44-
examples/<name>/ # 16 runnable smoke-gated examples (+ gallery.json)
44+
examples/<name>/ # 17 runnable smoke-gated examples (+ gallery.json)
4545
scripts/build_gallery.py # generates docs/gallery/ (stdlib only)
4646
scripts/site/ # vendored landing-page build (build_site.py + template)
4747
docs/gallery/ # committed generated gallery pages + hero assets

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ skills/<skill-name>/SKILL.md - AI workflow definitions, 12 total
1919
rules/<rule-name>.mdc - Anti-pattern rules, 6 total
2020
templates/<template-name>/ - Starter projects, 2 total
2121
snippets/<snippet-name>.py - Standalone code patterns, 17 total
22-
examples/<name>/ - Runnable smoke-gated examples, 16 total (+ gallery.json)
22+
examples/<name>/ - Runnable smoke-gated examples, 17 total (+ gallery.json)
2323
scripts/build_gallery.py - Regenerates docs/gallery/ from gallery.json (stdlib only)
2424
scripts/site/ - Vendored landing-page build (Jinja2)
2525
docs/gallery/ - Committed generated gallery pages + hero renders
@@ -80,11 +80,11 @@ v0.1.0: canonical object creation and deletion, depsgraph evaluated mesh, bmesh
8080

8181
v0.2.0: Principled BSDF material, driver-with-custom-function via `driver_namespace`, application handler registration, shader node group with cross-version `interface` API, `foreach_get` bulk vertex read, version-branch skeleton, and USD export with `evaluation_mode='RENDER'`.
8282

83-
## Examples (16)
83+
## Examples (17)
8484

8585
Runnable scripts at `examples/<name>/`, each asserting a real API contract with
8686
deterministic checks (exit non-zero on failure) and optionally rendering a still via
87-
`--output`. All sixteen run headless on Blender 4.5 LTS and 5.1 in `blender-smoke.yml`;
87+
`--output`. All seventeen run headless on Blender 4.5 LTS and 5.1 in `blender-smoke.yml`;
8888
their renders ship in the site gallery at `docs/gallery/`. `examples/gallery.json` is the
8989
gallery's source of truth. When authoring a new one, copy the anatomy of
9090
`examples/bmesh-gear/` (script structure, README shape, dark-studio render recipe) and

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
</p>
1818

1919
<p align="center">
20-
<strong>12 skills</strong> &nbsp;&bull;&nbsp; <strong>6 rules</strong> &nbsp;&bull;&nbsp; <strong>2 templates</strong> &nbsp;&bull;&nbsp; <strong>17 snippets</strong> &nbsp;&bull;&nbsp; <strong>16 examples</strong>
20+
<strong>12 skills</strong> &nbsp;&bull;&nbsp; <strong>6 rules</strong> &nbsp;&bull;&nbsp; <strong>2 templates</strong> &nbsp;&bull;&nbsp; <strong>17 snippets</strong> &nbsp;&bull;&nbsp; <strong>17 examples</strong>
2121
</p>
2222

2323
---
2424

2525
## Overview
2626

27-
This repository ships **12 skills, 6 rules, 2 templates, 17 snippets, and 16 runnable examples** for Blender Python development targeting Blender 5.1 (current stable) with Blender 4.5 LTS fallback support.
27+
This repository ships **12 skills, 6 rules, 2 templates, 17 snippets, and 17 runnable examples** for Blender Python development targeting Blender 5.1 (current stable) with Blender 4.5 LTS fallback support.
2828

2929
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.
3030

@@ -280,6 +280,23 @@ carries arms, planets, and a two-level moon through spinning pivots. Asserts bar
280280
`.parent =` really teleports, `matrix_world` is stale until `view_layer.update()`,
281281
and every orbit lands on its closed form.
282282

283+
</td>
284+
</tr>
285+
<tr>
286+
<td width="46%" valign="middle">
287+
<a href="examples/grease-pencil-rosette/"><img src="examples/grease-pencil-rosette/preview.webp" alt="Grease pencil rosette: five nested neon rose curves drawn as tapered Grease Pencil v3 strokes, cyan through magenta to red, glowing against a dark studio wall with a soft blue halo" /></a>
288+
</td>
289+
<td valign="middle">
290+
291+
### [grease-pencil-rosette](examples/grease-pencil-rosette/)
292+
293+
Five nested rose curves drawn with the Grease Pencil v3 attribute API — layer →
294+
`frames.new().drawing``add_strokes` → per-point position, radius, opacity, and
295+
vertex color. Asserts the GPv3 address break: on 4.5 GPv3 is `grease_pencils_v3`
296+
while `grease_pencils` is still legacy; on 5.x legacy is gone and GPv3 owns the
297+
name. Point writes lazily materialize attribute layers, and every position
298+
round-trips through the raw `POINT` buffer.
299+
283300
</td>
284301
</tr>
285302
</table>

ROADMAP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Not committed; target list for the next content version. (v0.3.0 shipped the smo
9797
- Refresh the `slotted-actions-animation` skill against any 5.2 changes
9898
- Bump `blender_version_min` in the templates if 5.2 APIs are used
9999
- Additional snippets for asset library scripting, EXR baking, multi-file extensions
100+
- Gallery coverage follow-ups from the GPv3 review: `armature-bend` (edit_bones + vertex groups + pose evaluation) and `text-version-stamp` (TextCurve self-labeling renders); lower priority: light-linking, bulk `pixels.foreach_set`, VSE sequences-to-strips witness (`grease-pencil-rosette` shipped first as the strongest 4.x-to-5.x drift witness)
100101

101102
## Future (uncommitted)
102103

26.3 KB
Loading

0 commit comments

Comments
 (0)