Problem exporting a scenario in .babylon from Blender

I create a simple scenario in Blender (here) in order to try the workflow in Babylon.JS, and I’m having problems to export a correct “.Babylon” file using the add-on. However, If I export the exact same scenario to .glb, the sandbox can load the scenario without problem.
What is the am I doing wrong or missing in the parameterization in order to export directly from Blender?

  1. I create this Scenario with 3 objects and each one of them with its own material.
  2. I exported using the plugin and I go this result in the Sandbox:
  3. I export in .glb and load it in the sandbox and I have the expected result:
  4. I use the sandbox to export to .Babylon and then I have a ‘.Babylon file’ working.

Pinging @Drigax

This is because by default the gltf loader will add a light (and an env map) if there is no light in your gltf.
For .babylon, the sandbox will lot it as is. So I just recommend to add a light in your blender scene

3 Likes

by default the gltf loader will add a light (and an env map)

We only add an env map now to avoid collisions with the KHR_lights_punctual extension.

I already had the light:

@aburbanol I see from your file that you have three objects - wall, roof and ground. The image above shows no roof and no ground.

So I checked the normals - they are facing the wrong way in Blender - so flip them. You also have a number of zero area faces . Anyway, here is the result I get with the Sandbox (image below) I get when I flip the normals

Hope that helps.

cheers, gryff :slight_smile:

world01

1 Like

@gryff Thanks for sharing your experience and pointing out what I have to check with the terms :smiley: (and now to find tutorials xD). As I said I’m new in blender and BJS, so I appreciate your explanation!!!

@aburbanol : No problem glad to be of help :slight_smile:

For the vertices with no faces do the following:

Mesh-> Edit Mode->Select all vertices-> then in the Vertex drop down menu-> Merge Vertices->By Distance.

It will improve your vertex count in the Sandbox quite dramatically

As for tutorials try these : Grant Abbitt

cheers, gryff :slight_smile:

3 Likes