blender-addon-development
Skill779 starsChanged 14 days agoMITView on GitHub
Write Blender 5.2 add-ons as extensions - blender_manifest.toml, operators/panels/menus/property groups/preferences, bpy.props rules after 5.0, undo/redo, modal and timer patterns, gpu drawing (no bgl), bundling Python wheels, CLI validate/build/install, testing headless, extensions platform publishing. Use when creating or fixing a Blender add-on, tool, or UI.
- Installs packages
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- blender-animationSkill
- blender-asset-qaSkill
- blender-character-riggingSkill
- blender-clothingSkill
- blender-coreSkill
- blender-environment-kitsSkill
- blender-export-pipelinesSkill
- blender-facial-shapekeysSkill
- blender-game-optimizationSkill
- blender-geometry-nodesSkill
- blender-hair-groomingSkill
- blender-hardsurface-modelingSkill
- blender-lighting-lookdevSkill
- blender-pbr-materialsSkill
- blender-pipeline-automationSkill
- blender-renderingSkill
- blender-retopology-uvSkill
- blender-scene-setupSkill
- blender-sculptingSkill
- blender-simulationSkill
- blender-stylized-nprSkill
- blender-texture-bakingSkill
- blender-texturingSkill
- blender-time-of-daySkill
- blender-video-editingSkill
- blender-weather-fxSkill
- blender-workflow-recipesSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Write classes with the prefix convention MYTOOL_OT_x (operator), _PT_ (panel), _MT_ (menu), _PG_ (property group), _AP_ (preferences), _UL_ …
- Very specific: line 23
Test headless: register the package in-process, call operators with temp_override, and assert on data (see tests/test_addon.py in this …
- Very specific: line 37
Keymaps: add them to wm.keyconfigs.addon, store (km, kmi) pairs, and remove them on unregister.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add-on (Extension) Development
The execution model is in blender-core. Start from assets/addon_template/ (validated, built, and registered in CI): blender_manifest.toml, __init__.py, operators.py, ui.py.
Procedure
- Copy the template, then set
id(lowercase_underscores, permanent),name,tagline(no trailing period, ≤ 64 chars),maintainer,version(semver),license(SPDX, GPL-3.0-or-later for code using bpy), andblender_version_min = "4.2.0"or higher if you use newer APIs (e.g."5.2.0"for the GNproperties.inputsAPI). - Write classes with the prefix convention
MYTOOL_OT_x(operator),_PT_(panel),_MT_(menu),_PG_(property group),_AP_(preferences),_UL_(UI list).bl_idnamefor operators ismy_tool.verb_noun. - Validate and build:
blender --command extension validate ./my_tool blender --command extension build --source-dir ./my_tool --output-dir ./dist blender --command extension install-file -r user_default -e ./dist/my_tool-1.0.0.zip - Test headless: register the package in-process, call operators with
temp_override, and assert on data (seetests/test_addon.pyin this repo).
Rules (extension-era, 5.x)
- Relative imports only (
from . import ops). The package name is decided by Blender, so preferences usebl_idname = __package__. - No
bl_info(it's ignored for extensions). Everything goes in the manifest. - No network or file access at import/register time. Declare
[permissions](files,network,clipboard,camera,microphone) with a reason. Checkbpy.app.online_accessbefore any network call. - Third-party Python packages: ship
.whlfiles in./wheels/and list them underwheels = [...]. Neverpip installat runtime. Platform-specific wheels requireplatforms = [...]. - Properties (5.0+):
bpy.propsvalues are attributes, not dict entries (scene["my_prop"]no longer reaches them). For read-only props useoptions={'READ_ONLY'}.get_transform/set_transformadapt values while keeping storage. Register withPointerProperty(type=PG)on an ID type, anddelit on unregister. - Operators:
bl_options={"REGISTER","UNDO"}for undo plus a redo panel.poll()guards the context. Return{"FINISHED"}/{"CANCELLED"}.self.report({"WARNING"}, msg)for user feedback. Don't call other operators in loops if a data API exists. - UI:
layout.use_property_split = Truegives modern alignment. Panels in the N-panel usebl_region_type="UI"+bl_category. Append menu entries withVIEW3D_MT_*.append(func)and remove them on unregister. - Unregister everything in reverse order (classes, props, menus, handlers, timers, keymaps, draw handlers). Leaks break reloading.
- Drawing (overlays):
gpumodule +gpu_extras.batch.bglwas removed in 5.0. Textures come fromgpu.texture.from_image(img). For scene-linear images usedraw_texture_2d(..., is_scene_linear_with_rec709_srgb_target=True). - Long tasks: a modal operator with a timer (
wm.event_timer_add), orbpy.app.timers.registerwith chunked work. Never block the UI for seconds. - Handlers: decorate persistent ones with
@bpy.app.handlers.persistent. Keep them cheap (they run every frame/depsgraph update). - Keymaps: add them to
wm.keyconfigs.addon, store(km, kmi)pairs, and remove them on unregister. - Translations / i18n:
bpy.app.translations.register(__package__, dict).
Publishing (extensions.blender.org)
The Blender ID account uploads the built zip. Requirements: a valid manifest, a GPL-compatible license, no obfuscated code, no bundled binaries without source, and permissions declared. Screenshots/README go on the website listing. Update with a higher version.
Gotchas
context.sceneinside a draw function can beNonein some editors. Guard it.- Storing Blender data references (
bpy.types.ID) in Python globals crashes after undo or file load. Store names orsession_uid, and look them up again. bpy.utils.register_classfails if annotations use=instead of:for properties.- 5.0 made several bundled modules private (
rna_info,bl_ui_utils...). Don't import them. - 5.1 no longer loads the user site-packages by default. Bundle wheels instead of relying on user installs.
- 5.2:
PreferencesFilePaths.active_asset_libraryindices are offset (the "All"/"Essentials" entries come first).UILayout.template_palette(color=)is removed. New:UILayout.link,UILayout.textbox,bpy.data.all_ids,Window.screenshot.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

