Blender MCP
官方一個輕量級的 MCP(模型上下文協定)伺服器,專為 Blender 設計。它提供與 Blender Python API 的自然語言介面,改善對文件資料的存取,並讓使用者能夠探索與理解複雜的設定。
你可以用 Blender MCP 做什麼?
- 分析場景效能 — 要求助手從攝影機視角找出相對於螢幕尺寸具有最高多邊形數量的物件。
- 重新命名資料區塊 — 修正拼寫錯誤或對物件、燈光、攝影機、紋理及其他資料區塊套用描述性命名慣例。
- 查詢資料關係 — 使用自然語言詢問哪些物件使用了特定材質,或資料區塊之間如何連接。
- 除錯場景問題 — 識別具有最高多邊形數量的物件、非流形網格,或開啟檔案中的其他常見問題。
- 記錄幾何節點設定 — 生成內嵌文件框架和一個文字資料區塊,說明節點群組的功能及其結構。
文件
一個輕量級的 Blender MCP(模型上下文協定)伺服器。它提供了一個自然語言介面來操作 Blender 的 Python API,改善了對文件的存取,並讓使用者能夠探索和理解複雜的設定。
關於架構的技術細節和文件,請查閱原始碼。
安全警告
MCP 伺服器會在 Blender 中執行 LLM 生成的程式碼,沒有任何防護措施來保護您的資料免於被刪除或傳送到遠端位置。為了確保資料安全,建議使用虛擬機器,或是一個無法存取敏感資訊的系統。
安裝
Blender 本身沒有任何內建功能可以連接到 LLM。
為了讓 Blender 能夠與 LLM 連接,必須手動下載、安裝並執行三個外部工具。
需求:
- Blender 5.1 或更新版本
- 附加元件
- LLM 客戶端
- MCP 伺服器
附加元件
為了與您的 Blender 工作階段互動,您需要安裝一個特定的附加元件來整合 MCP 伺服器。
拖放至 Blender 中
…或下載並從磁碟安裝
如果您拖放至 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.
繪製出的結果資料清楚地顯示了兩個與其他物件顯著不同的物件:alphabet 和 coat 1:
針對 classroom 示範場景,每螢幕面積多邊形數量的圖表分析。
alphabet 物件有 2 萬個多邊形。由於其平坦的配置,可以用紋理替換它,對最終結果影響很小。coat 1 物件因其表面細分修改器而有 3.7 萬個多邊形。如果系統的瓶頸在於記憶體,降低細分級別可以減輕場景負擔。
字母表位於場景後方,可以輕鬆地用紋理替換。外套也足夠遠,可以簡化其網格。
這些結果有多可靠?
LLM 回傳的初步分析僅考慮了影響視埠的修改器。coat 1 物件有一個實體化修改器,使其多邊形數量加倍,使其成為更顯著的離群值。而且雖然此場景沒有啟用簡化,但這個設定也會影響最終的分析。
範例 2:各種提示
以下是一些其他已測試過的使用案例。您需要貼上完整的「提示」內容才能使其運作。作為起點,您應該使用對應的示範檔案。操作的成功與否將取決於所使用的模型。
| 使用案例 | 提示 | 示範檔案 | 結果 |
|---|---|---|---|
| 資料塊重新命名:修正錯字 | 使用目前開啟的 Blender 檔案,修正所有資料塊的名稱以移除錯字。回報哪些資料塊已被修正。 | Scattering Pebbles | GRP-rocks → GRP-pebble, LGT-Lights → LGT-lights, Compositing Nodetree → Compositing Node Tree |
| 資料塊重新命名:更好的名稱 | 使用目前開啟的 Blender 檔案,為所有資料塊建議描述性名稱,並在獲得批准後套用。 | Scattering Pebbles | Camera → CAM-main, Area → LGT-sun-key, Area.001 → LGT-sun-fill, Area.002 → LGT-area-rim, GEO-pebble.001 → GEO-pebble-B, … |
| 使用自然語言查詢資料關係 | 哪些物件正在使用以下材質:pebbles | Scattering Pebbles | 7 個物件:GEO-pebble, GEO-pebble.001, GEO-pebble.002, GEO-pebble.003, GEO-pebble.004, GEO-pebble.005, GEO-pebble.006 |
| 場景除錯 | 這個檔案中多邊形數量最高的物件是什麼?忽略未連結到任何場景的物件。 | Scattering Pebbles | GEO-ground,具有 4,096 個面。 |
| 幾何節點文件 | 使用目前開啟的 Blender 檔案,解釋主要的幾何節點設定在做什麼。使用框架元素為其新增內嵌文件。建立一個文字資料塊來存放分析結果。 | Scattering Pebbles | 4 個主要的顏色編碼框架 + 包含解釋的文字檔案。 |
其他尚待探索的提示:
- 將所有資料塊從法文翻譯成英文。
- 我的網格沒有被骨架變形,該如何修正?
- Blender 在渲染此場景時記憶體不足,我該如何最佳化?
- 這個網格有奇怪的著色瑕疵,該如何修正?
- 找出具有不良法線網格的物件。
- 檢查我的場景中是否有非均勻變換的網格物件。
- 我匯出的影片無法在網頁瀏覽器中播放,我應該更改哪些設定?
- 我應該使用哪些雕刻筆刷來創建和細化樹枝?
- 設定合成節點,將我的圖片同時儲存為 SDR 和 HDR。
- 驗證此清單:網格必須是流形,所有物件必須有材質,命名必須遵循慣例,沒有絕對路徑,… 資料塊重新命名:修正錯字
GRP-rocks → GRP-pebbles(場景僅包含鵝卵石物件,而非岩石)。
LGT-Lights → LGT-lights(大小寫不一致)。
Compositing Nodetree → Compositing Node Tree(Nodetree 是複合詞錯誤)。
資料塊重新命名:更好的名稱
物件:
Camera→CAM-mainArea→LGT-sun-keyArea.001→LGT-sun-fillArea.002→LGT-area-rimGEO-pebble.001→GEO-pebble-BGEO-pebble.002→GEO-pebble-CGEO-pebble.003→GEO-pebble-DGEO-pebble.004→GEO-pebble-EGEO-pebble.005→GEO-pebble-FGEO-pebble.006→GEO-pebble-G
燈光資料塊:
Area→LGT-sun-keyArea.001→LGT-sun-fillArea.002→LGT-area-rim
攝影機資料塊:
Camera→CAM-main
紋理:
Texture→TEX-ground-cloudsTexture.001→TEX-ground-image
場景與世界:
World→WLD-environmentScene→SCN-main幾何節點文件
已建立的新框架:
新增至幾何節點設定的文件框架。
文字資料塊:
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.