You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 83b09cf
Browse filesBrowse the repository at this point in the historyBrowse files
feat(skills): gpu-drawing-and-overlays skill, no-bgl rule and gpu-offscreen-draw example
bgl is gone on 5.x (find_spec('bgl') is None on 5.0.1, 5.1.2 and 5.2.1,
still present on 4.5.14), and the pack had nothing on GPU drawing, so
agents kept writing overlay add-ons that fail at import.
- Skill gpu-drawing-and-overlays covers:
- draw_handler_add/remove symmetry, and keeping the handle
- builtin shader names (identical on 4.5 and 5.2; the 2D_/3D_ names are
rejected on 5.2)
- gpu.state replacements for the bgl state calls
- POLYLINE_* shaders for wide lines
- blf text (blf.size dpi argument: TypeError on 4.5 and 5.2)
- GPUOffScreen headless on 5.2 via gpu.init(), which is new in 5.2;
5.1 and earlier raise in background mode
- Rule no-bgl flags import bgl and bgl. calls, with a replacement table.
- examples/gpu-offscreen-draw, check-only, 5.2+ (skips elsewhere through
catalog min_version), reads pixels back from a GPUOffScreen:
- quad coverage 1024/1024
- half-alpha red over blue gives 0.498/0.502 with blend_set('ALPHA')
- a lineWidth 6 polyline draws 7 px
- bgl is absent
Falsifiers, verified on 5.2.1: --skip-blend exits 5, --thin-line 6,
--expect-bgl 7. 4.5.14 and 5.1.2 skip with 77.
Counts move to 19 skills, 10 rules, 67 examples (11 check-only).
Closes#465
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
@@ -52,8 +52,9 @@ VERSION - Source of truth for the repo version
52
52
| vse-python | VSE timeline from Python: `.strips` vs `.sequences`, `new_effect` kwargs, 5.2 COLOR `width`/`height` bake |
53
53
| extension-runtime-and-packaging | Bundled wheels, `extension_path_user` data that survives upgrades, `online_access`, `bl_ext` names, `--command extension` build in CI |
54
54
| timers-modal-and-threading |`bpy.app.timers` return values and `persistent`, modal operators on `event_timer_add`, worker thread + queue + main-thread drain, no timers in `--background`|
55
+
| gpu-drawing-and-overlays |`gpu` instead of the removed `bgl`: `draw_handler_add`/`remove`, builtin shader names, `gpu.state` blending and depth, `POLYLINE_*` line width, `blf` text, `GPUOffScreen` with 5.2's `gpu.init()` headless |
55
56
56
-
## Rules (9)
57
+
## Rules (10)
57
58
58
59
Every rule sets `alwaysApply: false`, so the Scope column below is the rule's
59
60
actual load condition, not a description: a rule enters context only when a file
@@ -70,6 +71,7 @@ matching its `globs` does. Changing a glob changes when the rule fires.
70
71
| validate-imported-mesh-scale |`*.py`| glTF/FBX import then mesh work with no `transform_apply` and no unit-scale check |
71
72
| no-unapplied-modifiers-on-export |`*.py`| Export with live modifiers when the export does not request evaluated geometry |
72
73
| use-correct-axis-rna-per-exporter |`*.py`|`export_scene.gltf` with FBX `axis_forward`/`axis_up`, or `export_scene.fbx` with glTF `export_yup`|
74
+
| no-bgl |`*.py`|`import bgl` or any `bgl.` call (removed in 5.x; the add-on fails to register) |
Extensions runtime: `extension-user-data.py` (`extension_path_user` settings file and an `online_access` guard). Long-running work: `thread-queue-timer.py` (worker thread, `queue.Queue`, main-thread drain timer).
111
113
112
-
## Examples (66)
114
+
## Examples (67)
113
115
114
116
Runnable scripts at `examples/<name>/`, each asserting a real API contract with
115
117
deterministic checks (exit non-zero on failure) and optionally rendering a still via
116
118
`--output`. All of them run headless on Blender 5.2 LTS and 4.5 LTS in `blender-smoke.yml` (5.1 on the weekly cron, the `needs-5.1` PR label, or manual dispatch);
117
-
**56 of the 66 ship a render in the site gallery** at `docs/gallery/`. The other
118
-
ten are **check-only**: they carry no `--output` path, no gallery entry, and no
119
+
**56 of the 67 ship a render in the site gallery** at `docs/gallery/`. The other
120
+
eleven are **check-only**: they carry no `--output` path, no gallery entry, and no
119
121
hero asset. The criterion is whether the contract is expressible in pixels. An
120
122
example is check-only when its witness is a data or state fact that no scene
121
123
redesign can make visible — a datablock name, an RNA attribute's presence, a
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -288,7 +288,7 @@ The drift-check workflow enforces these on every push and PR.
288
288
289
289
## Aggregate Counts
290
290
291
-
`README.md` declares aggregate counts (e.g. "18 skills, 9 rules, 3 templates, 29 snippets, 66 examples, and 80 showcase pieces"). The `validate-counts` job in `.github/workflows/validate.yml` enforces these substrings against the filesystem on every push and PR. Showcase pieces are counted separately from examples. When you add or remove content, update the README counts in the same commit.
291
+
`README.md` declares aggregate counts (e.g. "19 skills, 10 rules, 3 templates, 29 snippets, 67 examples, and 80 showcase pieces"). The `validate-counts` job in `.github/workflows/validate.yml` enforces these substrings against the filesystem on every push and PR. Showcase pieces are counted separately from examples. When you add or remove content, update the README counts in the same commit.
This repository ships **18 skills, 9 rules, 3 templates, 29 snippets, 66 examples, and 80 showcase pieces** for Blender Python development targeting Blender 5.2 LTS (current stable) with Blender 4.5 LTS fallback support. Blender 5.1 is prior stable.
47
+
This repository ships **19 skills, 10 rules, 3 templates, 29 snippets, 67 examples, and 80 showcase pieces** for Blender Python development targeting Blender 5.2 LTS (current stable) with Blender 4.5 LTS fallback support. Blender 5.1 is prior stable.
48
48
49
49
The content is consumed by AI coding agents, installed as a plugin or read from a checkout. An optional second plugin registers the official [Blender Lab MCP server](https://www.blender.org/lab/mcp-server/) for live sessions (see [Live Blender session](#live-blender-session-mcp)); the server is referenced from upstream, not part of this repository, and nothing else depends on it. Cursor and Claude Code both install it as a plugin (see [Quick start](#quick-start)): Cursor loads the skills and applies `rules/*.mdc` wherever their scope globs match; Claude Code loads the skills and gets the rules through a generated `blender-rules` skill, since it does not read Cursor `.mdc` files. An agent picks a skill up when its description matches the task. Any agent that can read files in a workspace can use it the same way. There is no build step for the content — edit the Markdown and Python files directly.
50
50
51
51
| Layer | Role |
52
52
| --- | --- |
53
-
|**Skills**| Guided workflows: scaffolding, operators, panels, properties, mesh and bmesh, headless batch, slotted actions, geometry nodes, procedural materials, depsgraph queries, drivers and handlers, `bl_info` migration, video sequencer, imported-mesh cleanup, high-to-low baking, engine export presets, extension runtime and packaging, timers, modal operators and threading |
53
+
|**Skills**| Guided workflows: scaffolding, operators, panels, properties, mesh and bmesh, headless batch, slotted actions, geometry nodes, procedural materials, depsgraph queries, drivers and handlers, `bl_info` migration, video sequencer, imported-mesh cleanup, high-to-low baking, engine export presets, extension runtime and packaging, timers, modal operators and threading, GPU drawing and viewport overlays|
54
54
|**Rules**| Guardrails for the most common AI mistakes: ops-in-loops, bmesh leaks, legacy `bl_info` only, prop assignments, deprecated context-copy override, per-element loops over bulk mesh data, import without scale check, export without evaluated geometry, mixed glTF/FBX axis RNA |
55
55
|**Templates**| A working Extensions Platform add-on starter, a headless batch script starter, and a GLB-in engine-ready asset pipeline |
56
56
|**Snippets**| 29 small standalone Python files demonstrating canonical patterns, 5 to 75 lines each |
@@ -61,14 +61,14 @@ The content is consumed by AI coding agents, installed as a plugin or read from
61
61
62
62
Neither agent needs a clone of `main`: both install the slim `plugin-dist` build. Clone the full repository only to [run the examples or contribute](#run-the-examples-or-contribute).
63
63
64
-
-**Cursor** — install it as a local plugin from the slim `plugin-dist` branch, then run **Developer: Reload Window**. **Customize** lists the 18 skills and 9 rules; the rules apply by glob scope and the agent loads a skill when its description matches the task.
64
+
-**Cursor** — install it as a local plugin from the slim `plugin-dist` branch, then run **Developer: Reload Window**. **Customize** lists the 19 skills and 10 rules; the rules apply by glob scope and the agent loads a skill when its description matches the task.
(On Windows the folder is `%USERPROFILE%\.cursor\plugins\local\`. Cursor skips symlinks that point outside that folder, so clone or copy rather than link.) Teams can import the repository as a team marketplace instead; it carries `.cursor-plugin/marketplace.json`. The plugin already applies the rules, so there is nothing to copy. Only to scope the pack to one project without the plugin, copy `skills/*` into that project's `.cursor/skills/` and `rules/*.mdc` into `.cursor/rules/` from a checkout; copying only the rules gives you no skills.
71
-
-**Claude Code** — install as a plugin, then run `/skills` to see all 18 skills plus `blender-rules`:
71
+
-**Claude Code** — install as a plugin, then run `/skills` to see all 19 skills plus `blender-rules`:
@@ -129,7 +129,7 @@ Releases ship often; [CHANGELOG.md](CHANGELOG.md) lists what each one changed.
129
129
130
130
## Falsifiers
131
131
132
-
Every one of the 66 examples carries a **falsifier**: a flag that changes the
132
+
Every one of the 67 examples carries a **falsifier**: a flag that changes the
133
133
input so a real assertion fails. It never disables the assertion, skips the
134
134
check, or short-circuits to an error — it feeds the script something the
135
135
contract says must not pass, and the same check that guards the happy path
@@ -157,7 +157,7 @@ per-script exit-code model, are in
157
157
158
158
## Examples and showcase
159
159
160
-
**66 examples** in [`examples/`](examples/) are runnable, self-checking scripts: each asserts one API contract, carries a falsifier, and runs headless on Blender 5.2 LTS and 4.5 LTS in the `blender-smoke` workflow (5.1 on the weekly cron or by manual dispatch). Those whose contract is visible also render a still. **80 showcase pieces** in [`showcase/`](showcase/) exist to show the skills working together at production scale: each is a single headless script that models a game prop, then runs it through the same cleanup, bake, LOD, collider and export steps the skills teach, and fails if a measured budget (triangle counts, colliders, materials, real-world size) is missed. They are not API examples. Conventions: [`showcase/README.md`](showcase/README.md).
160
+
**67 examples** in [`examples/`](examples/) are runnable, self-checking scripts: each asserts one API contract, carries a falsifier, and runs headless on Blender 5.2 LTS and 4.5 LTS in the `blender-smoke` workflow (5.1 on the weekly cron or by manual dispatch). Those whose contract is visible also render a still. **80 showcase pieces** in [`showcase/`](showcase/) exist to show the skills working together at production scale: each is a single headless script that models a game prop, then runs it through the same cleanup, bake, LOD, collider and export steps the skills teach, and fails if a measured budget (triangle counts, colliders, materials, real-world size) is missed. They are not API examples. Conventions: [`showcase/README.md`](showcase/README.md).
161
161
162
162
Browse both, with filters, full-size renders and each script's README, in the **[gallery](https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/)**.
163
163
@@ -175,11 +175,11 @@ Browse both, with filters, full-size renders and each script's README, in the **
175
175
## How content is organized
176
176
177
177
```
178
-
skills/<name>/SKILL.md - 18 skill files, YAML frontmatter, one canonical pattern each
Copy file name to clipboardExpand all lines: ROADMAP.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
The skill, rule and example work planned for what the plugin teaches, separate from the
10
10
showcase pool further down. Each item is an open issue; nothing here is pinned to a version.
11
11
12
-
-**New skills:**`porting-to-blender-5`, one index of every 4.x to 5.x break the pack covers ([#466](https://github.com/TMHSDigital/Blender-Developer-Tools/issues/466)); `gpu-drawing` plus a no-`bgl` rule, since `bgl` is gone in 5.x ([#465](https://github.com/TMHSDigital/Blender-Developer-Tools/issues/465)); teach the API contracts that shipped examples prove but no skill covers yet, such as Grease Pencil v3, the 5.x compositor, constraints and image pixels ([#456](https://github.com/TMHSDigital/Blender-Developer-Tools/issues/456))
12
+
-**New skills:**`porting-to-blender-5`, one index of every 4.x to 5.x break the pack covers ([#466](https://github.com/TMHSDigital/Blender-Developer-Tools/issues/466)); teach the API contracts that shipped examples prove but no skill covers yet, such as Grease Pencil v3, the 5.x compositor, constraints and image pixels ([#456](https://github.com/TMHSDigital/Blender-Developer-Tools/issues/456))
13
13
-**Skill corrections:** the full Principled BSDF v2 socket rename table in `procedural-materials-and-shaders` ([#382](https://github.com/TMHSDigital/Blender-Developer-Tools/issues/382))
14
14
-**New rules:** flag the mesh-normals APIs removed in 4.1 (`use_auto_smooth`, `calc_normals_split`, `free_normals_split`) ([#379](https://github.com/TMHSDigital/Blender-Developer-Tools/issues/379))
15
15
-**Examples for skills that have none:** check-only examples for `operators`, `ui-panels`, `addon-scaffolding` and `bl-info-migration` ([#378](https://github.com/TMHSDigital/Blender-Developer-Tools/issues/378)); a skill-to-example index and one machine-readable examples manifest with version support ([#377](https://github.com/TMHSDigital/Blender-Developer-Tools/issues/377))
@@ -38,7 +38,8 @@ derives the actual version from conventional-commit types.
Copy file name to clipboardExpand all lines: claude/blender-rules.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,12 @@ Flag bmesh.new() calls without a paired bm.free() in a try/finally block. Blende
11
11
12
12
Applies to: `**/*.py`. Full rule: [`rules/always-free-bmesh.mdc`](https://github.com/TMHSDigital/Blender-Developer-Tools/blob/main/rules/always-free-bmesh.mdc).
13
13
14
+
## no-bgl
15
+
16
+
Flag `import bgl` and any `bgl.` call. The `bgl` OpenGL wrapper was deprecated in 3.x and is gone in Blender 5.x (`importlib.util.find_spec('bgl')` is `None` on 5.0, 5.1 and 5.2), so an add-on that imports it fails to register. Draw with the `gpu` module, `gpu.state` and `gpu_extras.batch` instead; see the gpu-drawing-and-overlays skill.
17
+
18
+
Applies to: `**/*.py`. Full rule: [`rules/no-bgl.mdc`](https://github.com/TMHSDigital/Blender-Developer-Tools/blob/main/rules/no-bgl.mdc).
19
+
14
20
## no-unapplied-modifiers-on-export
15
21
16
22
Flag an export call on objects that still carry unapplied modifiers when the export arguments do not request evaluated geometry. The engine then receives the authored cage, not the modifier result.
0 commit comments