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 6be6529
Browse filesBrowse the repository at this point in the historyBrowse files
feat: four rules for the headline Blender 5 breaks
The porting table lists about 20 breaks, but only bgl, the normals API,
.sequences, context.copy and bl_info had a rule, so the most common 5.x
breaks were caught only when an agent happened to load the right skill.
action.fcurves is one of the three bugs the README tagline names. New rules,
each stating only behavior this repo already measured on 4.5 and 5.x:
- no-legacy-action-fcurves: action.fcurves/groups/id_root (removed in 5.0)
- principled-v2-socket-names: 3.x Principled BSDF input names or indices
- no-nodes-modifier-idprop-inputs: mod[ident] = value without a 5.2 branch
- branch-eevee-engine-id: a literal EEVEE engine id without a 5.0 branch
Each is linked from its porting-table row; the Cursor manifest, CLAUDE.md
and README tables, counts (12 -> 16) and the generated Claude/AGENTS/Copilot
rule files are updated.
Closes#526
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LpkeXRvikhJZSVGBFM91Dv
Signed-off-by: TM Hospitality Strategies <TMHospitalityStrategies@gmail.com>
Every rule sets `alwaysApply: false`, so the Scope column below is the rule's
66
66
actual load condition, not a description: a rule enters context only when a file
@@ -80,6 +80,10 @@ matching its `globs` does. Changing a glob changes when the rule fires.
80
80
| no-bgl |`*.py`|`import bgl` or any `bgl.` call (removed in 5.x; the add-on fails to register) |
81
81
| no-removed-normals-api |`*.py`|`use_auto_smooth`, `auto_smooth_angle`, `calc_normals_split()` and the other normals calls removed in 4.1 |
82
82
| no-legacy-vse-sequences |`*.py`|`sequence_editor.sequences` / `.sequences_all` (removed in 5.x; `.strips` / `.strips_all` exist on 4.5 too) |
83
+
| no-legacy-action-fcurves |`*.py`|`action.fcurves`, `action.groups`, `action.id_root` (removed in 5.0; F-curves live in the slot's channelbag) |
84
+
| principled-v2-socket-names |`*.py`| Principled BSDF inputs by 3.x name (`Emission`, `Specular`, `Clearcoat`, ...) or by index (renamed in 4.0) |
85
+
| no-nodes-modifier-idprop-inputs |`*.py`|`mod["Socket_N"] = value` on a NODES modifier without a 5.2 branch (TypeError on 5.2; `mod.properties.inputs` does not exist before it) |
86
+
| branch-eevee-engine-id |`*.py`| literal `'BLENDER_EEVEE_NEXT'` / `'BLENDER_EEVEE'` engine id without a 5.0 version branch |
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
@@ -329,7 +329,7 @@ The drift-check workflow enforces these on every push and PR.
329
329
330
330
## Aggregate Counts
331
331
332
-
`README.md` declares aggregate counts (e.g. "25 skills, 12 rules, 3 templates, 31 snippets, 69 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.
332
+
`README.md` declares aggregate counts (e.g. "25 skills, 16 rules, 3 templates, 31 snippets, 69 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 **25 skills, 12 rules, 3 templates, 31 snippets, 69 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 **25 skills, 16 rules, 3 templates, 31 snippets, 69 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
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, porting add-ons to Blender 5, Grease Pencil v3, constraints and parenting, images and pixels, curves and text, compositor nodes |
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, and the 5.x removals: `bgl`, the pre-4.1 normals API, `sequence_editor.sequences`|
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, and the 5.x breaks: `bgl`, the pre-4.1 normals API, `sequence_editor.sequences`, `action.fcurves`, 3.x Principled socket names, NodesModifier ID-property inputs, the EEVEE engine id|
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**| 31 small standalone Python files demonstrating canonical patterns, 5 to 75 lines each |
57
57
|**Examples**| Runnable headless scripts under [`examples/`](examples/). Each asserts an API contract and exits non-zero on failure. |
@@ -61,7 +61,7 @@ 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 25 skills and 12 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 25 skills and 16 rules; the rules apply by glob scope and the agent loads a skill when its description matches the task.
snippets/<name>.py - 31 standalone Python snippets, 5 to 75 lines each
204
204
examples/<name>/ - 69 example directories: script, README with exit codes and falsifier
@@ -208,7 +208,7 @@ claude/ - generated Claude Code copies of the rules (blender-ru
208
208
209
209
## Using rules in Cursor
210
210
211
-
With the Cursor plugin installed, the `.mdc` files in `rules/` apply automatically when Cursor opens a Blender Python project, scoped by the `globs` in each rule's frontmatter. The 12 rules are:
211
+
With the Cursor plugin installed, the `.mdc` files in `rules/` apply automatically when Cursor opens a Blender Python project, scoped by the `globs` in each rule's frontmatter. The 16 rules are:
-`always-free-bmesh`: flags `bmesh.new()` without paired `bm.free()` in `try`/`finally`
@@ -222,6 +222,10 @@ With the Cursor plugin installed, the `.mdc` files in `rules/` apply automatical
222
222
-`no-bgl`: flags `import bgl` or any `bgl.` call (removed in 5.x; the add-on fails to register)
223
223
-`no-removed-normals-api`: flags `use_auto_smooth`, `auto_smooth_angle`, `calc_normals_split()` and the other normals calls removed in 4.1
224
224
-`no-legacy-vse-sequences`: flags `sequence_editor.sequences` / `.sequences_all` (removed in 5.x; `.strips` / `.strips_all` exist on 4.5 too)
225
+
-`no-legacy-action-fcurves`: flags `action.fcurves`, `action.groups` and `action.id_root` (removed in 5.0; reach F-curves through the slot's channelbag)
226
+
-`principled-v2-socket-names`: flags Principled BSDF inputs by 3.x name (`Emission`, `Specular`, `Clearcoat`, ...) or by index (renamed in 4.0)
227
+
-`no-nodes-modifier-idprop-inputs`: flags `mod["Socket_N"] = value` on a Geometry Nodes modifier without a 5.2 version branch (the dict write raises on 5.2)
228
+
-`branch-eevee-engine-id`: flags a literal `'BLENDER_EEVEE_NEXT'` / `'BLENDER_EEVEE'` engine id without a 5.0 version branch
225
229
226
230
Cursor: the plugin covers the rules (see [Quick start](#quick-start)); copying `rules/*.mdc` into a project's `.cursor/rules/` is only the per-project alternative without the plugin. Claude Code: the plugin ships the rules as the `blender-rules` skill.
Copy file name to clipboardExpand all lines: claude/blender-rules.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,18 +11,36 @@ 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
+
## branch-eevee-engine-id
15
+
16
+
Flag `render.engine = 'BLENDER_EEVEE_NEXT'` or `= 'BLENDER_EEVEE'` written without a version branch. EEVEE Next used the id 'BLENDER_EEVEE_NEXT' on 4.2 through 4.5 LTS and took back 'BLENDER_EEVEE' in 5.0; each id raises TypeError (enum not found) on the other side. Branch on bpy.app.version >= (5, 0, 0). See the procedural-materials-and-shaders skill.
17
+
18
+
Applies to: `**/*.py`. Full rule: [`rules/branch-eevee-engine-id.mdc`](https://github.com/TMHSDigital/Blender-Developer-Tools/blob/main/rules/branch-eevee-engine-id.mdc).
19
+
14
20
## no-bgl
15
21
16
22
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
23
18
24
Applies to: `**/*.py`. Full rule: [`rules/no-bgl.mdc`](https://github.com/TMHSDigital/Blender-Developer-Tools/blob/main/rules/no-bgl.mdc).
19
25
26
+
## no-legacy-action-fcurves
27
+
28
+
Flag `action.fcurves`, `action.groups` and `action.id_root` on an Action. Blender 5.0 removed the flat legacy Action API (AttributeError on 5.x); F-curves live in a channelbag per slot. On 4.4/4.5 LTS the legacy path still runs but is a trap on a fresh Action (it creates a slot without binding it). Reach F-curves through the slot's channelbag, or use obj.keyframe_insert. See the slotted-actions-animation skill.
29
+
30
+
Applies to: `**/*.py`. Full rule: [`rules/no-legacy-action-fcurves.mdc`](https://github.com/TMHSDigital/Blender-Developer-Tools/blob/main/rules/no-legacy-action-fcurves.mdc).
31
+
20
32
## no-legacy-vse-sequences
21
33
22
34
Flag `sequence_editor.sequences` and `.sequences_all`. Both are gone in Blender 5.x (AttributeError on 5.0, 5.1 and 5.2), while `.strips` and `.strips_all` already exist on 4.5 LTS, so use those everywhere with no version branch. See the vse-python skill.
23
35
24
36
Applies to: `**/*.py`. Full rule: [`rules/no-legacy-vse-sequences.mdc`](https://github.com/TMHSDigital/Blender-Developer-Tools/blob/main/rules/no-legacy-vse-sequences.mdc).
25
37
38
+
## no-nodes-modifier-idprop-inputs
39
+
40
+
Flag writing a Geometry Nodes modifier input as an ID property (`mod["Socket_2"] = value`, `mod[identifier] = value`) without a version branch. Blender 5.2 removed that form (it raises TypeError, id properties not supported for this type); 5.2+ writes `getattr(mod.properties.inputs, identifier).value`, which does not exist on 4.5 LTS or 5.1. Branch on bpy.app.version >= (5, 2, 0). See the geometry-nodes-python skill.
41
+
42
+
Applies to: `**/*.py`. Full rule: [`rules/no-nodes-modifier-idprop-inputs.mdc`](https://github.com/TMHSDigital/Blender-Developer-Tools/blob/main/rules/no-nodes-modifier-idprop-inputs.mdc).
43
+
26
44
## no-removed-normals-api
27
45
28
46
Flag the mesh normals API removed in Blender 4.1 — `use_auto_smooth`, `auto_smooth_angle`, `calc_normals_split()`, `free_normals_split()`, `create_normals_split()`. Each raises AttributeError on 4.5 LTS and 5.x. Use `Mesh.set_sharp_from_angle`, `object.shade_auto_smooth`, and `Mesh.corner_normals` (always current) instead.
@@ -47,6 +65,12 @@ Flag uses of `bpy.context.copy()` to override context for an operator call. Pass
47
65
48
66
Applies to: `**/*.py`. Full rule: [`rules/prefer-temp-override-over-context-copy.mdc`](https://github.com/TMHSDigital/Blender-Developer-Tools/blob/main/rules/prefer-temp-override-over-context-copy.mdc).
49
67
68
+
## principled-v2-socket-names
69
+
70
+
Flag Principled BSDF inputs looked up by their 3.x names (`inputs["Emission"]`, `["Specular"]`, `["Clearcoat"]`, `["Subsurface"]`, `["Transmission"]`, `["Sheen"]`) or by index. Principled v2 (Blender 4.0) renamed them, so they raise KeyError on 4.5 LTS and 5.x. Use the 4.0+ names (`Emission Color`, `Specular IOR Level`, `Coat Weight`, ...), which need no version branch. See the procedural-materials-and-shaders skill.
71
+
72
+
Applies to: `**/*.py`. Full rule: [`rules/principled-v2-socket-names.mdc`](https://github.com/TMHSDigital/Blender-Developer-Tools/blob/main/rules/principled-v2-socket-names.mdc).
73
+
50
74
## target-extensions-platform-format
51
75
52
76
Flag new Blender add-ons that ship only a legacy bl_info dict without a blender_manifest.toml. New add-ons must use the Extensions Platform format. bl_info may appear alongside as a fallback for backward compatibility, but the manifest is the source of truth.
0 commit comments