A Visual Studio Code extension that provides a built-in viewer for GLTF or GLB files. This extension allows you to preview and interact with 3D models directly within VS Code.
- Click on any
.gltf .glb
file in VS Code's explorer window - The file will be opened automatically in a new tab using the GLTF/GLB Viewer
- If that doesn't happen, you can right click manually on the file and choose 'open with:' GLTF/GLB Viewer
- From the "open with" menu, you can also configure the default viewer to be this one
- Interact with the 3D model using your mouse:
- Left click and drag to rotate
- Right click and drag to pan
- Scroll to zoom
- Inspect GLTF/GLB files directly in VS Code in a 3D viewer
- Automatic file association with
.gltf .glb
files - Interactive 3D model viewing
- DRACO compression support
- KTX2 support (GPU Texture Compression)
- Hierarchy, Animations, Textures, Materials, Geometries and Info panels
- Play and stop individual animations
- Visualize textures, their resolution, and their relationship and usage with the materials
- Download textures
- Get a quick general understanding of the number of geometries, vertices, materials, textures, animations, etc.
- Camera auto focus focus on any object when clicked
- Copy to properties to clipboard with a single click
- Extra tools to visualize information like normals, object origins, and more.
- Quick search through the hierarchy tree
- Open VS Code
- Go to the Extensions view (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "GLTF/GLB Viewer"
- Click Install
See CHANGELOG.md for details about each release.
- Visual Studio Code version 1.80.0 or higher
- Node.js
- Yarn package manager
-
Clone the repository:
git clone git@github.com:ohzinteractive/vscode-glb-viewer.git
-
Install dependencies:
yarn install
-
Start development mode: Inside vscode with the folder open, press F5 to start the extension. This will open a new window with the extension running. Under the hood, it will run the
yarn start
command. That builds and watches for changes in thesrc/
folder.
To build the extension:
yarn build
To package the extension into a VSIX file for distribution:
-
Install the VSCE (Visual Studio Code Extensions) tool globally:
npm install -g @vscode/vsce
-
Make sure your extension is built:
yarn build
-
Package the extension:
vsce package
This will create a .vsix
file in your project directory. You can then:
- Install it locally by running
code --install-extension ohzi-vscode-glb-viewer-1.0.0.vsix
- Upload it to the VS Code Marketplace for public distribution
- Share it directly with other users for manual installation
Note: If you plan to publish to the VS Code Marketplace, you'll need to:
- Create a publisher account on the Visual Studio Marketplace
- Get a Personal Access Token (PAT)
- Login using
vsce login <publisher-name>
- Publish using
vsce publish
src/
- Source code directorydist/
- Built filesextension.js
- Main extension entry pointvite.config.mjs
- Vite configuration for building the webview
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE.md file for details.