Skip to main content
Glama

blender-open-mcp

blender-open-mcp是一个开源项目,它使用模型上下文协议 (MCP) 将 Blender 与本地 AI 模型(通过Ollama )集成。这允许您使用自然语言提示来控制 Blender,利用 AI 的强大功能来协助完成 3D 建模任务。

特征

  • **使用自然语言控制 Blender:**向本地运行的 Ollama 模型发送提示以在 Blender 中执行操作。

  • **MCP 集成:**使用模型上下文协议在 AI 模型和 Blender 之间进行结构化通信。

  • **Ollama 支持:**设计用于与 Ollama 配合使用,以便轻松管理本地模型。

  • **Blender 插件:**包括一个 Blender 插件,用于提供用户界面并处理与服务器的通信。

  • **PolyHaven 集成(可选):**通过 AI 提示直接在 Blender 中从PolyHaven下载并使用资产(HDRI、纹理、模型)。

  • 基本3D操作:

    • 获取场景和对象信息

    • 创建基本体

    • 修改和删除对象

    • 应用材料

  • **渲染支持:**使用该工具渲染图像并根据输出检索信息。

Related MCP server: SupaUI MCP Server

安装

先决条件

  1. Blender: Blender 3.0 或更高版本。从blender.org下载。

  2. **Ollama:**从ollama.com安装,按照特定于操作系统的说明进行操作。

  3. Python: Python 3.10 或更高版本。

  4. **uv:**使用pip install uv安装。

  5. **Git:**克隆存储库所需。

安装步骤

  1. 克隆存储库:

    git clone https://github.com/dhakalnirajan/blender-open-mcp.git
    cd blender-open-mcp
  2. 创建并激活虚拟环境(推荐):

    uv venv
    source .venv/bin/activate  # On Linux/macOS
    .venv\Scripts\activate  # On Windows
  3. 安装依赖项:

    uv pip install -e .
  4. 安装 Blender 插件:

    • 打开 Blender。

    • 转到Edit -> Preferences -> Add-ons

    • 单击Install...

    • blender-open-mcp目录中选择addon.py文件。

    • 启用“Blender MCP”插件。

  5. 下载 Ollama 模型(如果尚未安装):

    ollama run llama3.2

    (也可以使用*Gemma3*等其他模型。)

设置

  1. **启动 Ollama 服务器:**确保 Ollama 在后台运行。

  2. 启动 MCP 服务器:

    blender-mcp

    或者,

    python src/blender_open_mcp/server.py

    默认情况下,它监听http://0.0.0.0:8000 ,但您可以修改设置:

    blender-mcp --host 127.0.0.1 --port 8001 --ollama-url http://localhost:11434 --ollama-model llama3.2
  3. 启动Blender附加服务器:

    • 打开 Blender 和 3D 视口。

    • N打开侧边栏。

    • 找到“Blender MCP”面板。

    • 点击“启动 MCP 服务器”。

用法

使用mcp命令行工具与blender-open-mcp交互:

示例命令

  • 基本提示:

    mcp prompt "Hello BlenderMCP!" --host http://localhost:8000
  • 获取场景信息:

    mcp tool get_scene_info --host http://localhost:8000
  • 创建立方体:

    mcp prompt "Create a cube named 'my_cube'." --host http://localhost:8000
  • 渲染图像:

    mcp prompt "Render the image." --host http://localhost:8000
  • 使用 PolyHaven(如果启用):

    mcp prompt "Download a texture from PolyHaven." --host http://localhost:8000

可用工具

工具名称

描述

参数

get_scene_info

检索场景详细信息。

没有任何

get_object_info

检索有关对象的信息。

object_name (字符串)

create_object

创建一个 3D 对象。

typenamelocationrotationscale

modify_object

修改对象的属性。

namelocationrotationscalevisible

delete_object

删除一个对象。

name (字符串)

set_material

为对象指定材质。

object_namematerial_namecolor

render_image

渲染图像。

file_path (字符串)

execute_blender_code

在 Blender 中执行 Python 代码。

code (字符串)

get_polyhaven_categories

列出 PolyHaven 资产类别。

asset_type (字符串)

search_polyhaven_assets

搜索 PolyHaven 资产。

asset_typecategories

download_polyhaven_asset

下载 PolyHaven 资产。

asset_idasset_typeresolutionfile_format

set_texture

应用下载的纹理。

object_nametexture_id

set_ollama_model

设置Ollama模型。

model_name (字符串)

set_ollama_url

设置 Ollama 服务器 URL。

url (字符串)

get_ollama_models

列出可用的 Ollama 模型。

没有任何

故障排除

如果您遇到问题:

  • 确保 Ollama 和blender-open-mcp服务器正在运行。

  • 检查 Blender 的附加组件设置。

  • 验证命令行参数。

  • 请参阅日志以了解错误详细信息。

如需进一步帮助,请访问GitHub 问题页面。


祝您与 AI 愉快融合!🚀

-
security - not tested
F
license - not found
-
quality - not tested

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dhakalnirajan/blender-open-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server