Blender Development in VS Code
The only key combination you have to remember is
The extension is installed like any other extension in Visual Studio Code.
How do I create a new addon?
Execute the Blender: New Addon operator and use the setup wizard. You will be asked for the following information:
How can I use the extension with my existing addon?
The extension only supports addons that have a folder structure.
If your addon is a single
To use the extension with your addon, just load the addon folder into Visual Studio Code.
Then execute the
After you choose a path, Blender will open. The terminal output can be seen inside of VS Code. The first time you open a new Blender build like this can take a few seconds longer than usual because some Python libraries are installed automatically. For that it is important that you have an internet connection.
Once Blender is started, you can use the Addon in Blender. Debugging should work now.
If the selected Blender executable does not use its own Python version, no packages will be installed by default.
This is to make sure that the extension does not interfere with another package manager.
You can either install the modules listed in the error message manually, or allow the extension to install the modules itself.
To do that, the
How can I reload my addon in Blender?
To reload the addon every time a file is saved, active the
When I say "script" I mean a piece of Python code that runs in Blender but is not an addon. Scripts are best to test and learn Blenders Python API but also to solve simple tasks at hand. Usually scripts are written in Blenders text editor. However, the text editor has fairly limited capabilities compared to modern text editors and IDEs.
For script writing this extension offers
How can I create a new script?
The new script file already contains a little bit of code to make it easier to get started.
How can I run the script in Blender?
First you have to start a Blender instance by executing the
How can I change the context the script runs in?
Currently the support for this is very basic, but still useful.
To run the script in a specific area type in Blender insert a comment like
This extension is not actively developed anymore. However, if you are interested in working on this extension, please contact me.