Blender 6.0 exporter for Blender 2.80

blender

#1

The fully functional, reasonably tested, exporter for the new major release of Blender has been published. Right now, the exporter shows being Beta 6.

Located: Exporters/Blender at master · BabylonJS/Exporters · GitHub

When blender 2.80 goes into production, a minor update will occur to change the version to production & move Blender2Babylon-5.6.zip to the deprecated directory. The Blender 2.80 version is increasingly more production worthy by the day. Think you would be advised to start looking at it, since the learning curve for all the changes will take some time.

In addition to the changes below, some other topics got written which also highlight how things are now different:


Blender Exporter Version 6.0.0

24 January 2019

  • Supports Blender 2.80 redesign
  • Removed Internal render materials support
  • Relocated Game Engine render properties used
  • Moved all exporter level custom properties from scene tab to world tab
  • Changes to world tab:
    • Added properties from scene tab
    • Added Sky Box / Environment Textures section
    • Added Use PBR checkbox
  • Changes to mesh tab / proccesing:
    • Relocated Billboard Mode from Game Engine to here
    • Relocated most of material section to new panel in Materials tab
    • Remaining materials stuff now in ‘Baking Settings’ section. Added Force Baking checkbox to avoid multi-materials.
    • Blender’s mixed flat / smooth shading now supported, or custom split normals if used.
    • Custom properties Picking & Disabled are now using Outliner Icons instead.
    • Alpha now supported in vertex colors
  • Changes for lights tab / proccessing:
    • Added PBR intensity mode custom property. When Automatic or not PBR, intensity scaled 0-1 from Blender’s Energy, where 10 is 1. Otherwise Energy passed, unmodified.
    • Range property now supported using Blender property Radius
    • Hemi light type is no longer supported. To get a BJS hemi light use area type, & specify Size X for range.
  • Added new custom properties panel for Materials:
    • Relocated Back Face Culling checkbox from Game Engine to here
    • Relocated Check Ready Only Once checkbox from Mesh tab to here
    • Relocated Max Simultaneous Lights from Mesh tab to here
    • Relocated Name Space from Mesh tab to here (might be in TOB only, since JSON files cannot share materials)
  • Mesh baking can be reduced to only the texture channels required, keeping other image texture based channels (not for multi-material meshes)
  • Nodes based renders (Cycles & eevee) not always just baked. See chart for properties / textures & where values are from. Properties are only assigned when no texture input to socket.
STD Property / Tex PBR Property / Tex From Nodes-Socket
diffuseColor / diffuseTexture albedoColor / albedoTexture Diffuse BSDF - Color, Principled BSDF - Base Color
ambientColor / ambientTexture ambientColor / useAmbientOcclusionFromMetallicTextureRed Ambient Occlusion - Color
emissiveColor / emissiveTexture emissiveColor / emissiveTexture Emission - Color
specularColor / specularTexture reflectivityColor / reflectivityTexture Glossy BSDF - Color, Principled BSDF - Specular
specularPower (inverted & 0 - 128) roughness / useRoughnessFromMetallicTextureGreen Glossy BSDF - Roughness, Principled BSDF - Roughness
indexOfRefraction / refractionTexture indexOfRefraction / refractionTexture Refraction BSDF - IOR, Frensel - IOR, Principled BSDF - IOR / Refraction BSDF - Color, Principled BSDF - IOR
metallic / metallicTexture Principled - Specular
emissiveIntensity Emission - Strength
alpha / opacityTexture alpha / opacityTexture Diffuse BSDF - Color, Transparency BSDF - Color, Principled BSDF - Base Color
bumpTexture bumpTexture Normal Map - Color, Principled BSDF - Normal
  • Certain nodes are allowed, and are either ignored or just passed thru
    • Mix Shader, used mostly for non-principled trees
    • Separate RGB, for metallic textures wt roughness / AO
    • Frensel, when not PBR
  • glTF legacy nodes (glTF Metallic Roughness or glTF Specular Glossiness) produce an error saying to switch to standard Blender nodes or use glTF exporter
  • Texture / UV parameters are optional Nodes, when input to a texture node (ignored when must be baked, baking uses them though)
    • Mapping node for (translation to offset), (rotation to ang), (scale to scale)
    • Texture Coordinate & UVMap nodes for coordinatesIndex
  • When a material channel cannot really be represented by mapping, then it will be baked. Examples:
    • A Noise or other procedureal texture to Principled BSDF - Normal, then a bump texture will be baked
    • Any node which is not explicitly supported or ignored

Blender EEVEE / cycles testing
#2

Congrats mate!!!


#3

Great, thanks a lot.


#4

Huge! Thanks @JCPalmer


#5

excellent !


#6

Ho sounds really great,
I need to test with the gltf export, if it’s now possible to bake shadows in blender for an already existing babylon scene and reexport them to babylon after.


#7

I do not know if baking shadows is possible. I can say dynamic shadows for mesh that move are supported by the exporter.

To do that, assign the casting & receiving custom properties to the appropriate meshes. This is on the mesh custom properties:

Then in the light custom properties, you have to set the shadow generator custom properties:

I do not really know a lot about how Blender generates shadows, but there is a new ESM shadow capability using the EEVEE engine:

Problem is that EEVEE does NOT support baking. When the exporter does have to bake materials (hopefully not often, though you can do some really cool stuff putting Magic Texture on the diffuse channel), it temporarily switches to the Cycles engine.

If there was a way to cast a shadow using Cycles (probably), you could bake the shadows into the materials yourself, or you can force the materials of a mesh which receive a shadow to be baked during export, using properties highlighted above in Blue.

I have not found dynamic shadows to be a real drain. I did one scene where at the end 94 dynamic shadows were use. The scene did not die, on a desktop, at least.


#8

Hi JCPalmer,

maybe this tutorial can be a help to you


“When we have setup the useLightmapAsShadowmap property in our lightmapped materials,…”


#9

Can I export Reflection probes with the Blender Exporter Version 6.0.0?

Or asked differently, how can I address a mesh (e.g.Suzanne) from a *.babylon file so I can create a reflection probe according to this scheme?

var probe = new BABYLON.ReflectionProbe(“main”, 512, scene);
probe.renderList.push(yellowSphere);
probe.renderList.push(greenSphere);
probe.renderList.push(blueSphere);
probe.renderList.push(mirror);

mainMaterial.reflectionTexture = probe.cubeTexture;

https://doc.babylonjs.com/how_to/how_to_use_reflection_probes


#10

A reflectionProbe can be inside a .babylon file, but unless there is some Blender object it can be associated with, it would have to be done completely with custom properties. So no, they are not exported.

ShadowGenerators are combined with a light with a few extra properties.

Once a mesh is imported, it is just like any other mesh. If you need to actually use a mesh as an argument to something, just query it by the name you gave it in Blender.

probe.renderList.push(scene.getMeshByName('blah-blah-blah'));

You can also use scene.getMeshByID(). Blender exporter always uses the same value for name & ID, but other exporters generate a unique symbol, UID.


#11

Many thanks for your answer JCPalmer.
I will try that.

I still have a small question.
I have a Mirror-Ground with shadow,

var helper = scene.createDefaultEnvironment({
enableGroundMirror: true,
groundmirroramount: 50,
groundMirrorFresnelWeight: 0.6,
groundShadowLevel: 0.6,
});

Offline it works perfectly, but online I don’t have a Mirror-Ground.

Do I have to add anything to the .htaccess (AddType…?)

Many greetings
Hans


#12

I do not know. Make a simple PG & posting to your own topic is what I would recommend, since this really has nothing to do with Blender. I rarely look at 3DS Max topics. The people who look here, may not know.


#13

Okay.

Many thanks for your answer.
Hans


#14

I hope having more time this month to be able to test your new exporter.

After quick exports, I’ve seen issue during export when dealing with cameras. Are they already supported?

About the future documentation, what do you think about renaming:

  • Blender page to Blender to .babylon (2.79 or older),
  • Blender to glTF page to Blender to .glTF (2.79 or older),
  • Blender Tips page could keep its name, and have some 2.79 & 2.8 sections inside,
  • creating a new page named Blender to .babylon (2.8 or earlier),
  • creating a new page named Blender to .gltf (2.8 or erlier) ?

#15

As far as keeping old docs, it is alright by me. Think you have a typo. Should probably 2.80 or later.

Yes, lights are exported. There are a number of changes highlighted by topic referenced at the top. Light exports vary by whether PBR or STD. Also, lights brought in by Append are not going to be right, especially former Hemi lights. Create a new Area light for a Hemi.