Blender MCP

官方

一個輕量級的 MCP(模型上下文協定)伺服器,專為 Blender 設計。它提供與 Blender Python API 的自然語言介面,改善對文件資料的存取,並讓使用者能夠探索與理解複雜的設定。

你可以用 Blender MCP 做什麼?

  • 場景效能分析 — 請你的 AI 分析開啟中的 Blender 場景,並找出相對於螢幕尺寸而言多邊形數量過高的物件,就像教室範例中的離群值偵測一樣。
  • 資料區塊重新命名 — 讓助理修正目前檔案中所有資料區塊的拼字錯誤,或建議更具描述性的名稱,且僅在你核准後才套用變更。
  • 自然語言場景查詢 — 詢問關於物件關聯性的問題,例如「哪些物件使用了『pebbles』材質?」或找出場景中多邊形數量最高的物件。
  • 幾何節點文件 — 請求說明主要的幾何節點設定,包含內嵌的影格文件,以及一個總結分析結果的文字資料區塊。
  • 場景除錯 — 取得疑難排解的協助,例如非均勻縮放的網格、錯誤的法線,或未正確隨骨架變形的物件。

文件

一個輕量級的 MCP(Model Context Protocol)伺服器,專為 Blender 設計。它提供與 Blender Python API 的自然語言介面,改善對文件資料的存取,並讓使用者能探索與理解複雜的設定。

有關架構的技術細節與文件,請參閱原始碼

[!warning] 警告 安全警告
此 MCP 伺服器會在 Blender 中執行 LLM 生成的程式碼,且沒有任何防護措施來保護您的資料免於被刪除或傳送至遠端位置。為確保資料安全,建議使用虛擬機器,或在不含敏感資訊的系統上執行。

安裝

Blender 本身沒有內建連線至 LLM 的功能。

為了讓 Blender 能與 LLM 連線,必須手動下載、安裝並執行三個外部工具


附加元件

若要與您的 Blender 工作階段互動,您需要安裝一個特定的附加元件,以整合 MCP 伺服器。

…或下載從磁碟安裝

如果您使用拖放方式匯入 Blender,您需要執行兩次。第一次是新增 Blender Lab 儲存庫,第二次是安裝附加元件本身。此方法可讓您在附加元件有新版本可用時收到更新通知。


LLM 用戶端

MCP 伺服器遵循明確定義的標準,並與眾多用戶端相容。請遵循 LLama.cpp 文件,或安裝您偏好的 LLM 用戶端。


MCP 伺服器

根據您的 LLM 用戶端功能,有多種安裝 MCP 伺服器的方式。

  • MCP 套件:對於支援 .mcpb 檔案的較新用戶端,請從發布頁面下載最新套件Llama.cpp 目前尚不支援此功能。
  • MCP 伺服器:若要從原始碼安裝,請參閱 Llama.cpp 文件設定說明

執行

一旦您在 LLM 用戶端中設定好 MCP 伺服器,即可開始探索您的 Blender 場景。

執行 blender-mcp 伺服器的 llama.cpp 網頁介面。


範例 1:場景分析

MCP 可用於以程式化方式分析場景中的效能瓶頸。以 Classroom 示範檔案為例:

Classroom 示範檔案。

此場景是 Blender 基準測試檔案之一。這些檔案之所以納入基準測試,是因為它們能良好代表藝術家創作的實際生產檔案。而其中包含可最佳化的物件,並不令人意外。

雖然檢查多邊形數量通常已足夠,但更有趣的是根據物件在最終渲染中的顯示大小,來繪製多邊形數量。這可以透過以下提示詞獲得。

Analyze the scene and list the outliers: objects with highest polygon count but smaller size from the camera point of view.

繪製出的結果資料清楚顯示兩個與其他物件明顯不同的物件:alphabetcoat 1

Graph analysis of the polycount per screen area

Classroom 示範場景中,每個畫面區域的多邊形數量圖形分析。

alphabet 物件有 20,000 個多邊形。由於其扁平的分佈,可以用紋理取代,且對最終結果影響甚微。coat 1 物件因 Subsurf 修改器而有 37,000 個多邊形。如果記憶體是您系統的瓶頸,降低細分層級可以減輕場景負擔。

字母位於場景後方,可以輕鬆用紋理取代。外套也距離夠遠,可以簡化其網格。

[!info] 資訊 這些結果有多可靠?

LLM 回傳的初始分析僅考慮影響視埠的修改器。coat 1 物件具有 Solidify 修改器,使其多邊形數量加倍,成為更明顯的離群值。雖然此場景未啟用 Simplify,但此設定也會影響最終分析。


範例 2:各種提示詞

以下是其他已測試的使用案例。您需要貼上完整的「提示詞」內容才能運作。作為起點,您應使用對應的示範檔案。操作的成功與否取決於所使用的模型。

使用案例提示詞示範檔案結果
資料區塊重新命名:修正拼寫錯誤With the current open Blender file fix the name of all the data-blocks to remove typos. Report back which data-blocks got fixed.Scattering PebblesGRP-rocks → GRP-pebble、LGT-Lights → LGT-lights、Compositing Nodetree → Compositing Node Tree
資料區塊重新命名:更好的名稱With the current open Blender file suggest descriptive names for all data-blocks, and apply if approved.Scattering PebblesCamera → CAM-main、Area → LGT-sun-key、Area.001 → LGT-sun-fill、Area.002 → LGT-area-rim、GEO-pebble.001 → GEO-pebble-B、…
使用自然語言查詢資料關係Which objects are using the following material: pebblesScattering Pebbles7 個物件:GEO-pebble、GEO-pebble.001、GEO-pebble.002、GEO-pebble.003、GEO-pebble.004、GEO-pebble.005、GEO-pebble.006
場景除錯What is the object with the highest poly-count on this file? Ignore objects which are not linked to any scene.Scattering PebblesGEO-ground 有 4,096 個面。
Geometry Nodes 文件With the current open Blender file explain what the main geometry nodes setup is doing. Add inline documentation for it with frame elements. Create a Text data-block with the result of analysis.Scattering Pebbles4 個主要顏色編碼框架 + 含說明的文字檔案。

其他尚未探索的提示詞:

  • 將所有資料區塊從法文翻譯成英文。
  • 我的網格沒有被骨架變形,該如何修正?
  • Blender 在渲染此場景時記憶體不足,該如何最佳化?
  • 此網格有奇怪的著色偽影,該如何修正?
  • 找出具有法線異常網格的物件。
  • 檢查場景中是否有非均勻變換的網格物件。
  • 我匯出的影片無法在網頁瀏覽器中播放,應該更改哪些設定?
  • 建立和細化樹枝時,應該使用哪些雕刻筆刷?
  • 設定合成節點,將影像同時儲存為 SDR 和 HDR。
  • 驗證此檢查清單:網格必須為流形、所有物件必須有材質、命名必須符合慣例、不得有絕對路徑、… 資料區塊重新命名:修正拼寫錯誤

GRP-rocksGRP-pebbles(場景中僅包含鵝卵石物件,而非岩石)。

LGT-LightsLGT-lights(大小寫不一致)。

Compositing NodetreeCompositing Node Tree(Nodetree 是複合詞錯誤)。

資料區塊重新命名:更好的名稱

物件

  • CameraCAM-main
  • AreaLGT-sun-key
  • Area.001LGT-sun-fill
  • Area.002LGT-area-rim
  • GEO-pebble.001GEO-pebble-B
  • GEO-pebble.002GEO-pebble-C
  • GEO-pebble.003GEO-pebble-D
  • GEO-pebble.004GEO-pebble-E
  • GEO-pebble.005GEO-pebble-F
  • GEO-pebble.006GEO-pebble-G

燈光資料區塊

  • AreaLGT-sun-key
  • Area.001LGT-sun-fill
  • Area.002LGT-area-rim

相機資料區塊

  • CameraCAM-main

紋理

  • TextureTEX-ground-clouds
  • Texture.001TEX-ground-image

場景與世界

  • WorldWLD-environment
  • SceneSCN-main Geometry Nodes 文件

建立的新框架

Documentation frames added to the geometry nodes setup.

新增至 geometry nodes 設定的文件框架。

文字資料區塊

GEOMETRY NODES ANALYSIS -- "Pebble Scattering Nodes"
Applied to object: GEO-ground   |   Modifier: Pebbles
========================================================

OVERVIEW
--------
This node group scatters three size categories of pebble meshes across
the faces of a ground mesh.  Each category uses its own density mask
and a global Factor multiplier so that coverage can be art-directed
per-layer without touching the raw mask textures.  The three resulting
instance layers are merged with the original ground geometry and sent
to the Group Output.

INPUTS (Group Interface)
------------------------
  Geometry           -- The ground mesh to scatter pebbles on.
  Large Pebbles Mask -- Float mask (e.g. vertex colour / texture) that
                       defines WHERE large pebbles may appear.
  Medium Pebbles Mask-- Float mask for medium pebble placement regions.
  Small Pebbles Mask -- Float mask for small pebble placement regions.
  Factor             -- Global density multiplier shared by all three
                       lanes (appears three times in the interface,
                       one per lane).

NODE GRAPH -- LANE BY LANE
--------------------------

+- LARGE PEBBLES LANE -----------------------------------------------------+
|  Source object : GEO-pebble                                              |
|  Group Input.001                                                         |
|    +- Geometry ------------------------> Distribute Points on Faces      |
|    +- Large Pebbles Mask ------------> Distribute Points on Faces        |
|    |                                     (Density Factor socket)         |
|    +- Factor --> Math.003 (x)  -------> Distribute Points on Faces       |
|                                          (Density Max socket)            |
|  Distribute Points on Faces ----------> Instance on Points               |
|  Object Info (GEO-pebble) -----------> Instance on Points (Instance)     |
|  Random Rotation.001 [-pi, +pi] -----> Instance on Points (Rotation)     |
|  Random Value [0.25 - 0.60]   -------> Instance on Points (Scale)        |
|  Instance on Points ------------------> Join Geometry.003                |
+--------------------------------------------------------------------------+

+- MEDIUM PEBBLES LANE ----------------------------------------------------+
|  Source object : GEO-pebble.004                                          |
|  Group Input.002                                                         |
|    +- Geometry ------------------------> Distribute Points on Faces.001  |
|    +- Medium Pebbles Mask -----------> Math.004 (x) --> Math.005 (x)     |
|    +- Factor ------------------------> Math.005 (x)                      |
|         Math.005 output --------------> Distribute Points on Faces.001   |
|                                          (Density socket)                |
|  Distribute Points on Faces.001 -----> Instance on Points.001            |
|  Object Info.001 (GEO-pebble.004) --> Instance on Points.001             |
|  Random Rotation.002 [-pi, +pi]  ----> Instance on Points.001            |
|  Random Value.002 [0.25 - 0.45] -----> Instance on Points.001            |
|  Instance on Points.001 -------------> Join Geometry.003                 |
+--------------------------------------------------------------------------+

+- SMALL PEBBLES LANE -----------------------------------------------------+
|  Source object : GEO-pebble.002                                          |
|  Group Input.003                                                         |
|    +- Geometry ------------------------> Distribute Points on Faces.002  |
|    +- Small Pebbles Mask -----------> Math.006 (x) --> Math.007 (x)      |
|    +- Factor ------------------------> Math.006 (x)                      |
|         Math.007 output --------------> Distribute Points on Faces.002   |
|                                          (Density socket)                |
|  Distribute Points on Faces.002 -----> Instance on Points.002            |
|  Object Info.002 (GEO-pebble.002) --> Instance on Points.002             |
|  Random Rotation [-pi, +pi]      ----> Instance on Points.002            |
|  Random Value.003 [0.10 - 0.35] -----> Instance on Points.002            |
|  Instance on Points.002 -------------> Join Geometry.003                 |
+--------------------------------------------------------------------------+

+- MERGE & OUTPUT ---------------------------------------------------------+
|  Group Input.004                                                         |
|    +- Geometry (pass-through) --------> Join Geometry.003                |
|  Join Geometry.003                                                       |
|    (inputs: large instances + medium instances +                         |
|             small instances  + original ground geo)                      |
|    +- Geometry -----------------------> Group Output                     |
+--------------------------------------------------------------------------+

SCALE RANGES (uniform, per lane)
---------------------------------
  Large  pebbles : 0.25 - 0.60
  Medium pebbles : 0.25 - 0.45
  Small  pebbles : 0.10 - 0.35

ROTATION (all lanes)
---------------------
  All three axes randomised independently over [-pi, +pi],
  giving each pebble instance a fully random orientation.

DENSITY CONTROL PATTERN (Medium & Small lanes)
-----------------------------------------------
  The mask value and the Factor are first multiplied together
  (Math.004 / Math.006), then that product is multiplied again
  by a second value (Math.005 / Math.007) before being fed into
  the Density socket.  This two-stage multiply gives a non-linear
  response curve, making the density fall off more aggressively
  near the mask edges.

  The Large lane uses a different (single-stage) approach:
  the Density Factor socket receives the mask directly, and the
  Factor is only used to scale Density Max via Math.003.

NOTES & SUGGESTIONS
--------------------
  * The node group has no Seed input exposed; adding one would allow
    re-randomising all three layers simultaneously without touching
    individual nodes.
  * The Factor input currently appears three times (once per lane).
    Merging them into a single shared socket would simplify the
    modifier panel.
  * Consider labelling the unlabelled Math nodes (Math.003-.007)
    and Random Value nodes to aid future maintenance.