Your development environment is configured and ready for Blender addon development.
- Python 3.13.5 (via virtual environment)
- Blender Python API (fake-bpy-module-4.2 for autocomplete)
- Testing: pytest, pytest-cov, pytest-mock, pytest-benchmark
- Code Quality: black, pylint, mypy, flake8, pre-commit
- AI Integration: anthropic SDK for Claude API
- Documentation: Sphinx
- Scientific: NumPy, SciPy (for geometry calculations)
Windows (CMD):
activate.batWindows (Git Bash) / Linux / macOS:
source activate.shpython -c "import bpy; print('Blender API available')"
pytest --version
black --versionblack sulo_ai/pylint sulo_ai/
flake8 sulo_ai/mypy sulo_ai/# All tests
pytest tests/
# Unit tests only
pytest tests/unit/
# With coverage
pytest tests/ --cov=sulo_ai --cov-report=html# Run all code quality checks
black sulo_ai/ tests/
pylint sulo_ai/
mypy sulo_ai/
flake8 sulo_ai/sulo-ai/
├── sulo_ai/ # Main addon code (goes into Blender)
│ ├── core/ # Pure Python algorithms (no Blender deps)
│ ├── blender/ # Blender-specific code
│ ├── ai/ # Claude API integration
│ ├── ui/ # User interface
│ └── utils/ # Utilities
├── tests/ # Test suite
├── venv/ # Virtual environment (gitignored)
└── requirements.txt # Python dependencies
Option 1: Symlink (Development)
# Run the install script
bash scripts/install_dev.shOption 2: Manual Installation
- In Blender: Edit → Preferences → Add-ons
- Click "Install"
- Navigate to
sulo_ai/folder - Select
__init__.py - Enable "Sulo AI"
In Blender Python Console:
import bpy
bpy.ops.script.reload()- ✅ Blender 4.2 (primary development target)
- ✅ Blender 4.5 (tested compatible)
- ✅ Blender 4.0+ (should work)
Install extensions:
- Python (Microsoft)
- Pylance (Microsoft)
- Blender Development (Jacques Lucke)
Your environment already has fake-bpy-module-4.2 installed, so you'll get:
- ✅ Autocomplete for Blender API
- ✅ Type hints for
bpymodule - ✅ Inline documentation
- File → Settings → Project → Python Interpreter
- Select
venv/Scripts/python.exe - PyCharm will detect all installed packages
# Single file
pytest tests/unit/test_packing.py
# Single test
pytest tests/unit/test_packing.py::test_pack_islands_basic
# With verbose output
pytest tests/unit/test_packing.py -vpytest tests/ --cov=sulo_ai --cov-report=html
# Open htmlcov/index.html in browserAdd to .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"python": "${workspaceFolder}/venv/Scripts/python.exe"
}
]
}See requirements.txt for full list. Key packages:
anthropic- Claude API clientrequests- HTTP clientpytest- Testing frameworkblack- Code formatterfake-bpy-module-4.2- Blender API stubs
# Activate environment first
source activate.sh # or activate.bat
# Update all packages
pip install --upgrade -r requirements.txt
# Update specific package
pip install --upgrade anthropicSolution: This is normal in the dev environment. The addon runs inside Blender's Python, which has the real bpy module.
Solution: Restart your IDE after installing dependencies.
Solution: Make sure you've activated the virtual environment.
Need help? Check the context files in context/ directory for detailed documentation.