Jump to content

Can't load any .babylon file


aarroyoc
 Share

Recommended Posts

Hi,

I tried to load a mesh from Blender. I've used the exporter but when I loaded it, the onsuccess callback has a an array of zero meshes. 

I'm doing:

BABYLON.SceneLoader.ImportMesh("sectarian", "/data/", "untitled.babylon", scene, function (meshes, ps, skeletons) {
		console.dir(meshes);
});

And untitled.babylon is attached. I'm using Babylon 2.4 and meshes is an array of 0 elements. I've checked and the babylon file is correctly loaded from the server.

 

What should I do in order to load the mesh? Am I missing something? Thanks

untitled.babylon

Link to comment
Share on other sites

@Dad72 -

Brilliant! I wasn't aware we didn't need to define the object name. Of course this would only work if your scene contained a single mesh. Also, you will most likely want to use your mesh in a seperate function or operation again in your script, so I might advise to always define the name of your imported mesh - especially if it contains children in Blender which you wish to import and clone or instance.

DB

Link to comment
Share on other sites

i believe the "name" parameter is there incase you only want one mesh from a file containing several meshes, e.g. 

BABYLON.SceneLoader.ImportMesh("", "/assets/", "myFile.babylon", scene, function (newMeshes, particles, skeletons)

if your file have two meshes, leaving the name field empty, loads both meshes, respectively at newMeshes[0] and newMeshes[1],

Link to comment
Share on other sites

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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