返回目录
模型与 MCP 插件

dsh-3d-viewer

ybniaobu/dsh-3d-viewer

A DeepSeek Harness (DSH) sidebar plugin for previewing 3D models, supporting FBX, OBJ, glTF/GLB, DAE, and STL files · DSH 3D 模型查看器

Stars
1
Forks
0
Issues
0
更新
9 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:ybniaobu/dsh-3d-viewer

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

3D Viewer icon

3D Viewer

English | 中文

GitHub npm

Preview 3D models and textures from the session workspace in DSH's right sidebar. Supported formats include FBX, OBJ, glTF, GLB, DAE, and STL models, plus PNG, JPEG, TGA, EXR, and HDR textures. Orbit, zoom, switch camera views, materials and environments, and play embedded animations.

3D Viewer preview

Installation

The plugin is distributed as the npm package dsh-3d-viewer. The Three.js runtime and format decoders load only when a preview is opened.

Install from npm (recommended)

  1. Open DSH Desktop and choose Plugins in the sidebar.
  2. Click Add plugin → Install a third-party plugin.
  3. Enter dsh-3d-viewer (or dsh-3d-viewer@0.3.0 to pin a version).
  4. Set Registry to the official npm registry (npmmirror also works in mainland China).
  5. Click Install, then confirm 3D Viewer is On under Installed plugins.

Install from a local directory (optional)

  1. Unpack the plugin directory anywhere.
  2. Open DSH Desktop and choose Plugins in the sidebar.
  3. Click Add plugin → Install a third-party plugin.
  4. Enter the directory's absolute path (for example F:\plugins\dsh-3d-viewer) and click Install.
  5. Confirm 3D Viewer is On under Installed plugins.

Plugins run inside the DSH process; install only trusted sources.

Requirements

  • DSH Desktop 0.2.2-rc.3 or newer.
  • WebGL 2.
  • The model or texture must be in the session workspace.

Usage

Open the right sidebar, choose Files (Mod+P), and click a supported file.

Model previews: drag to orbit, scroll to zoom, and right-drag to pan. The toolbar resets the view, starts auto-rotation, and toggles the grid and wireframe. Click or drag the orientation axes to change the camera view. Material and environment pickers are in the top-right controls. When the model has animation clips, the animation bar appears above the bottom hint: use play/pause, pick a clip by name, drag the progress slider to seek, and choose a playback speed from 0.5× to 2×. Switching clips resets to that clip's first frame while preserving the current play/pause state.

Texture previews: scroll to zoom, drag to pan when zoomed, and use Fit or double-click to reset. Flip Y handles bottom-up sources. The badge shows dimensions, bit depth, and zoom.

Large files and the first environment switch may take a few seconds. If no preview appears, refresh the page and then restart DSH.

Supported formats

Model previews

Format Support
FBX Meshes, hierarchy, materials, embedded textures, animations, node data
OBJ Polygons, groups, normals, UVs, vertex colors, lines/points, MTL, common textures
glTF / GLB Animations, skinning, embedded resources, external .bin files and textures
DAE COLLADA meshes, materials, external textures, and animations
STL ASCII and binary, neutral PBR material, binary vertex colors

Notes:

  • Embedded lights, cameras, and audio are ignored.
  • External textures are read from the workspace.
  • Missing FBX textures only warn.
  • OBJ missing MTL uses default materials; missing textures use white placeholders.
  • glTF/GLB external .bin files and textures must exist in the workspace; missing resources can prevent loading.
  • glTF Draco, Meshopt, and KTX2 extensions are not supported.
  • DDS, KTX2, PVR, and other formats without a bundled decoder are not supported.
  • MTL map_Ks / map_Ns are not fully mapped to PBR.
  • STL has no materials or animations.

Texture previews

Format Decoded data Preview
PNG 8-bit RGBA Direct pixels, alpha preserved
JPG / JPEG 8-bit RGBA Direct pixels, alpha preserved
TGA 8-bit RGBA Direct pixels, alpha preserved
EXR 16-bit half or 32-bit float, 1–4 channels Tone-mapped to SDR
HDR Radiance RGBE, 16-bit half by default Tone-mapped to SDR
  • EXR and HDR use exposure 1 and Reinhard tone mapping before sRGB output.
  • HDR previews use a WebGL2 tone-mapping pass when available, with a half-float CPU fallback.
  • Previews are cached by resource address, version, and format (160 MiB; 64 MiB on low-memory devices).

Code structure

Area Main files
Host and package index.js, cordis.patch.yml, package.json
Core src/core/: byte helpers, formats, model statistics
Client registration src/client.js, src/core/formats.js, src/core/texture-formats.js
Lazy runtime src/runtime.js, src/ui/viewer-runtime.js, src/loaders/address.js
Lazy UI chunks client.ui.styles.js, client.ui.texture.js, client.locales.*.js
UI src/ui/: chrome, controls, preferences; ui/model/ and ui/texture/ for the two viewers
Scene src/scene/: renderer, camera, materials, environment, grid, post-processing
Loaders src/loaders/: dispatch, workspace reads, texture workers, formats/ loaders
Vendored code src/vendor/: modified FBX loader
Build and tests build.mjs, tests/run.mjs, tests/**/*.mjs

src/client.js only registers previews; src/runtime.js owns Three.js, scene setup, and lazy format dispatch. The UI shell does not import Three.js directly; scene code and the texture WebGL preview load with the lazy runtime. Styles, non-baseline locale dictionaries, and the texture viewer are also package-local UI chunks; English and Chinese dictionaries stay in the entry bundle as the DSH fallbacks.

Development

npm ci
npm test
npm run build

CI uses Node.js 24. npm test runs each tests/**/*.mjs file in its own process.

npm run build writes the UI entry, lazy runtime, format/texture chunks, UI style/locale/texture chunks, and the EXR/HDR worker to dist/. Commit the rebuilt dist/ files when source changes.

License

MIT; see LICENSE. Third-party notices are in THIRD_PARTY_NOTICES.md, including Three.js (MIT) and Poly Haven HDRIs (CC0). React is provided by DSH.

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类模型与 MCP
规则置信度高

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness、deepseek-harness-plugin。