blender-python-addon

A set of Python guidelines for creating Blender add-ons, which are extensions that add tools or interfaces to Blender.

In plain words
What is it for?
Use it when building Blender operators, panels, settings, preferences, utilities, and scripts that work with scene data.
Why use it?
It helps keep add-ons properly structured, registered, tested, and compatible with Blender’s programming interface.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/blender-python-addon
Clone the repo
git clone --depth 1 https://github.com/PatrickJS/awesome-cursorrules
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 524 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00524
Opus 5 $0.00000 $0.00262
Sonnet 5 $0.00000 $0.00105
Haiku 4.5 $0.00000 $0.00052

Measured 2d ago against content hash 92b9e9201680, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

blender-python-addon scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

rules/blender-python-addon.mdc · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Blender Python Add-on Rules

Add-on Structure

  • Keep add-on entry points in __init__.py with clear register() and unregister() functions.
  • Group operators, panels, properties, preferences, and utilities into separate modules for non-trivial add-ons.
  • Use bl_info or blender_manifest.toml according to the Blender version and packaging target.
  • Keep UI labels concise and user-facing text translatable where appropriate.

API Usage

  • Use bpy.types.Operator for actions, bpy.types.Panel for UI, and bpy.types.PropertyGroup for grouped settings.
  • Define bl_idname, bl_label, and bl_options explicitly.
  • Validate context in poll() before enabling operators.
  • Use invoke() for interactive setup and execute() for the actual operation.
  • Return {'FINISHED'} or {'CANCELLED'} consistently.
  • Use dependency graph updates and evaluated objects when reading final scene state.

Data and Properties

  • Register custom properties through PropertyGroup classes instead of loose global state.
  • Store add-on preferences in AddonPreferences.
  • Use PointerProperty, CollectionProperty, and typed properties with names and descriptions.
  • Clean up custom properties and handlers during unregister().

Safety and Performance

  • Do not run destructive scene operations without explicit user action.
  • Avoid blocking UI work in modal operators; use timers or modal state machines for long operations.
  • Batch mesh changes and use bmesh when editing mesh data programmatically.
  • Avoid repeatedly scanning large scenes in draw methods.
  • Keep file paths configurable and use Blender path utilities.

Testing and Debugging

  • Test scripts in a clean Blender profile and a representative production scene.
  • Add smoke tests that import the add-on, register it, run core operators, and unregister cleanly.
  • Log actionable messages with self.report() for user-facing operator feedback.
  • Keep version-specific API differences isolated behind helper functions.

Read the full file on GitHub · 53 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 53 lines · 0 tokens per session scan A 92b9e9201680

Subscribe to this mod's changes

blender-python-addon is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,694 stars, last pushed 3mo ago), licensed CC0-1.0. It costs nothing until one of its globs matches a file; then it loads 524 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.