Kilombo Posted July 23, 2014 Share Posted July 23, 2014 Good evening everyone, I'm currently importing a lot of meshes to my project (blender), although everyting is looking fine in blender, in Babylon things get weird. I'm pretty sure i'm missing something (probably something really basic). I'll leave the printscreens has example.(sorry for the big images, didn't thought printscreen would cache the other monitor ).The first image is what is happening in the game, and the second image his the result that I want, and is what blender shows. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 24, 2014 Share Posted July 24, 2014 Just double checking, these are file based textures, not procedural / noise based, right? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 24, 2014 Share Posted July 24, 2014 One more thing, assuming they are file based, make sure the files are in the same directory as the html or they are no going to be found. Quote Link to comment Share on other sites More sharing options...
Kilombo Posted July 24, 2014 Author Share Posted July 24, 2014 Thanks for your answer Palmer. Yap this textures a file based, when you tell in the same directory that html file, you mean same directory has file.babylon right ? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 24, 2014 Share Posted July 24, 2014 Only as long as the .babylon & .html are in the same directory. Open your .babylon in Netbeans, crtl-F and type in the name of one of the files like: myimage.png Notice there is no path. Perhaps you can edit your .babylon, but that is not something you heard from me. Quote Link to comment Share on other sites More sharing options...
Kilombo Posted July 24, 2014 Author Share Posted July 24, 2014 Yap, I can edit the file, but it seems that isn't the problem, cause everything seems ok, and the babylon file is in the same place has the jpg file. Must be something with the object it self, I must be doing something wrong, only don't know what Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 24, 2014 Share Posted July 24, 2014 I was actually joking about the editing part. Just a quick copy of one of your .jpg to the directory of the .html. Run it & see what happens. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 24, 2014 Share Posted July 24, 2014 Also, it seems that you can specify a different dir for textures than '.' Format of Load is:SceneLoader.Load = function (rootUrl, sceneFilename, engine, onsuccess, progressCallBack, onerror) {Are you putting anythin for rootUrl? That is where the path should go. Quote Link to comment Share on other sites More sharing options...
Kilombo Posted July 24, 2014 Author Share Posted July 24, 2014 Yap mate, you are right. I putted the rootUrl parameter, the mesh works but no textures, when i remove it and leave it on root it works. Now that's a messy bug, it's for sure too many files to keep on the main root folder Now.. it's a problem with the blender exporter or with the babylon sceneLoader? I'll take a look at sceneLoader and try to work it out. Thanks JCPalmer you saved my day, that was really helpfull. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 24, 2014 Share Posted July 24, 2014 Actually, you saved mine. For my code generating exporter, Tower of Babel, I did not have option to specify the 'materialsRootDir'. I Am now in the process of adding optional var to do that. In my case it is a single use variable, since there is no .babylon, & the .js path is specified in the <script> tag. I think we may have a language problem, cause I do not think it is a bug, but your problem. What does 'putted' mean? If you did something like : BABYLON.SceneLoader.Load("./lib", "sample.babylon", engine, function (newScene) {If sample.babylon & myimage.jpg were in a sub-directory , lib, it should work. Quote Link to comment Share on other sites More sharing options...
Kilombo Posted July 24, 2014 Author Share Posted July 24, 2014 Actually I'm using this:But it should be the same principle. It loads meshes ok, but not the textures. The funny thing it that works out with some meshes and with other doesn't. I have another class that has a method just like this one to load planets, and in there everything is ok. The only problem is with the ships. Now the funny part.. I wiped out the path, put everything in the root (jpg's plus babylon files) and it worked. BABYLON.SceneLoader.ImportMesh(name, "./Assets/babylonreadyfiles/", imageFileName, scenes[0], function(newMeshes) { Quote Link to comment Share on other sites More sharing options...
Kilombo Posted July 25, 2014 Author Share Posted July 25, 2014 Ok, latest update... The problem is not with locations. It worked out at first because i only tested with one mesh, when I put the others the problems subsists, the more meshes I load, the messier the problem is. I don't know why but it seems that babylon is mixing the textures and materials from one meshes to anothers Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 25, 2014 Share Posted July 25, 2014 Make sure your io_export_babylon.py is the latest from GitHub, should have version 1.2 in the first few lines, I think. The name of the .blend file was was made part of the material ID, so that name collisions did not occur. I am primarily working on Tower of Babel, but I did make that change to the old exporter. Quote Link to comment Share on other sites More sharing options...
Kilombo Posted July 25, 2014 Author Share Posted July 25, 2014 You where right (again), My exporter was version 1.1, i installed v1.2 and it didn't solved out Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 25, 2014 Share Posted July 25, 2014 Just a double check, you did use the 1.2 exporter to generate new .babylon's & are now testing with them, right? Hopefully, not too obvious a question, but sometimes when working 'hard' on a problem, missing the obvious often joins the party. 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.