Jump to content

Imported Mesh textures not right.


Kilombo
 Share

Recommended Posts

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

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.

post-8187-0-37342500-1406158797_thumb.jp

post-8187-0-79355300-1406158802_thumb.pn

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.  :huh:

BABYLON.SceneLoader.ImportMesh(name, "./Assets/babylonreadyfiles/", imageFileName, scenes[0], function(newMeshes) {
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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