Open deep9888 opened 1 year ago
I tried this approach also, which you have used in web-example
const inp = document.getElementById("file-input") as HTMLInputElement;
inp.addEventListener('change', async (event) => {
const auditor = new Auditor();
const files = inp.files;
console.log(files);
await auditor.model.loadFromFileInput(Array.from(inp.files));
console.log('auditor.model.loaded',auditor.model.loaded);
// Do something with the selected files
});
but still giving me this error-
Will you guide me in this? Thanks for your time
It looks like you are running into an issue related to https://github.com/KhronosGroup/gltf-asset-auditor/issues/2, where models with Draco compression cannot be loaded. Can you try loading a gltf without compression? There are some in the test folder of the repo. Draco support may be dependent on a feature request for Babylon.js, although I am trying to come up with a solution.
To answer your other questions:
I want to know if there is any way I can pass buffer data to auditor.model.loadFromInput()
, like I am loading the glb model with three js. If I pass the buffer data for generating the audit report without calling this function auditor.model.loadFromInput()
. Because with this function, Babylon.js gives me the above errors.
Sorry, it's not currently possible to load the buffer data directly. Babylon.js is used to compute all of the model attributes that can be audited, most of which are not in the glTF file itself.
Currently there is an issue with loading draco compressed models that is most likely causing the errors you are seeing. Trying getting your code to work with non-draco models first. I'm hoping to get the draco issue resolved next week.
Ok, and one more thing, will you also add an audit report for FBX and OBJ files?
I tested my GLB model on your web example. It works fine, but if I run it locally, that gives me the above errors.
Today, I cloned your GitHub repo and ran that locally, still it not working. I loaded the same model on web-example https://www.khronos.org/gltf/gltf-asset-auditor/ that is working; I don't know where the bug is-
I run Locally
I run on deployed web example The same model I loaded in an online web example that is working-
What is the use of this line in the src folder -> Model.ts?
await SceneLoader.AppendAsync('', glb.getBase64String(), this.scene, () => {}, 'KHR_draco_mesh_compression');
Like babylon.js does not support KHR-Draco-Mesh GLB
Ah, I see what is happening, this line of code, also reported here: https://github.com/KhronosGroup/gltf-asset-auditor/issues/5, accidentally made it into the NPM repo, but not the git repo. It was only in there as an experiment trying to resolve the issue of loading Draco compressed models. I'll push out a version 1.0.2 to NPM that will fix that line.
Hey Mike, I am facing one issue, like using ThreeJs in my project to load the model. Is three js compatible with gltf-asset-auditor? and I used it directly by dragging and dropping GLB with Babylon.js-
With the above code, the GLB file is not loaded properly. It gives me an error-
And one thing I want to know is whether it is compulsory to load the model with
auditor.model.loadFromFileInput(Array.from(input.files));
, Do I use other functions without loading the model? Or I can use it.