Skip to content

b0o/blender-addon-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blender Add-on Template

This is a template for creating Blender add-ons. It uses uv to manage dependencies and virtual environments.

Getting Started

  1. Change names and info in the following files (don't forget the copyright headers):
  • pyproject.toml (including the path in the [tool.hatch.version] section)
  • my_addon/__init__.py
  • my_addon/auto_load.py (copyright header only)
  • my_addon/panel_mypanel.py
  1. Rename the my_addon directory to the name of your add-on. It should match the name in pyproject.toml

  2. Install uv and run uv sync to initialize the virtual environment and install the dependencies:

uv sync

Developing your Add-on

  1. Activate the virtual environment:
source .venv/bin/activate
  1. Open your editor and start developing your add-on. Preferably, start your editor from inside of the virtualenv shell so that your editor's LSP is aware of the virtual environment and dependencies.

Packaging

When you are ready to package your add-on for distribution, run the following command:

./scripts/build.sh

This will create a zip file in the dist directory which users can install in Blender.

Notes

  • The my_addon/auto_load.py file is a helper which automatically discovers, registers, and unregisters your add-on classes. If you prefer a simpler approach, you can remove this file and manually register/unregister your add-on classes in the register and unregister functions in my_addon/__init__.py.

License

Blender Add-on Template © 2024 Maddison Hellstrom

GNU General Public License v2.0 or later

Sponsor this project