Jump to content

No material on model when exporting Blender to .babylon


Recommended Posts

Hi there. I'm trying to import a simple character to play a little with babylonjs. But when i do it, i get on the log:


WARNING:  No materials have been assigned: 


On the left is how it's rendered by babylonjs, on the right, what should it be:




I modified nothing on the original Blender file. Just loaded and hit export to Babylonjs.


What might be wrong?




Link to comment
Share on other sites

Hi Gaz - welcome to the BJS forum :)


Can you post your blend file somewhere so I can look at it? You can PM me the link if you wish.


And did you create the model - or was it imported from somewhere else?


cheers, gryff :)

Link to comment
Share on other sites

Well Gaz, I have the model ...  and you have a couple of issues;


1. The model uses the Cycles Render Engine and all the materials are built through the node system. Currently the BJS Exporter  supports only the Blender Render Engine.


Jeff Palmer (JCPalmer who looks after the exporter) is working on this so watch for developments


2. The scene has 10 lamps illuminating the mesh. WebGL allows a maximum of 4. It is not the cause of the problem - but just remember that as you play with BJS.


I will spend more time with the file tomorrow.


Ooh and as for Deltakosh's remarks, remember the old piece of philosophy: "In the kingdom of the blind, the one-eyed man is king" (Erasmus 1436-1536) :o;)


cheers, gryff :)

Link to comment
Share on other sites

I was able to download this to test.  Good since I do not have a lot of Cycles samples.  Actually 3 meshes in this scene.  The Cycles capable release processed the file fine.  Took a while, but I ran it under Ubuntu, & I cannot turn on GPU accelerated Cycles rendering.  Am not going to take time to publish, but here was the log file:

	Exporter version: 3.0.0, Blender version: 2.74 (sub 0)========= Conversion from Blender to Babylon.js =========	Python World class constructor completed	processing begun of mesh:  Dientes		WARNING: No materials have been assigned: 		num positions      :  6656		num normals        :  6656		num uvs            :  0		num uvs2           :  0		num colors         :  0		num indices        :  36864	processing begun of mesh:  Cuerpo		processing begun of baked material:  Cuerpo			Cycles baking texture, type: DIFFUSE_COLOR, mapped using: BakingUV			Cycles baking texture, type: SPECULAR, mapped using: BakingUV		num positions      :  28385		num normals        :  28385		num uvs            :  56770		num uvs2           :  0		num colors         :  0		num indices        :  147456	processing begun of camera (FreeCamera):  Camera	processing begun of mesh:  Lengua		processing begun of baked material:  Lengua			Cycles baking texture, type: DIFFUSE_COLOR, mapped using: BakingUV			Cycles baking texture, type: SPECULAR, mapped using: BakingUV		num positions      :  5824		num normals        :  5824		num uvs            :  11648		num uvs2           :  0		num colors         :  0		num indices        :  29952	processing begun of light (POINT):  Lamp.009	processing begun of light (POINT):  Lamp.008	processing begun of light (POINT):  Lamp.007	processing begun of light (POINT):  Lamp.006	processing begun of light (POINT):  Lamp.005	processing begun of light (POINT):  Lamp.003	processing begun of light (POINT):  Lamp.002	processing begun of light (HEMI):  Lamp.001	processing begun of light (POINT):  Lamp========= Writing of javascript file started ================== Writing of javascript file completed ================== end of processing =========elapsed time:  1 min, 42.3217 secs

They are using a Glossy node, which is what I pencilled in to do a specular bake.  The diffuse of the body looked right:



But I am concerned about the specular.  I can generate any type of bake possible, but I have to define the needs, recipe.  I asked for input on which node types should cause which bake types in another topic, but no one responded.  Not sure this specular texture is right.  Anyway, I have more to test with:


Link to comment
Share on other sites

Thank you guys. I think ill have to manually set the textures when switching engines? It's been like 6 years since i messed up with Blender, heh.


I dont know what just JC posted, looks like dissected the poor ghosty :'(


Funny you do not have cycles samples, i just downloaded 4 or 5 models from blendswap.com and all were Cycles. :o

Link to comment
Share on other sites

From your log file Jeff:


Exporter version: 3.0.0,


Is this the latest version available from the BJS github site, or is it still a version you are working on?


As for the spec map above, I would have expected a greyscale image - see this tutorial (at 13.00 min.) :


Blender/Unity Specular and Normal Mapping


But maybe BJS handles spec mapping in a different way from Unity.


cheers, gryff :)






Link to comment
Share on other sites

GAZ, you have been out of the game too long.  Those are what 2D textures of 3D objects  look like.  Exporter generates a smart project UV map called: BakingUV.  Deleted once done along with any temporary images.


Gryff, yes this is not published yet.  If you wish to test either exporter, pm me.  Still testing & documenting, which the exporter badly needs.  I loaded up this thing & specular was definitely wrong.  I commented out the specular & got this:  https://googledrive.com/host/0B6-s6ZjHyEwUfkhYdW1yQ2hqTU90SUx6SzFjaVY3TnlQLVA2WmNSdDE5NWJubV9Cc1l2ekE/index.html  . Not sure why there are no eyes.


Looks like a "Glossy" node puts it data into a diffuse bake.  Have ripped out checking for anything to do a specular bake.  I'll just wait till someone complains it is missing, and then I'll know what should trigger it.

Link to comment
Share on other sites

Yes.  Presumably if there are image textures that are assigned a UV map, they will used to render, but then be baked using the temp one.  


When baking, the temp UV is the only one that will be written to the .babylon / .JS file no matter how many UV maps there are.  Though I have fixed when there are multiple UVs.  The first one always was set to be used.


I had thought of using one if I found it, but what if there was more than 1?  Also, if I just did an unwrap, instead of a smart project, the Gingerbread man was terrible, and minutes instead of seconds to do it.  Smart project always seems to do something good.  Might be hedging a little for the newbie, but for so major an addition, seems like the thing to do for an initial release.

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.

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