Flate Shade entire scene option in BJS Blender exporter 5.6.4


I’m searching Flate Shade entire scene option in BJS 5.6.4 Blender exporter, but unable to find it…

In 5.6.4 …

So if option has been removed where can I found an older version of BJS exporter ?

Thx in advance,

@JCPalmer our blender Guru is the king of the exporter and might be able to help :slight_smile:

Basically, the exporter transfers all types of normals, even flat smooth mixes, but does not change anything.
If you want flat shade it as flat. For more see New smooth / flat shading processing - Content creation (3dsMax, Maya, Blender, glTF) - Babylon.js

It’s miller time

Better answer than on a late Friday afternoon. There is no snapshot in version 5 with that option remaining.

Flat shading by the exporter was on the way out by then in favor of using Blender to do this. It complicated the export process with something that Blender already did. People with Blender skills should be rewarded by being able to precisely control normals as builtin there (right clicking is not that hard).

In 5.6, I see a message being written to log file if an old property for flat shading was found at the mesh level:

if hasattr(object.data, 'useFlatShading') and object.data.useFlatShading:
    hasModifier = False
    # extra checking not really working; all checking going to be pulled in future
    for con in object.constraints:
        if con.name == 'EDGE_SPLIT':
            hasModifier = True

    if not hasModifier:
        Logger.warn('Found Obsolete "Use Flat Shading" property set True.  Replaced by "Edge Split" modifier instead', 2)

If you cannot go to Blender 2.80+, you would need to add an edge split modifier on each mesh. If you just want to jump to a newer version of Blender, 2.83 recommended, steps would be:

  • Bring meshes into a new scene, using File->Append->objects.
  • Best to re-create any lights & camera to avoid problems with the old versions. You might not even need lights if you export as PBR materials, new in Exporter 6.x.
  • Materials & armature of meshes will follow, but those with non-cycles materials with textures will not have the textures. The new cycles node, Pricipled BSDF, makes it easy to hook up stuff for export. This is how things map for export. Might look complicated here, but nobody uses all the options in a single material.

Thx a lot for your reply,

I’am not sure to understand, so in fact you say that the option in the older exporter version do noting else than just reproduce the same thing as the Edge Split modifier ? It has not an extra cost at rendering time to use it (I’am not sure to understand what do this modifier in fact).

I know I can use convertToFlatShadedMesh function to achieve this in BJS, but I supposed it has an extra performance cost at loading time, but if is faster at rendering time (less vertex) I prefere to use it.

And no I dont want to use the 6.X exporter because I’am using BJS 3.3 (I’am not sure if the new exporter working with it) and because I have 50 models made with blender 2.79 and they are not fully working with Blender 2.8x.

Edit : I just trying Edge split modifier, I don’t know for the performance, but it do the desired render :slight_smile: