BlendJob
BlendJob 是面向 Blender Add-on 的本地 Job Server 运行时。它把 Blender Operator、独立 Python Environment、HTTP Job Server、FIFO Queue、进度、取消和 Resource 生命周期组合成一套可复用 API。
BlendJob 适合需要在 Blender 界面之外运行 AI 推理、模型下载、媒体处理或其它重型 Python 任务的 Add-on。Blender 主进程只保留轻量 Client 和 UI 逻辑,业务依赖安装在独立 Environment 中。
要求
- Python 3.10 或更高版本
- 支持 Python 3.10+ 的 Blender 版本
- Windows x64、macOS arm64 或 Linux x64;内建 uv 安装器目前只提供这些平台
安装
普通 Python 项目可以使用 pip 或 uv:
python -m pip install blendjob
uv add blendjob
默认安装保持零依赖,适合 Blender 主进程。需要在普通 Python 环境中直接创建 FastAPI App 或运行 Runner 时,安装 server extra:
python -m pip install "blendjob[server]"
Blender Extension 需要把 BlendJob wheel 随扩展分发,并在 blender_manifest.toml 中声明:
wheels = ["./wheels/blendjob-0.1.7-py3-none-any.whl"]
Runtime 会在独立 Environment 中自动安装与 Blender 侧相同版本的 BlendJob,使 Server Python 可以执行 python -m blendjob.runner。packages 只声明 Job 自身的额外依赖;没有额外依赖时可以省略:
environment = {
"python": "3.10",
}
最小示例
Server package 导出一个 JobServer:
from blendjob import JobServer
server = JobServer("Example Job Server")
@server.job("double")
def double(context, parameters):
context.progress(0.5, "Calculating")
return {"value": parameters["value"] * 2}
Blender 侧创建一个 Runtime,并让业务 Operator 继承绑定后的基类:
from pathlib import Path
from blendjob import JobRuntime
runtime = JobRuntime(
"server:server",
entrypoint_root=Path(__file__).parent,
storage_root=Path.home() / ".example-addon",
environment=environment,
namespace="example_addon",
)
JobOperatorBase = runtime.JobOperatorBase
完整的 Runtime、Operator、Server Handler、Resource 和存储结构说明见 开发者指南。
开发
uv sync
uv run pytest
uv build
uv run mkdocs build --strict
版本化文档使用 Mike:
uv run mike deploy --update-aliases 0.1 latest
uv run mike set-default latest
License
BlendJob 使用 MIT License。
Metadata
Release files for blendjob 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| blendjob-0.1.7.tar.gz | 19.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| blendjob-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.5 kB
Release files / blendjob-0.1.7.tar.gz
| Download URL | blendjob-0.1.7.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed664593c5dd1d3cedabbbf9167dbadcf61e2546c64618208c23b6cf7e7bee0f
|
|
BLAKE2b-256 checksum How to use checksums |
952d9cd6b29be9c33c4497e7dfcdd8c6693168df7d0ea9928fb3e145f6912269
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / blendjob-0.1.7-py3-none-any.whl
| Download URL | blendjob-0.1.7-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2cfde26146335da16d51824a73a512a706680011f9ba451d90fc86c1ba42332
|
|
BLAKE2b-256 checksum How to use checksums |
61b9d5596ee52e4d3a04df9681e43d1f96047d6e750f356d9a72a083a465967a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|