You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try to load a corrupt GLB using GLTFLoaderPlugin, I modified glTF_Schependomlaan.html example with
//------------------------------------------------------------------------------------------------------------------// Import the modules we need for this example//------------------------------------------------------------------------------------------------------------------import{Viewer,GLTFLoaderPlugin}from"../../dist/xeokit-sdk.es.js";//------------------------------------------------------------------------------------------------------------------// Create a Viewer, arrange the camera//------------------------------------------------------------------------------------------------------------------constviewer=newViewer({canvasId: "myCanvas",transparent: true});viewer.camera.eye=[-2.56,8.38,8.27];viewer.camera.look=[13.44,3.31,-14.83];viewer.camera.up=[0.10,0.98,-0.14];viewer.scene.selectedMaterial.fillAlpha=0.1;//----------------------------------------------------------------------------------------------------------------------// Create a glTF loader plugin, load a glTF model, fit to view//----------------------------------------------------------------------------------------------------------------------constgltfLoader=newGLTFLoaderPlugin(viewer);constsceneModel=gltfLoader.load({id: "myModel",src: "../../assets/mymodel/c21.glb",edges: true});sceneModel.on("loaded",()=>{viewer.cameraFlight.flyTo(sceneModel);});viewer.cameraControl.on("picked",function(e){console.log(e.entity.id);})
An error is thrown
Expected behavior
I can catch the error either through try catch or using an event similar to "loaded"
model.on("loaded",()=>{});
The text was updated successfully, but these errors were encountered:
Describe the bug
Loadig a corrupt GLB file (attached here) should be caught by the library user instead of crashing with a runtime error
c21.zip
To Reproduce
Steps to reproduce the behavior:
Try to load a corrupt GLB using GLTFLoaderPlugin, I modified glTF_Schependomlaan.html example with
An error is thrown
Expected behavior
I can catch the error either through
try catch
or using an event similar to "loaded"The text was updated successfully, but these errors were encountered: