
Security News
Risky Biz Podcast: AI Agents Are Raising the Stakes for Software Supply Chain Security
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.
@gltf-transform/view
Advanced tools
⚠️ EXPERIMENTAL
Creates three.js objects from a glTF Transform Document, then keeps the three.js scene graph updated — in realtime ⚡️ — as changes are made to the Document. Combined with import/export using WebIO, @gltf-transform/view provides a lossless workflow to load, view, edit, and export glTF assets. It's meant for editor-like applications on the web. Unlike using THREE.GLTFExporter, any glTF features that three.js doesn't support won't be lost, they just aren't rendered in the preview.
Installation:
npm install --save @gltf-transform/view
import { Scene, WebGLRenderer, PerspectiveCamera } from 'three';
import { WebIO } from '@gltf-transform/core';
import { KHRONOS_EXTENSIONS } from '@gltf-transform/extensions';
import { DocumentView } from '@gltf-transform/view';
// Set up three.js scene.
const scene = new Scene();
// ...
// Load glTF Document.
const io = new WebIO().registerExtensions(KHRONOS_EXTENSIONS);
const document = await io.read('path/to/input.glb');
const documentView = new DocumentView(document);
// Add glTF content to the scene (just once).
const sceneDef = document.getRoot().getDefaultScene(); // glTF Transform Scene
const group = documentView.view(sceneDef); // THREE.Group
scene.add(group);
// Render.
function animate () {
requestAnimationFrame(animate);
renderer.render(scene, camera);
}
// When glTF Document is edited, scene updates automatically.
const materialDef = document.getRoot().listMaterials()
.find((mat) => mat.getName() === 'MyMaterial');
buttonEl.addEventListener('click', () => {
materialDef.setBaseColorHex(0xFF0000);
});
Each DocumentView instance maintains reference counts and disposes of three.js WebGL resources (textures, geometry, materials) when the underlying glTF Transform properties are disposed. Unused resources are not disposed immediately, in case they might be used again later. To manually dispose of unused resources — e.g. to free up GPU memory — call documentView.gc(). Resources will be re-allocated automatically if they are used again.
| binding | status |
|---|---|
| Scene | ✅ |
| Node | ✅ |
| Mesh | ✅ |
| Primitive | ✅ |
| Accessor | ✅ |
| Material | ✅ |
| Texture | ✅ |
| Light | ✅ |
| Skin | ✅ |
| TextureInfo | 🚧 |
| Morph Targets | ❌ |
| Animation | ❌ |
| Camera | ❌ |
For supported extensions, see glTF-Transform-View#7.
See CONTRIBUTING.md.
Published under Prosperity Public License 3.0, which allows you to use and share this software for noncommercial purposes for free and to try this software for commercial purposes for thirty days. Commercial licenses available upon request.
FAQs
Syncs a glTF-Transform Document with a three.js scene graph
The npm package @gltf-transform/view receives a total of 297 weekly downloads. As such, @gltf-transform/view popularity was classified as not popular.
We found that @gltf-transform/view demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.