Babylon friendly materials from Blender


I’ve searched around trying to find the solution, but I’m not sure I know what to look for so I’m posting the question here. I’m trying to export a scene in Blender (version 2.82.7) using the Babylon exporter (version 6.4.3). I can export just about everything but the textures.

The odd thing is that the textures actually show up when I test this in the sandbox. So I don’t know if it’s a material linking issue or what. This is my first time trying to export with textures using the Babylon exporter so I may be missing something simple. Here is a simpler example using a cube with the nodes shown in Blender which also has the same issue:

Is there some special way I need to setup materials? I don’t have any of these issues when exporting a glb/gltf. I really want to use the Babylon exporter as it allows me to easily set things up in Blender.

1 Like

Welcome aboard!

Check the browser console: you probably have 404 errors meaning the files could not be found.

If you are testing locally you will need to setup a web server to serve your pages (How to setup a local webserver for BabylonJs - Babylon.js Documentation).

Sorry for the late reply, yes that’s more than likely what the issue was. There wasn’t a problem with the export, I just couldn’t load the textures properly due to Chrome. For anyone else who comes across this issue. This is the error I had in the console:

I then decided to try by uploading the Babylon file to an S3 bucket and using a playground environment. The models loaded fine but the same checkerboard pattern appeared. I had a similar error appear in the console. I realized when I export a Babylon file it also exports all the textures so I uploaded all those textures to the same bucket and that worked.

BTW, you can inline your textures using the exporter, which can be useful when running from file during dev. There is a checkbox on blender world properties tab.

1 Like

What exactly does that do? The tool tip says ’turns textures into encoded string for direct inclusion into source code’. Does that mean it packs the textures into the Babylon file? Thanks for the help!

Yes, and now no browser will either get a 404 or refuse to get your texture because you are using a file:// url

1 Like

Thank you, that’s even easier. I was hoping there was something similar to how the glb/gltf exporter worked in that regard.