- Home
- Plugin
- Miglioramenti UI
- dsh-war3-model-viewer
dsh-war3-model-viewer
luengzoen/dsh-war3-model-viewer
Opens Warcraft III .mdx models in the right-sidebar document preview: MDX and BLP parsing in the page, WebGL 2 skinned animation, a sequence tree grouped by standard action, and textures read from a local game install without unpacking it.
Installazione
dsh plugin --profile web add github:luengzoen/dsh-war3-model-viewerREADME
dsh-war3-model-viewer
Warcraft III .mdx, .blp and .tga viewers for the DSH right sidebar.
Table of contents
- What it does
- Features
- Actions
- Textures
- Texture viewer
- Controls
- Requirements
- Install
- Build and test
- Project layout
- Limitations
- Version
- License
What it does
Open an .mdx file in the workspace and the right sidebar draws the model —
animation included — without extracting the game to disk and without uploading
anything. Parsing, texture decoding and rendering all happen in the page.
Open a .blp or .tga and the same panel becomes an image viewer built for
textures: zoom anchored on the pointer, a switchable checkerboard for alpha, the
BLP's mip levels, and the file's own format facts in the status line.
Features
|
Format support
|
Rendering
|
Actions
Warcraft III names sequences freely, so the left column groups them by the
standard action they belong to — Stand with its numbered and Alternate
variants, Walk with Walk Fast, Attack with Attack Slam, and so on.
Anything unrecognised still gets a row under Other and stays playable.
A group header only folds and expands; its leaves are the sequences you click.
The dice button in the footer picks a variant weighted by the sequence's
Rarity, the way the game does.
Textures
A model names its textures by game-root-relative path. They are looked up beside the model first, then in the local Warcraft III archives if the game is installed; a texture found nowhere falls back to a neutral fill, and the status line counts the misses. The game itself is never unpacked.
The installation is found automatically; set WAR3_DIR to name the directory
explicitly.
Texture viewer
A .blp or .tga opens in the same right-sidebar seat:
- Zoom anchors on the pointer. The pixel under the cursor stays under the cursor.
- Three checkerboard states (light, dark, flat). A transparent texture on a flat fill is indistinguishable from a black one.
- Every BLP mip level is selectable. Levels that only re-reference one JPEG stream are not listed.
- The status line reports the file's format facts: dimensions, format, pixel format, alpha depth, mip count, TGA bit depth and origin.
- Click any pixel to copy its RGBA.
Textures are decoded by this plugin, including Blizzard's four-plane JPEGs. A browser reads four-component JPEG as CMYK and inverts it, so those files need a decoder that keeps the planes apart.
Controls
| Input | Action |
|---|---|
| Drag | Orbit the camera (model), or pan the image (texture) |
| Wheel | Zoom, anchored on the pointer |
| Right-drag, or Shift+drag | Pan the camera |
| Double-click | Toggle fit and 1:1 (texture) |
| Ctrl + + / − | Zoom in and out (texture) |
| Ctrl + 0 / 1 | Fit, and actual size (texture) |
| Toolbar | Play/pause, reset view, grid, wireframe, speed, team colour (model) |
| Toolbar | Zoom out, percentage, zoom in, fit, 1:1, checkerboard, mip level (texture) |
| Footer | Action name, duration, loop toggle, progress, random variant |
The loop toggle defaults to on, so a one-shot action does not freeze on its last frame; switching it off restores the authored behaviour.
A fitted texture is magnified at most 4x, so a 16x16 mipmap is findable without being turned into a 900px blur. Clicking the percentage returns to 1:1.
Requirements
| DSH | >=0.2.2-rc.3 |
| Browser | Any engine with WebGL 2 (Chrome/Edge 120+, Firefox 121+, Safari 17+) |
| Build | Node 20 or newer |
| Game | Optional — only for textures that live inside the game archives |
Install
From DSH: Plugins → Discover, or Plugins → Add plugin, and pick
dsh-war3-model-viewer.
From a shell:
dsh plugin --profile <profile> add dsh-war3-model-viewer
For development, install this directory as a link and rebuild in place — the
page picks up a new dist/client.js after a refresh, with no reinstall:
dsh plugin --profile <profile> add link:<absolute path of this directory>
Build and test
# Bundle src/ into dist/client.js
node build.mjs
# Every suite
node tests/run.mjs
The result is a single dist/client.js that registers one module factory; DSH
loads it directly, which is why the built file is part of the repository.
Project layout
src/
├── mdx/ container, tracks, sequences
├── blp/ BLP0/1/2 and embedded JPEG
├── tga/ TGA header, payloads and origin handling
├── view/ image decoding dispatch and the zoom model
├── mpq/ archive reader and installation discovery
├── render/ WebGL 2 renderer, skeleton, maths, textures
├── ui/ sidebar components, action tree, gizmo, styles, dictionaries
└── client.js client entry: preview registrations and bodies
| File | Purpose |
|---|---|
index.js | Host entry that enables the bundle row |
build.mjs | esbuild bundling and module registration wrapper |
cordis.patch.yml | Plugin registration patch |
dist/client.js | Build output loaded directly by DSH |
docs/DETAIL.md | Long description shown by plugin stores |
tests/ | Test suites and model fixtures |
Limitations
- No particles, ribbons, lights, cameras, events or collision volumes. Spell effects built from them will look incomplete.
PTYPis drawn as triangle lists only. Strips and fans are rare in practice and unsupported.- Progressive (SOF2) JPEG payloads are decoded by the browser. The bundled decoder handles baseline streams.
- Model and texture bytes arrive in one piece, so very large files are bounded by the host's file-size limit (32 MiB by default).
- TGA types 32 and 33 are not read. They are Huffman and Delta-RLE compressions, and no Warcraft III asset uses them; the decoder reports the type.
- TGA pixel interleave is ignored. That is
descriptorbit 6, the two-way interleave.
Version
MAJOR.MINOR.PATCH, as declared in package.json.
License
MIT © Luengzoen
Plugin correlati
dsh-web (dsh-task-board)
zhu1090093659/dsh-web
dsh-web (dsh-web-all)
zhu1090093659/dsh-web
dsh-TUI
ccch1mneyyy/dsh-tui
dsh-web-ui (dsh-task-board)
zhu1090093659/dsh-web-ui