feature
- reopen blender (sometime need reopen blender for fix bug)
- open text with external editor
- append sys.path
addon project structure
project name
|-README.md
|-LICENSE
|-dist
|-docs
|-test
|-src
|-__init__.py
|-data.blend
|-...
|-.gitignore
|-.pylintrc
dev tools
blender
blender addon:
scripter.py
Icon Viewer
code editor: vscode
vscode addon:
blender development
vscode-python
lint: pylints
format: autopep8
debug: ipdb
version control: git
fake-bpy-module
tips
- add link addon to blender addon dir
- console first
- run blender in vscode terminal
- use python console and text editor to test code
blender --python-console --background
blender --background -P test.py
# use system python package
# when install blender from office site
PYTHONPATH="/usr/local/lib/python3.7/dist-packages/:/usr/lib/python3/dist-packages" ./blender ...
PYTHONPATH="/usr/local/lib/python3.7/dist-packages/:/usr/lib/python3/dist-packages" ./blender --python-console
# python-console with IPython
PYTHONPATH="/usr/local/lib/python3.7/dist-packages/:/usr/lib/python3/dist-packages" ./blender --python-console --background
import IPython;IPython.embed() # for autocomplete
sudo apt install python3 blender vscode git
sudo pip3 install ipdb autopep8 pylints
git clone https://github.com/nutti/fake-bpy-module
get extra path
blender --background --python-expr "import sys;print(sys.path)"
add extra path and fake-bpy-module path to settings.json
add extra path and fake-bpy-module path to .pylintrc
- link addon to addon path
- reload(unregister()->register()) all addons for
- use ipdb for breakpoint
- show info
# terminal
print()
# info windows
self.report()
# pop windows
def oops(self, context):
self.layout.label("You have done something you shouldn't do!")
bpy.context.window_manager.popup_menu(oops, title="Error", icon='ERROR')
- package with python script: package task
https://developer.blender.org/project/view/3/
- vscode
- vscode-python
- blender api
- https://docs.blender.org/api/master/info_tips_and_tricks.html
- templates->python
- blender buildin script