Skip to content

tf2: add interactive 3D Source model viewer and custom pack inspector - #306

Merged
rndaom merged 2 commits into
mainfrom
rndaom/tf2-3d-model-viewer
Dec 6, 2026
Merged

rndaom merged 2 commits into
mainfrom
rndaom/tf2-3d-model-viewer

Conversation

@rndaom

@rndaom rndaom commented Dec 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a local, read-only Source 1 3D model viewer and custom pack asset inspector decoded directly from the player's own TF2 VPKs and profile packs (zero Valve assets vendored, Three.js lazy-loaded on demand):

  • Source 1 mesh & material decoder (execs-core): Bounded, read-only .mdl (v44–49) + .vvd (v4) + .dx90.vtx (v7, trilist & tristrip) + .vmt (including patch { include ... }) + .vtf decoder with automatic Y-up/Z-up axis detection, skin family switching, and hand/sleeve submesh tagging.
  • Viewmodels 3D mode (ViewmodelPreviewStage): Switch between in-game captures and an interactive 3D weapon preview across all 9 TF2 classes (RED/BLU skins, All/Hands/Off parts, First-person/Orbit camera) reacting live to Viewmodel FOV, Draw viewmodel, Min viewmodels, Left-handed, and Transparent viewmodels.
  • Mods Pack Inspector (ModInspectModal): Inspect action on every custom pack (folder or VPK, active or disabled) to orbit .mdl models (with Mod / Stock TF2 toggle whenever a model overrides a stock TF2 path, plus skin and wireframe toggles), inspect decoded .vtf textures on a checkerboard stage, and audition .wav/.mp3/.ogg sounds.
  • Notices & docs: Added Three.js (MIT) to THIRD_PARTY.md and regenerated CREDITS.txt and DEPENDENCIES.txt, plus updates to CHANGELOG.md, docs/ARCHITECTURE.md, and docs/guide/{viewmodels,mods}.md.

Checks

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace --locked
  • Verified load_stock_tf2_model directly against all 21 stock TF2 viewmodels plus soldier.mdl and cow001_reference.mdl from a local TF2 install (100% textures decoded, zero errors)
  • node scripts/third-party-notices.mjs --check, pnpm check, pnpm test, pnpm --filter @execs/desktop build
  • Visually checked both Viewmodels 3D mode and Mods Pack Inspector (3D & Textures tabs) in headless Chromium with WebGL enabled (zero console errors).

…iewer

# Conflicts:
#	apps/desktop/src-tauri/src/lib.rs
#	apps/desktop/src/index.css
#	apps/desktop/src/lib/bridge.ts
@rndaom
rndaom merged commit 899e970 into main Dec 6, 2026
12 checks passed
@rndaom
rndaom deleted the rndaom/tf2-3d-model-viewer branch December 6, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant