Uniform Posted July 25, 2016 Share Posted July 25, 2016 Hello, I'd like to know how to load a mesh produced with blender (textures and animations included) with a .babylon file. I am new to this and haven't found the information in the tuts. I have this but it is loading the 3d geometry only, no textures. var rt = []; BABYLON.SceneLoader.ImportMesh("", "", "raiten.babylon", scene, function (newMeshes){ rt = newMeshes[0]; rt.showBoundingBox = true; rt.scaling = new BABYLON.Vector3(0.4,0.5,0.4); rt.position = new BABYLON.Vector3(3,1.5,-4); }); Thanks, Quote Link to comment Share on other sites More sharing options...
Nabroski Posted July 25, 2016 Share Posted July 25, 2016 Hope this helpshttps://doc.babylonjs.com/tutorials/How_to_use_Bones_and_Skeletonshttp://www.html5gamedevs.com/search/?&q=animation blender babylonjshttp://www.html5gamedevs.com/topic/23291-sceneloaderappend-playground-and-camera/add [at]gryff he knows everything about it (maybe) Quote Link to comment Share on other sites More sharing options...
Uniform Posted July 28, 2016 Author Share Posted July 28, 2016 hmm I still don't get if the texture file is available inside the .babylon file and how to get it from. @gryff ? Quote Link to comment Share on other sites More sharing options...
Nabroski Posted July 28, 2016 Share Posted July 28, 2016 @gryff and also have any errors in the console like failed to load texture? mostly a cross origin problem. you are running your file locally from the browser, you can set a switch in or browser it depends, something like : -allow-cross-orgin/load file from disk etc. also Quote Link to comment Share on other sites More sharing options...
gryff Posted July 28, 2016 Share Posted July 28, 2016 @Uniform : try checking the "inline "box outlined (below in the image) when you are exporting your .babylon file. I have never tried it - as I'm always adjusting and tweaking my images. But it is supposed to "turn textures into encoded strings for inclusion in the source code" On 2016-07-25 at 7:17 PM, Nabroski said: add [at]gryff he knows everything about it (maybe) @Nabroski I would put the emphasis on the "maybe" cheers, gryff : Quote Link to comment Share on other sites More sharing options...
Uniform Posted July 29, 2016 Author Share Posted July 29, 2016 But how do you load textures from the .babylon file? How do you get it from with code? Do you need to load the texture separately or you can just use it if you export the mesh with .babylon format? Basically do we have any code fetching the texture from .babylon file containing the textured mesh? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 29, 2016 Share Posted July 29, 2016 Usually, when people report something like this, they forgot to add a UVmap. You do not need to in-line. That is for possibly reducing load time, and optional. You should not have to do anything other than to make sure the texture file is is located where you say it is. I do not use a .babylon very often & never ImportMesh. Where is ""? Shouldn't this be something like "./"? 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.