Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wildpeaks/template-blender-vscode
Blender script template for VSCode
https://github.com/wildpeaks/template-blender-vscode
blender python3 vscode
Last synced: 23 days ago
JSON representation
Blender script template for VSCode
- Host: GitHub
- URL: https://github.com/wildpeaks/template-blender-vscode
- Owner: wildpeaks
- License: mit
- Created: 2022-08-06T01:03:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-06T01:09:39.000Z (over 2 years ago)
- Last Synced: 2024-11-06T03:11:50.686Z (2 months ago)
- Topics: blender, python3, vscode
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Template: Blender script
## Setup
Python:
1. Install **Python 3** from https://www.python.org/ and enable `Add to PATH` option during install.
2. Disable the placeholder aliases `python.exe` and `python3.exe` in `Start Menu` → `Manage app execution aliases`VSCode:
1. Install **VSCode** from https://code.visualstudio.com/.
2. Open this folder in VSCode: it will prompt you to install recommended extensions (the list is defined in `/.vscode/extensions.json`).
3. When you have a `.py` file open in VSCode, click `Select Interpreter` (in the status bar at the bottom) to pick the Python version you just installed.
4. Open a Terminal in VSCode and run: `pip install fake-bpy-module-3.2` (to match Blender 3.2.x)
5. Restart VSCodeAt this stage, you should have Intellisense for simple scripts:
```py
import math
print(math.pi)
```
and Blender scripts:
```py
import bpy
bpy.ops.mesh.primitive_monkey_add()
```## Run in Blender
1. In Blender `Scripting` workspace, in the text editor, click `Open` and locate your `.py` file. This will open it in Blender's text editor.
2. Click the triangle button `Run Script` to execute it once.
3. From now on, you can edit in VSCode but it won't show the changed script in Blender's text editor unless you click the red `Resolve conflict` → `Reload from disk` button.You can skip clicking Reload and click only Run using a second scrip, see template `External Script Stub` and https://docs.blender.org/api/current/info_tips_and_tricks.html#executing-external-scripts.