前言¶
在 DeepSeek Harness(DSH)裏處理工程文件時,右側 Files 往往只能看到路徑和元數據。.blend 這類二進制資產要確認模型是否正常,通常要切到 Blender 或另開查看器;視頻、音頻大文件若整段讀入內存也不現實。若希望在同一工作區內完成「點開即看」,需要一條 host 負責轉換與緩存、client 負責渲染的插件鏈路,並且儘量不觸發額外安裝腳本或遙測。
下面介紹社區插件 dsh-blender-preview(維護者 adithyanraj03),它在 Files 側欄提供多種格式的就地預覽,.blend 通過本機 Blender 無頭導出爲緩存 GLB 後再用 WebGL 展示。
這是什麼¶
dsh-blender-preview 是 DSH 的客戶端類插件(npm 包名 dsh-blender-preview,當前資料標註版本 v0.3.0,MIT 許可證)。它拆成兩半:host 在後臺調用本機 Blender 做 .blend → GLB 轉換並落盤緩存;瀏覽器端在側欄用交互式視口或專用查看器渲染。
插件聲明依賴 dsh-blender@^0.2.4(社區插件,作者 CheshireJCat)。啓動時 host 會做只讀自檢:若某 profile 裏未安裝或未掛載 dsh-blender,僅在日誌中打出修復命令,不會自動改 profile。資料明確:無網絡調用、無遙測、無 postinstall;卸載會移除對應 host row。
- 目錄頁:https://www.skillhub.cn/plugins/adithyanraj03/dsh-blender-preview
- 源碼與說明:https://github.com/adithyanraj03/dsh-blender-preview
核心功能¶
3D 與 .blend 轉換¶
對 .blend、.glb、.gltf、.obj,側欄提供 3D 視口:拖拽環繞、右鍵平移、滾輪縮放;另有重置視角、旋轉、線框、網格、淺色背景等開關。場景信息會以 chip 形式展示三角面、網格、材質數量、動畫段數及是否 rig。
.blend 需本機已安裝 Blender。host 在後臺執行無頭導出(資料中的形式爲 blender -b --factory-startup … --python export_glb.py),將 GLB 緩存到 <DSH_HOME>/storages/blender-preview,鍵值爲路徑 + 大小 + mtime(上傳字節則按內容)。同一文件再次打開直接命中緩存;文件被編輯後會重新轉換。
.glb / .gltf / .obj 不依賴 Blender 即可預覽。
動畫、矢量與其他媒體¶
模型帶動畫時提供片段選擇、播放/暫停、 scrub 與速度控制。
.svg 以矢量方式渲染,支持像素級準確的縮放與平移。
視頻 / 音頻 通過 HTTP Range 流式讀取,大文件可 seek,無需整文件進內存。
與 dsh-blender 的配合¶
安裝本插件時,registry 或 GitHub 安裝會把 dsh-blender@^0.2.4 一併放入 profile。自檢缺失時會日誌提示:
npx @deepseek-ai/dsh plugin --profile web add dsh-blender
自檢只讀 profile,不自行安裝或修改配置。對使用 link: 的開發 profile,pnpm 可能不會自動裝上鍊接包的依賴,自檢用於暴露缺口而非默認已就緒。
可選行配置¶
以下鍵均掛在 blender-preview row 上,均可選:
| Key | 默認值 | 含義 |
|---|---|---|
blenderPath |
自動探測(BLENDER_PATH、常見安裝目錄、PATH) |
Blender 可執行文件路徑 |
timeoutMs |
180000 |
單次導出最長耗時 |
cacheDir |
<DSH_HOME>/storages/blender-preview |
轉換後 GLB 緩存目錄 |
安裝與啓用¶
運行環境:Node ≥ 22;兼容資料記載爲 dsh 0.2.x(web + desktop)。安裝或升級後需重啓應用,以便 host 半部加載。
Web profile(npm)¶
npx @deepseek-ai/dsh plugin --profile web add dsh-blender-preview
Web profile(GitHub)¶
npx @deepseek-ai/dsh plugin --profile web add github:adithyanraj03/dsh-blender-preview
包不執行 postinstall,pnpm 的 ignored-builds 提示不適用。
確認已掛載:插件應同時出現在 dependencies 與 dsh.profile.bundles 中:
cd ~/.dsh/profiles/web && node -e "const p=require('./package.json');
console.log(p.dependencies['dsh-blender-preview'],
p.dsh.profile.bundles.includes('dsh-blender-preview'))"
桌面端¶
打開 Plugins(設置左側)→ Add plugin,粘貼倉庫地址後 Install:
https://github.com/adithyanraj03/dsh-blender-preview
資料說明:已裝插件暫不會自動更新;升級需先卸載再安裝。
典型用法¶
安裝並重啓後,在 DSH 右側 Files 中打開對應文件即可觸發預覽邏輯,無需額外 CLI。
- 直接預覽 GLB/GLTF/OBJ:選中文件,側欄出現 WebGL 視口與場景統計。
- 預覽
.blend:確保本機 Blender 可被探測到(必要時在 row 上設置blenderPath)。首次打開會後臺導出並寫入cacheDir;再次打開同一未改動文件應 Instant 命中緩存。 - 大體積音視頻:在 Files 中打開後通過 range 流式播放,可拖動進度條 seek。
.blend 轉換在資料中針對 Blender 5.2 LTS 做過測試;其他格式不依賴 Blender。
適用場景與注意¶
適合誰:需要在 DSH 工作流裏快速覈對 3D 資產、矢量圖或媒體片段的智能體開發者與日常用 DSH 管工程的用戶;尤其是已有本機 Blender、希望 .blend 就地轉 GLB 再看的場景。
能力邊界:
.blend必須有本機 Blender;其餘列出的 3D/矢量/媒體格式按 README 可不裝 Blender。- 插件以當前 DSH 進程權限運行無頭 Blender 與讀寫緩存目錄;安裝前宜自行查看源碼與 MIT 許可證,確認可接受本機子進程與磁盤緩存行爲。
- 與 npm 上早期的
dsh-blend-preview/dsh-preview-blender無關;dsh-blender-preview爲獨立實現(README Prior art 一節有說明)。
DSH 生態強調「一切皆插件」;SkillHub 等社區目錄爲獨立站點,與 DeepSeek / 幻方無官方從屬關係。
結尾¶
dsh-blender-preview 把 Files 側欄擴展爲可交互預覽:本地 Blender 導出 + GLB 緩存 + WebGL/SVG/流式媒體,並通過對 dsh-blender 的只讀自檢降低 profile 缺依賴時的靜默失敗。