Another way to add code autocomplete when developing Blender add-ons in Visual Studio Code

To improve the speed and convenience of developing Blender add-ons with Microsoft Visual Studio Code, this IDE can show the code auto-completion for common Blender API types.

This way of adding autocomplete is by Zen3515.

  1. Make a Git repository for your add-on project, for example on GitHub, and clone it to your local machine.
  2. In the Git console switch to the created repository.

  1. Add a repository with autocomplete files as a git submodule.

  1. In your project directory create a “.vscode” folder and create a “settings.json” file in it.

  1. Open the generated JSON file and fill it as follows:

The first line contains the path to the required version of the autocomplete directory from the downloaded submodule.

In the second line specify the path to the “modules” folder for the Blender installed on your computer. For example:

  1. Start Visual Studio Code and open your project.
  2. Install Blender as an interpreter.

First, install the “Python” Visual Studio Code extension if you do not have it installed.

Press F1 (or ctrl + shift + p). Type the “Python: Select Interpreter” and specify the path to the “python.exe” file in the currently used Blender directory. For example:

Now everything is ready, when you type the code in your project files in Visual Studio Code, auto-completion tips will be displayed automatically.

Nikita

Author: Nikita

Blender add-ons developer and articles writer.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comment
Inline Feedbacks
View all comments