/blender-developer-tools:extension-runtime-and-packagingfrom blender-developer-tools
Guides on shipping Blender extensions with bundled wheels, persistent user data via bpy.utils.extension_path_user, network permissions, and CI packaging commands. For add-ons needing third-party Python packages, file storage, or network access.
Ships in blender-developer-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill when the user:
requests, numpy, Pillow)network permissionValueError: The "package" does not name an extension, or imports that work in a folder add-on but break once installed as an extensionaddon-scaffolding covers the manifest fields, file layout and register symmetry. This skill covers what breaks after that: dependencies, data, network and packaging.
id from blender_manifest.toml (the installed package is bl_ext.<repo>.<id>)sys.version_info measured on 4.5.11 and 5.2.1)Measured with blender --command extension install-file -r user_default into a throwaway BLENDER_USER_RESOURCES, identical on 4.5.11, 5.1.2 and 5.2.1:
| What | Path under the user extensions/ directory | Lifetime |
|---|---|---|
The package (__file__) | user_default/<id>/ | Replaced on every upgrade |
extension_path_user(__package__) | .user/user_default/<id>/ | Survives upgrades; deleted by extension remove |
| Bundled wheels | .local/lib/python3.X/site-packages/ | Outside every package directory, keyed by Python version |
The import name is bl_ext.user_default.<id>, not <id>, and __package__ carries that full name.
Blender does not run pip for an extension, and an extension should not run it either: pip install into Blender's Python changes the interpreter every add-on shares and needs write access to the Blender install. The supported mechanism is wheels shipped inside the package. Per the manual, they must be bundled unmodified from PyPI and must include their own dependencies:
# blender_manifest.toml
wheels = [
"./wheels/requests-2.32.3-py3-none-any.whl",
"./wheels/charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl",
]
Download them with pip on the build machine, matched to Blender's Python and each platform:
pip download requests --dest ./wheels --only-binary=:all: --python-version 3.11 --platform win_amd64
py3-none-any) works everywhere. A compiled one needs a wheel per Python (cp311 for 4.5 LTS, cp313 for 5.2 LTS) and per platform.build --split-platforms writes one zip per platform listed in the manifest's platforms key, so a user downloads only their own wheels.build copies the listed wheels into the zip under wheels/. On install, Blender extracts them into the site-packages directory above, which is already on sys.path, so import requests works with no path code (measured with a hand-built wheel on 4.5.11 and 5.2.1).extension_path_user, never __file__import os
import bpy
def settings_path():
directory = bpy.utils.extension_path_user(__package__, path="", create=True)
return os.path.join(directory, "settings.json")
__file__ is gone after the upgrade; settings.json in the user directory is still there (measured, 0.1.0 → 0.2.0).extension remove deletes the user directory too. If users must keep data across a reinstall, offer an explicit export.extension_path_user("my_addon") raises ValueError: The "package" does not name an extension for anything not shaped bl_ext.<repo>.<id>. A legacy folder add-on cannot use it, so code shared with a bl_info fallback needs its own path, such as bpy.utils.user_resource('CONFIG', path=...).from . import ops). The installed module is bl_ext.user_default.my_addon, and the repository part changes with where the user installs it, so a hardcoded absolute name is wrong somewhere.bpy.app.online_accessDeclaring the permission does not grant access, and code must check both:
[permissions]
network = "Downloads material presets from the project server"
def fetch_presets(url):
if not bpy.app.online_access:
return None # the user has not allowed online access; do nothing online
...
bpy.app.online_access is False in a fresh factory-startup Blender and True under blender --online-mode (measured on all three versions). Users turn it on with Preferences → System → Network → Allow Online Access.files, network, clipboard, camera and microphone as permission keys. The permission is a declaration shown to users, not a sandbox.blender --command extension validate DIR parses the manifest. It rejects a missing id, a non-semver version, an unknown type, an unknown permission key and a malformed blender_version_min. It does not open the files the manifest names, and does not check every value:
| Manifest defect | validate | build |
|---|---|---|
wheels entry whose file does not exist | exit 0 | exit 1, no zip |
platforms = ["win64"] (not a platform name) | exit 0 | — |
schema_version = "9.9.9" | exit 0 | — |
missing id | exit 1 | exit 1 |
All four rows were measured on 4.5.11 and 5.2.1; "—" means not measured. Gate CI on build, which fails on what validate lets through:
blender --factory-startup --command extension validate ./my_addon
blender --factory-startup --command extension build --source-dir ./my_addon --output-dir ./dist
blender --factory-startup --command extension server-generate --repo-dir ./dist # writes dist/index.json
server-generate writes the index.json listing a static extension repository needs. Each entry carries the package id and an archive_url relative to the listing (./my_addon-0.1.0.zip). Host dist/ anywhere that serves files and add it as a remote repository in Blender.
The extension template ships this as a ready workflow: templates/extension-addon-template/.github/workflows/blender.yml builds the package on 4.5 LTS and 5.2 LTS and runs a register/unregister round-trip (tests/check_register.py).
To smoke-test an installed build without touching a real profile, point BLENDER_USER_RESOURCES at a temporary directory, then run extension install-file -r user_default -e dist/<zip> and a --background --python-expr import of bl_ext.user_default.<id>.
subprocess.run([sys.executable, "-m", "pip", "install", ...]) from register(). It mutates the interpreter every add-on shares and fails without write access to the install. Bundle wheels.__file__. The next upgrade deletes them. Use extension_path_user(__package__, create=True).extension_path_user("my_addon") with the bare id. It raises ValueError; pass __package__.import my_addon.utils). The installed package is bl_ext.<repo>.my_addon, with a repository part that varies; use relative imports.bpy.app.online_access at call time; it is False until the user allows online access.extension validate. A missing wheel passes it; run extension build and fail on its exit code.cp311 wheel does not import on 5.2's Python 3.13. Ship one per supported Python and platform.The --command extension subcommands, extension_path_user, online_access, the .user and .local/lib/pythonX.Y/site-packages layout, and the upgrade and remove behaviour above are the same on 4.5 LTS, 5.1 and 5.2 LTS (all measured). What changes between them is the bundled Python (3.11 → 3.13), which decides the wheel tags. Branch on bpy.app.version only for API differences, never for these paths.
addon-scaffolding: the manifest fields, file layout and register_classes_factoryheadless-batch-scripting: running Blender unattended, which is how the CI commands above runextension-addon-template template under templates/, which the example below builds, installs and upgradessnippets/extension-user-data.pyEach example runs headless, asserts the contract, and exits non-zero when it breaks. Run one with blender --background --python <script> --; pass a falsifier flag to watch the check fail.
extension-package-lifecycle: Takes templates/extension-addon-template through what an extension meets after its first run. Falsify: --ship-wheel (exit 4).Short standalone patterns to copy. Each one runs in CI on 5.2 and 4.5 with a check and a falsifier.
bpy.utils.extension_path_user: https://docs.blender.org/api/current/bpy.utils.html#bpy.utils.extension_path_userbpy.app.online_access: https://docs.blender.org/api/current/bpy.app.html#bpy.app.online_accessWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub tmhsdigital/blender-developer-tools --plugin blender-developer-tools27 skills in this plugin
/addon-scaffoldingScaffold a Blender add-on as an Extensions Platform package: blender_manifest.toml, modular file layout, register_classes_factory, symmetric register/unregister. Use when the user starts a new add-on or extension, writes or fixes blender_manifest.toml, asks which layout or registration pattern to use on Blender 4.5 LTS or 5.x, or has classes that fail to register or unregister cleanly. Targets 5.2 LTS with 4.5 LTS fallback./ai-mesh-cleanupOrdered cleanup for an imported generated or scanned mesh before it goes to an engine: scene units, apply rotation and scale, origin to base, recalculate normals, evaluated triangle count, decimate to a budget, convex collider. Use when the user has a GLB, glTF or FBX that is not engine-ready, mentions unit scale, unapplied transforms, triangle budget, LODs or a collision hull, or is about to run mesh operations on an import without checking its scale. Targets 5.2 LTS with 4.5 LTS fallback./bake-high-to-lowCage-bake high-poly surface detail onto a low-poly target as a tangent-space normal map with bpy.ops.object.bake (Cycles, selected-to-active, active Image Texture node, UV layer, save_render). Use when the user wants a normal map from a dense mesh onto a game-resolution or decimated LOD, mentions cage_extrusion or use_selected_to_active, or gets a bake that returns CANCELLED, comes out black or flat, or fails with 'No active UV layer found'. Targets 5.2 LTS with 4.5 LTS fallback./blender-rulesBlender Python anti-pattern rules (bmesh leaks, bpy.ops in loops, deprecated context-copy overrides, bulk mesh writes, prop annotations and context guards, Extensions manifest, import scale, export modifiers, glTF/FBX axis RNA, the removed bgl module, the normals API removed in 4.1). Use when writing, reviewing or fixing any bpy / Blender add-on or script code./bl-info-migrationMigrate a legacy bl_info add-on to the Extensions Platform in three steps, with a before/after diff and the dual-format pattern. Use when the user has a bl_info dictionary in __init__.py, asks whether bl_info is deprecated or still supported, wants to publish to extensions.blender.org or ship an extension .zip, or sees warnings about legacy add-ons at install time. Targets 5.2 LTS; manifests work from 4.2./compositor-nodesBuild and render through the scene compositor from Python across the 4.5 LTS to 5.x split: scene.use_nodes plus scene.node_tree and a Composite node on 4.5, a CompositorNodeTree node group assigned to scene.compositing_node_group with interface sockets and a Group Output on 5.x, a Render Layers to Glare (Fog Glow) chain, the Glare node's move from enum properties to menu input sockets, and render.use_compositing. Use when the user scripts compositor nodes, adds bloom or glow, hits AttributeError on scene.node_tree in 5.x, sets glare_type or quality and gets AttributeError on 5.x, looks for the removed EEVEE use_bloom toggle, or renders and sees no compositor effect. Targets 5.2 LTS with 4.5 LTS fallback.Other plugins' skills for the same job