In my react project I’d like to import a gltf file which uses “KHR_draco_mesh_compression” and “KHR_texture_transform” extensions.
By default babylon cannot import the file while also did not complain (just doesn’t show the imported file). I wonder what is the correct way to import the file that uses extensions?
Right now I’m using AssetsManager.addMeshTask to import gltf.
// the assets manager does not work
var meshTask = assetsManager.addMeshTask('parseGLTF', '', '', 'data:' + data);
meshTask.run(scene, onSuccess, onError);
// the sceneloader does not work either
SceneLoader.ImportMesh(null, '', 'data:' + data, scene, onSuccess, null, onError);
the error message:
Uncaught (in promise) Error: /textures/0: Error while trying to load image: data:data:{"asset":{"generator":... - Fallback texture was used
at :3000/static/js/0.chunk.js:437794
at onInternalError (:3000/static/js/0.chunk.js:124203)
at Image.errorHandler (:3000/static/js/0.chunk.js:243607)
Sorry for the slow response. I’m a bit swamped right now. There definitely seems like there is a bug here. The code is not using the buffer we are passing to the engine to load the texture and it’s because the url (which should be a name for buffer) has a string that looks like base64 encoded data. @ccc159 Can you file an issue on GitHub?
PR is merged and the nightly build has the fixes. It should be propagated in the next few hours. For the npm package, we do this weekly early in the week typically.