HoloLite Posted January 29, 2018 Share Posted January 29, 2018 Here is the sample code I use: BABYLON.SceneLoader.ImportMesh("sample", "assets/gltf/sample/", "scene.gltf", this.scene, (newMeshes: BABYLON.AbstractMesh[]) => { // file loaded - do something here }, () => { // Progress callback console.log('progress...'); }, (scene: BABYLON.Scene) => { // Error callback console.log('error'); alert('error'); } ); I am getting only the progress callback. No error callback but no completion either. The same code with .babylon file works just fine. I wonder if I am missing anything here. The doc mentioned that the ImportMesh call also works on gltf file. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 29, 2018 Share Posted January 29, 2018 It should work. Can you share the gltf file + resources? Quote Link to comment Share on other sites More sharing options...
HoloLite Posted January 29, 2018 Author Share Posted January 29, 2018 @DeltakoshI used the free downloaded samples from sketchfab. All the files have the same rendering problem with ImportMesh. Try this: https://sketchfab.com/models/e18c433cdd1c49f8ac152348b7384037#download Note that the SceneLoader.Append works on the sample gltf files. Only ImportMesh is having issues. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 29, 2018 Share Posted January 29, 2018 Ok this is because you used "samples" as first parameter. So only this mesh is imported. You should leave the first parameter to "" (empty string) Quote Link to comment Share on other sites More sharing options...
HoloLite Posted January 29, 2018 Author Share Posted January 29, 2018 @Deltakosh Yes it worked. My bad for not paying attention to the first param semantics. In this case though, shouldn't it return by calling the error callback ? thanks! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 29, 2018 Share Posted January 29, 2018 This is not an error per se The mesh is not there but this could be ok (ishhhh) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.