Tip
Check CHANGELOG for changes and new features.
Prefer the previous layout? Browse the classic README.
Blender addon development with python debugger. Everything you need is available through the Blender command palette menu (press Ctrl+Shift+P).
- Install the extension the same way you install any VS Code extension (id:
JacquesLucke.blender-development). - Open the addon folder (one per workspace) and press
Ctrl+Shift+P→Blender: Start. - Choose a Blender executable (any Blender ≥ 2.8.34) and wait for the session to launch.
- Use
Blender: Reload Addonsafter editing your addon andBlender: Run Scriptto execute scripts.
Opening Blender for the first time may take longer because dependency libraries are set up automatically.
Extensions and legacy addons (pre Blender 4.2) are supported. For migration guide visit Legacy vs Extension Add-ons. VS code uses the automatic logic to determine if you are using addon or extension
Note
VS Code automatically creates permanent symlinks (junctions on Windows) so your addon is visble inside Blender:
- Addons:
bpy.utils.user_resource("SCRIPTS", path="addons") - Extensions:
bpy.utils.user_resource("EXTENSIONS", path="vscode_development")
- Run
Blender: New Addonto scaffold a ready-to-use addon folder. The wizard asks which template to use, where to save the addon (prefer an empty folder without spaces), what to name it, and who is authoring it. - Once the scaffold exists, open it in VS Code to start developing. All commands, including reload and script runners, work immediately because VS Code creates the required symlinks.
- This extension works with folder-based addons or extensions. If your addon is just single file
something.py, move it into a folder and rename the file to__init__.py. - Open the folder for your addon in VS Code, run
Ctrl+Shift+P→Blender: Start, and point the command at a Blender executable (Blender ≥ 2.8.34). The terminal output appears inside VS Code and you can debug as usual with breakpoints. - The very first launch can take longer because Blender installs the required Python dependencies automatically; keep a stable internet connection during that run.
- Debugging is limited to workspace files by default. Disable
blender.addon.justMyCodeif you want to step into third-party libraries (caution: this can make Blender less stable in rare cases). - Use
Blender: Reload Addonsafter each change (requires Blender started via the extension). - Enable
blender.addon.reloadOnSaveto trigger reload automatically on save.
Warning
In some cases uninstalling addon using Blender Preferences UI interface might lead to data loss. So don't use UI to uninstall, just delete the link manually.
Set blender.environmentVariables to point Blender to a dedicated development workspace:
"blender.environmentVariables": {
"BLENDER_USER_RESOURCES": "${workspaceFolder}/blender_vscode_development"
}This keeps settings, addons, and user scripts separate from your daily Blender setup. You can also specify the finer-grained `BLENDER_USER_*` variables listed here:
Environment Variables:
$BLENDER_USER_RESOURCES Replace default directory of all user files.
Other 'BLENDER_USER_*' variables override when set.
$BLENDER_USER_CONFIG Directory for user configuration files.
$BLENDER_USER_SCRIPTS Directory for user scripts.
$BLENDER_USER_EXTENSIONS Directory for user extensions.
$BLENDER_USER_DATAFILES Directory for user data files (icons, translations, ..).
This extension helps you write, run, and debug standalone Blender scripts that are not full addons.
Warning
Running scripts from VS Code occasionally crashes Blender. Keep your work saved and restart Blender if it becomes unresponsive. Don't go crazy with you scripts!
- Execute
Blender: New Scriptand follow the prompts to create a script in your chosen folder. - Run
Blender: Run Scriptto execute every script in any open Blender session started through VS Code. Blender will automatically start if no instances are running. - Insert a comment like
#context.area: VIEW_3Dor runBlender: Set Script Contextto control where scripts execute. - Pass CLI arguments by adding them after
--inblender.additionalArguments(they become available insys.argv).
Common pitfalls:
- Avoid calling
sys.exitinside Blender scripts (see sys.exit gotcha). - Prefer
bpy.utils.register_cli_commandwhen wiring command line entry points.
The extension is driven by settings (search for blender. inside VS Code settings). A few useful ones:
blender.additionalArguments: pass extra CLI flags and optionally a default.blendfile (prefer this as the last argument).blender.preFileArguments/blender.postFileArguments: control where Blender expects file names in the argument list.blender.executables: register frequently used Blender installations and mark one with"isDefault": trueto keep prompts silent.blender.addon.justMyCode: disable to step into third-party libraries while debugging.blender.addon.reloadOnSave: reload addons every time a workspace file changes while Blender is running.blender.addon.logLevel: control the verbosity of the Blender output channel for debugging.
Add entries to keybindings.json to trigger commands:
{
"key": "ctrl+h",
"command": "blender.start"
}For advanced usage (choose a specific executable or script):
{
"key": "ctrl+h",
"command": "blender.start",
"args": {
"blenderExecutable": { "path": "C:\\path\\blender.exe" },
"script": "C:\\path\\script.py"
}
}Run scripts with shortcuts as well:
{
"key": "ctrl+shift+enter",
"command": "blender.runScript",
"when": "editorLangId == 'python'"
}- Use the latest VS Code and Blender builds.
- Check
CHANGELOG.mdfor breaking changes. - Search issues on GitHub before filing a new one.
- Enable debug logs via
blender.addon.logLeveland inspect theBlenderoutput channel in VS Code.
- The extension is no longer in active feature development.
- Bugs are welcome; please file issues with as much detail as possible.
- Want to help? Follow the instructions in DEVELOPMENT.md to get started.