Skip to main content

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.8-py3-none-any.whl"]

Runtime 通过随 Extension 分发的同一份 BlendJob wheel 启动独立 Server,不会在独立 Environment 中再次安装 BlendJob。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.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blendjob 0.1.8
File Size Uploaded
blendjob-0.1.8.tar.gz 20.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for blendjob 0.1.8
File Interpreter ABI Platform
blendjob-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 45.4 kB

Release files / blendjob-0.1.8.tar.gz

Download URL blendjob-0.1.8.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
502c1cfcf9f921e3fb0aa10fae8c9f1c8784b4ab60ac2bda9854b8d5efe37da5
BLAKE2b-256 checksum
How to use checksums
feea49aa43e55444037d2ccf81e5debc7f4c55970d0174f4a1ad0aa9941518dc
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.8-py3-none-any.whl

Download URL blendjob-0.1.8-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e94b42dfe0dde62702dff119243d5db3bfd4b4b3f0553191aaada1452b4338d
BLAKE2b-256 checksum
How to use checksums
2e5b725897f8efd3c65b6dc220a740130d819fd8d1b2538422471113711cf22f
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 history Release notifications | RSS feed

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.14

2 release files

0.1.13

2 release files

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page