Skip to content

Commit

Permalink
Merge pull request #16 from HeyItsBATMAN/improve-developer-experience
Browse files Browse the repository at this point in the history
Add PyEnv, PIP requirements, Pyright configuration, and a README file
  • Loading branch information
vincentmarchetti authored Nov 23, 2024
2 parents d492067 + aa57cd1 commit 15eace7
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# 3d-blender-plugin
A blender plugin for exporting a IIIF manifest from Blender

## Development

### Requirements

Blender ships with its own version of Python, so you do not actually need anything apart from a code editor to develop this extension.

There are a few tools that can help you with development, if you decide to use them:
- [Pyenv](https://github.com/pyenv/pyenv) - "simple Python version management"
- [Pyright](https://github.com/microsoft/pyright) - "a static type checker for Python"
- [Ruff](https://github.com/astral-sh/ruff) - "an extremely fast Python linter and code formatter"

All of these are **opt-in** and **not required** to develop the plugin.

### Setup

To initialize the development environment, run the following commands:

```bash
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```

This should create a virtual environment, install the required dependencies, activate the virtual environment, and allow Pyright to find the Blender specific types.

### Using the plugin

To use the plugin, you need to install it in Blender.
For development, the easiest way is to create a symlink from the Blender `user_default` directory to this directory.

[This is how you can find the relevant directory depending on your operating system.](https://docs.blender.org/manual/en/4.2/advanced/blender_directory_layout.html)

For example, on Linux you can run the following command:

```bash
ln -s /path/to/this/plugin ~/.config/blender/4.2/extensions/user_default/iiif_blender
```
8 changes: 8 additions & 0 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"venvPath": ".",
"venv": "venv",
"typeCheckingMode": "basic",
"reportMissingImports": true,
"pythonVersion": "3.12",
"extraPaths": ["./venv/lib/python3.12/site-packages"]
}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fake-bpy-module-4.2==20241010

0 comments on commit 15eace7

Please sign in to comment.