vscode-3d

vscode-3d

Preview GLB and glTF models inside VS Code, try 2,800 library animations or a text-described motion on any rig and bake the result, generate and refine models from a prompt on the free three.ws lane, optimize for the web, diff a model against git, AI quality-check a render, and get diagnostics and...

npm install vscode-3d
View on GitHubStar the repo

three.ws 3D for VS Code

Preview, animate, refine, optimize, and review 3D models where you already are. This extension makes .glb and .gltf files first-class in VS Code: double-click one and it renders, animates, and reports on itself in an editor tab, next to the code that ships it. Try any of 2,800 library animations on its rig and bake the one you like into the file. Describe a change and get a new version. Optimize a copy for the web without uploading it. Diff it against the committed version before you open the pull request. And when you embed it, the editor checks the <agent-3d> tag the way it checks your TypeScript.

Nothing here is a preview stub. The viewer is three.js with the same lighting, decoders and retargeter the three.ws site uses, the report and the diff are the platform's own inspectors, and generation calls the live studio API.

#Features

#See it

#Move it

#Make it

#Ship it

#Install

Search for three.ws 3D in the Extensions view, or install it by ID:

code --install-extension threews.vscode-3d

It is listed on the Visual Studio Marketplace and, for VSCodium, Cursor, Windsurf and other Open VSX editors, on Open VSX.

To build it from source instead:

git clone https://github.com/nirholas/three.ws.git
cd three.ws/packages/vscode-3d
npm install
npm run package
code --install-extension vscode-3d-0.2.0.vsix

For development, open packages/vscode-3d in VS Code and press F5 to launch an Extension Development Host. Maintainers: releasing a new version is covered in PUBLISHING.md.

#Use it

Open any .glb or .gltf in the explorer. That is the whole setup: the viewer is the default editor for those files, and the three.ws 3D icon in the activity bar lists every model in the workspace alongside the public gallery.

A typical loop: 3D: Generate an Avatar from Text, describe a character, and the GLB lands in models/ and opens. Press Animate, type wave, and watch it wave. Press Bake clip to save astronaut-waving.glb. Press Refine, type add a glowing visor, and get astronaut-v2.glb. Press Optimize for astronaut-v2.web.glb, then Insert embed to put it on a page:

<script
  type="module"
  src="https://three.ws/agent-3d/1.5.2/agent-3d.js"
  integrity="sha384-…"
  crossorigin="anonymous"
></script>

<agent-3d
  body="https://three.ws/cdn/creations/…/mesh.glb"
  style="width: 400px; height: 500px; display: block;"
></agent-3d>

If that snippet later drifts (someone swaps the URL to latest, or the hash goes stale after a release), the editor underlines it and the quick fix repairs it.

#Commands

Command What it does
3D: Generate a Model from Text Free text to 3D. Saves the GLB and opens it.
3D: Generate an Avatar from Text Same, tuned for characters.
3D: Refine this Model by Describing a Change New version anchored to this one; lineage kept.
3D: Try a Library Animation on this Model Search 2,800 clips; retarget and play in the viewer.
3D: Animate this Model from a Text Prompt Text to motion on the GPU fleet, retargeted onto the rig.
3D: Rig a Model for Animation Adds a humanoid skeleton to a static model.
3D: Optimize a Copy for the Web Local dedup, weld, resample, meshopt (and quantize).
3D: Compare with the Committed Version Structural diff against HEAD, side-by-side viewers.
3D: Check Quality with a Vision Model Realism and completeness score, defects, fix hint.
3D: Insert <agent-3d> Embed Snippet Writes a pinned, SRI-checked embed at the cursor.
3D: Preview a Model URL Opens any hosted .glb in the viewer.
3D: Open in the three.ws Viewer Opens the model in the browser viewer.
3D: Copy the Model's three.ws URL Copies the hosted URL to the clipboard.
3D: Save a PNG Snapshot of the View Writes the current view beside the model.
3D: Save a Turntable GIF of the Model Writes a looping orbit beside the model.
3D: Toggle the Model Report Shows or hides the report panel.

#Settings

Setting Default Purpose
threews3d.origin https://three.ws Host of the studio API, the gallery, the motion library, and the quality check.
threews3d.downloadFolder models Workspace folder generated models are saved into.
threews3d.tier draft Detail level for text to 3D: draft, standard, or high. All free.
threews3d.environment studio Image-based lighting: studio, neutral, or none.
threews3d.showGrid true Show the ground grid when a model opens.
threews3d.autoRotate false Orbit the camera automatically when a model opens.
threews3d.embedChannel pinned pinned resolves the current release plus its SRI hash; or name a channel such as latest, 1, or 1.5.
threews3d.turntableFrames 36 Frames in a turntable GIF (one full orbit).
threews3d.turntableSize 480 Pixel size of each square turntable frame.
threews3d.embedDiagnostics true Check <agent-3d> and library <script> tags in supported files.

#How it works

Generation, refinement, rigging, the library, and the gallery go through public, unauthenticated three.ws endpoints:

Everything else is local. The viewer runs three.js inside a webview whose content security policy allows exactly one nonce-gated script and no remote origin, so the only things that cross the network while you look at a model are the model file and, when you pick one, a clip. Retargeting runs in the webview with the platform's animation-retarget.js; baking, optimization, inspection and the structural diff run in the extension host with glTF-Transform. The Draco and Basis decoders are copied out of three.js at build time and served from the extension, never from a CDN.

#Which model can be embedded, rigged, or refined

Those three need a URL the browser (or the studio) can fetch. Models this extension generated or imported carry their three.ws URL, so the commands just work. For a local file that has never been uploaded, the extension asks for the https URL where it is hosted rather than handing you a snippet that renders nothing. Animating, baking, optimizing, comparing, and the quality check all work on a purely local file.

#Develop

npm run watch   # rebuild the host bundle and the webview on change
npm test        # builds, then runs the suite

npm test activates the bundled extension against a stand-in extension host and asserts that every command, view, language provider, and custom editor the manifest promises really registers, that the viewer webview is nonce-gated and CDN-free, that an HTML file with a broken embed yields the right diagnostics and quick fixes, and that a canonical clip retargets onto the committed reference avatar and bakes into it. The studio, library, motion, refine, quality, embed, optimize, compare and naming modules are unit tested against local HTTP servers and real committed GLBs.

Apache-2.0. Built by three.ws.