Numa Posted December 13, 2016 Share Posted December 13, 2016 Hi guys, I'm trying to load in .gltf files. I added a callback after the load but it seems to be getting called too early, meshes don't have a bounding box or geometry yet. is that expected? BABYLON.SceneLoader.Append("GLTF/", "model.gltf", scene, function (gltf) { var geometry = gltf.meshes[0].geometry; // undefined }); and by the way, all other callbacks retrieve the array of meshes directly, with the gltf importer you need to go one level down with .meshes. weird Thanks Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 13, 2016 Share Posted December 13, 2016 just wondering (before saying "ha! it's a bug") - is the geometry eventually being set? or does it stay undefined forever? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 13, 2016 Share Posted December 13, 2016 Ping @Luaacro Quote Link to comment Share on other sites More sharing options...
Numa Posted December 13, 2016 Author Share Posted December 13, 2016 Yes if I wait and execute the same function on mouse click later the geometry/bounding box info is there. Thanks for the quick response as usual guys! julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted December 14, 2016 Share Posted December 14, 2016 Thanks for this feedback using glTF ! glTF loader is today used to be incremental and that's an interesting subject of evolution: I would like to know if glTF users may want to keep it incremental, or called back once all the files are loaded (I mean the .gltf and .bin files). Then you can do what you want in your callback. What do you think ? @Numa Quote Link to comment Share on other sites More sharing options...
Numa Posted January 8, 2017 Author Share Posted January 8, 2017 Hi @Luaacro, sorry for the late reply! I think the callback should be called once everything is loaded What is the intended loading process? maybe I'm just using it wrong What I want to do is load my model, once everything is loaded I want to move meshes around, change their materials etc. Is there a way to check if everything has been loaded? Worst case I could add a little check in my render loop to check if all my meshes have a geometry then flip a bool, but that feels wrong hehe. Thanks guys! Quote Link to comment Share on other sites More sharing options...
Numa Posted January 31, 2017 Author Share Posted January 31, 2017 For anyone coming across this post, it looks like this has been fixed in the latest version of the gltf loader, you can now set BABYLON.GLTFFileLoader.IncrementalLoading = false; Dad72 and GameMonetize 2 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.