Using instance() break the model #1115
-
|
When using instance() the model is broken. Using instance() on the model : To Reproduce Load with threejs GLTFLoder ( for example : https://gltf-viewer.donmccurdy.com/ ) Expected behavior Versions:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
I'm guessing you my not have installed any extensions in glTF Transform. Do your console logs show anything like the error below?
This means the To add support for all official Khronos glTF extensions, and a few others: import { NodeIO } from '@gltf-transform/core';
import { ALL_EXTENSIONS } from '@gltf-transform/extensions';
import { flatten, dedup, instance } from '@gltf-transform/functions';
const io = new NodeIO().registerExtensions(ALL_EXTENSIONS);
const document = await io.read('./suitcases.glb');
await document.transform(
flatten(),
dedup(),
instance({min: 2}),
);
await io.write('./suitcases-opt.glb', document);A few extensions, currently KHR_draco_mesh_compression and EXT_meshopt_compression, require some additional steps to use. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks it worked ! But maybe called instance() or other functions should automatically register the related extensions if they are missing ? I think it will be a nice behavior to reduce errors. Another related question : is there any side effects register ALL_EXTENSIONS ? |
Beta Was this translation helpful? Give feedback.
I'm guessing you my not have installed any extensions in glTF Transform. Do your console logs show anything like the error below?
This means the
instance()command added glTF extensions to the scene, but the I/O class doesn't recognize those extensions.To add support for all official Khronos glTF extensions, and a few others: