Jump to content

GLTF: SceneLoader.Append callback called too early?


Recommended Posts

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 :)



Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 weeks later...

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!


Link to comment
Share on other sites

  • 4 weeks later...

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...