Skip to content
Discussion options

You must be logged in to vote

Once you've got the JSON and resources from WebIO's export, you don't need glTF Transform to work with them anymore. Then it would depend on what you want to do with the files ... to download everything as a ZIP, you could do something like this:

import { BlobWriter, BlobReader, ZipWriter, TextReader } from '@zip.js/zip.js';


// Create ZIP archive.
const basename = 'my-model';
const { json, resources } = await io.writeJSON(document, {basename});

const blobWriter = new BlobWriter('application/zip');
const writer = new ZipWriter(blobWriter, { level: 0 });

await writer.add(`${basename}.gltf`, new TextReader(JSON.stringify(jsonDocument.json)));

for (const uri in jsonDocument.resources) {
	c…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by neciszhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants