Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with webp extension #1245

Closed
Bhushan-Ctruh opened this issue Jan 24, 2024 · 2 comments
Closed

Issue with webp extension #1245

Bhushan-Ctruh opened this issue Jan 24, 2024 · 2 comments

Comments

@Bhushan-Ctruh
Copy link

I have pretty basic setup where we use gltf-transform on client side to convert glb to gltf, which works fine for most cases but breaks for webp textures. So I am using the webp extension as shown here but it still gives me error saying Missing required extension, "EXT_texture_webp". Not sure if I am doing somthing wrong or its a bug.

This is how I am using in my code base.

const doc = await io.read(blob);

doc.createExtension(EXTTextureWebP).setRequired(true)

const { json, resources } = await io.writeJSON(doc);
@Bhushan-Ctruh Bhushan-Ctruh added the bug Something isn't working label Jan 24, 2024
@donmccurdy
Copy link
Owner

donmccurdy commented Jan 24, 2024

Hi @Bhushan-Ctruh! When loading a document that contains extensions, you'll need to register the extension with the I/O class, before reading the file, as shown here:

https://gltf-transform.dev/extensions#installation

The document.createExtension function is useful only when adding an extension to a glTF file that previously didn't use it.

@donmccurdy donmccurdy added question package:extensions and removed bug Something isn't working labels Jan 24, 2024
@Bhushan-Ctruh
Copy link
Author

Oh that worked, Thanks man! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants