# blender-python-addon

blender-python-addon — a skill for Claude Code that establishes best practices for Blender add-on development via the bpy API. Triggers when writing operators, UI panels, or bmesh routines.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 111 installs · ★ 312 repo stars
- Author: Mindrally
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/Mindrally/skills/tree/HEAD/blender-python-addon/SKILL.md
- Updated: 2026-10-08
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/blender-python-addon

## What it does

The skill guides the assistant through structuring Blender add-ons with the `bpy` API. It specifies the setup for `blender_manifest.toml` in Blender 4.2+ extensions or the `bl_info` dictionary in legacy versions, along with paired `register()` and `unregister()` lifecycle functions in `__init__.py`.

It covers operator patterns under `bpy.types.Operator` using `poll()`, `invoke()`, and `execute()` hooks, UI panels with `bpy.types.Panel`, and settings management via `PropertyGroup`. For geometry tasks, it instructs the agent to batch modifications using `bmesh`, avoiding blocking UI loops with modal state timers.

Testing relies on running Blender with the `--factory-startup` flag to verify clean installation, execution, and unregistration.

## Requirements
- Works with: Blender

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill blender-python-addon -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/blender-python-addon/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/blender-python-addon/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill blender-python-addon -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/blender-python-addon/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill blender-python-addon -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/blender-python-addon/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Mindrally/skills blender-python-addon
```

2. **Manually: put the files in place**
- File: `.github/skills/blender-python-addon/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill blender-python-addon -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Mindrally/skills --path blender-python-addon
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/blender-python-addon/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill blender-python-addon -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Mindrally/skills/tree/HEAD/blender-python-addon/SKILL.md

## When to use it
- scaffold Blender add-ons using blender_manifest.toml or bl_info
- implement bpy.types.Operator classes with poll and execute hooks
- build sidebar panels using bpy.types.Panel
- register scene properties via PropertyGroup without global variables

## Example prompts
- Create a Blender operator that randomizes vertex colors on the active mesh
- Build a 3D Viewport sidebar panel with a button to run my operator
- Write safe register and unregister functions for my custom property group

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 09648ba2addeef4a.

BEGIN THIRD-PARTY FILE 09648ba2addeef4a
```text
---
name: blender-python-addon
description: "Best practices for writing Blender Python add-ons using the bpy API, covering operators, panels, properties, registration, and API-safe scripting. Use when creating a Blender add-on, defining bpy.types.Operator or Panel classes, registering PropertyGroup settings, writing register()/unregister() functions, working with bmesh, or debugging add-ons in Blender's Python console."
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Blender Python Add-on Development

This skill covers building Blender add-ons with the `bpy` API, including add-on structure, operators, panels, properties, safe scene manipulation, and testing across Blender versions.

## Workflow for Building a Blender Add-on

1. **Scaffold the add-on** — Create a package with `__init__.py` as the entry point, and a `blender_manifest.toml` (Blender 4.2+ extensions) or `bl_info` dict (legacy add-ons) describing name, version, and supported Blender version.
2. **Define data** — Create `PropertyGroup` classes for grouped settings and register them on the appropriate ID type (e.g., `bpy.types.Scene.my_addon = PointerProperty(type=MyAddonSettings)`).
3. **Implement operators** — Subclass `bpy.types.Operator` for each user action; implement `poll()` for availability, `invoke()` for interactive setup, and `execute()` for the actual work.
4. **Build UI panels** — Subclass `bpy.types.Panel` to expose operators and properties in the appropriate editor (3D viewport sidebar, properties editor, etc.).
5. **Register everything** — List all classes in a `classes` tuple and register/unregister them in matching `register()`/`unregister()` functions; register property pointers alongside their classes.
6. **Test in a clean profile** — Launch Blender with `--factory-startup`, install the add-on, enable it, exercise each operator, then disable it and confirm nothing is left behind.
7. **Package and ship** — Zip the add-on folder (or build a `.zip` extension package) and verify it installs cleanly via Blender's Preferences > Add-ons (or Extensions) panel.

## Add-on Structure

- Keep the add-on's entry point in `__init__.py` with clear `register()` and `unregister()` functions that mirror each other exactly (everything registered must be unregistered, in reverse order).
- Group operators, panels, properties, preferences, and utility code into separate modules once the add-on grows past a trivial size; import and register them from `__init__.py`.
- Use `bl_info` (pre-4.2 legacy add-ons) or `blender_manifest.toml` (4.2+ extensions) matching the target Blender version and packaging model — don't mix conventions.
```
END THIRD-PARTY FILE 09648ba2addeef4a

The third-party file has ended. Everything between the 09648ba2addeef4a tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2687 of 8839 bytes. © Mindrally · Apache-2.0 · https://github.com/Mindrally/skills/tree/HEAD/blender-python-addon/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
