• Stars
    star
    558
  • Rank 79,819 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Visual Studio Code extension for Blender development.

Blender Development in VS Code

The only key combination you have to remember is ctrl+shift+P. All commands of this extension can be found by searching for Blender.

Installation

The extension is installed like any other extension in Visual Studio Code.

Addon Tools

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:

  • Which addon template should be used?
  • Where should the addon be created? This should be an empty folder, preferably without spaces or special characters in the name.
  • What is the name of the addon?
  • What is you name?

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 .py file, you have to convert it first. To do this, move the file into a new empty folder and rename it to __init__.py.

To use the extension with your addon, just load the addon folder into Visual Studio Code. Then execute the Blender: Start command. This will ask you for a path to a Blender executable. Only Blender 2.8 is supported.

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 blender.allowModifyExternalPython setting has to be checked in VS Code.

How can I reload my addon in Blender?

Execute the Blender: Reload Addons command. For that to work, Blender has to be started using the extension. Your addon does not need to support reloading itself. It only has to have correct register and unregister methods.

To reload the addon every time a file is saved, active the blender.addon.reloadOnSave setting in VS Code.

Script Tools

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

  • all text editing features VS Code and its extensions can offer
  • a way to quickly organize your scripts into folders
  • easy execution of the script inside of Blender
  • a simple way to change the context, the script runs in
  • debugging

How can I create a new script?

Execute the Blender: New Script command. You will be asked for a folder to save the script and a script name. For quick tests you can also just use the given default name.

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 Blender: Start command. To execute the script in all Blender instances that have been started this way, execute the Blender: Run Script command.

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 #context.area: VIEW_3D. The preferred way to insert this comment is to execute the Blender: Set Script Context command.

Troubleshooting

  • Make sure you use the newest version of VS Code.
  • Use the latest Blender version from https://builder.blender.org/.
  • If your Blender does not use its own Python version, enable blender.allowModifyExternalPython or install the packages in the error message manually (currently debugpy, flask and requests are required).

Status

This extension is not actively developed anymore. However, if you are interested in working on this extension, please contact me.

More Repositories

1

animation_nodes

Node based visual scripting system designed for motion graphics in Blender.
Python
2,275
star
2

code_autocomplete

Auto Completion and more in Blenders text editor.
Python
133
star
3

Blender-Camera-Addon

Professional camera animations for motion graphics.
Python
86
star
4

animation_nodes_manual

Official documentation repository for the Animation Nodes Project.
HTML
53
star
5

everything_nodes_prototype

(This repository will not be developed further.) Testing different kinds of node systems in Blender.
Python
37
star
6

gcov-viewer

Show code coverage data generated with gcov in Visual Studio code.
TypeScript
26
star
7

Lens-Flares

Create Lens Flares in Blender
Python
21
star
8

blender

Blender 3D clone and private branches
C
15
star
9

animation_nodes_website

HTML
8
star
10

compute_nodes

Proof of concept for a visual functional programming language in Blender
Python
8
star
11

AudioToMarkers

Python
7
star
12

terminal_helper

Create blender terminal commands
Python
7
star
13

function_nodes_ui

Python
6
star
14

Mocam

Motion Graphics Camera for Blender
Python
5
star
15

particle_nodes_prototype

UI prototype for a node based particle system.
Python
4
star
16

Gras-Generator

Make it less peinfull to create simple gras in Blender
Python
4
star
17

flexlayout

Python
3
star
18

looping_slides

Python
3
star
19

BoolTool-extension

I tried a few changes with the BoolTool addon of Vitor Balbio
Python
3
star
20

small-blender-scripts

Some small scripts/addons I developed
Python
3
star
21

driver_copy

Python
3
star
22

aws_render

Python
2
star
23

node_mockups

Mockups for some nodes.
Python
2
star
24

blender_vscode_manual

2
star
25

audio_to_markers

Python
2
star
26

blender_pretty_printers

Python
2
star
27

gate_sim

C++
2
star
28

throughput_analysis

HTML
1
star
29

node_layers_prototype

Python
1
star
30

Copy-Rigid-Body-Settings

Copy rigid body settings to group members
Python
1
star
31

custom_props_edit

Remove many custom properties at once (atm)
Python
1
star
32

retrieval_practice

1
star
33

deselect_play

Python
1
star
34

brainfuck_interpreter

Simple brainfuck interpreter in Python, just for fun.
Python
1
star
35

picture_frame_generator

Python
1
star
36

jlucke.com

HTML
1
star