New smooth / flat shading processing

blender

#1

For those that do not know (everyone but @Deltakosh), Blender has 2 normals for every vertex (or at least 2 api accessible ones). A face normal for flat shading, and a normal for each vertex to be interpolated for smooth shading.

Early versions of the exporter had a custom switch to pick what was to be used. Eventually, this was pulled out and controlled by adding a ‘edge split’ modifier using the smooth shading normals. As I explore 2.80, selecting things is now with the left mouse, and right click brings up a context menu just like every other program on the planet (finally!).

The context menu for meshes varies by mode. In object (as opposed to edit) mode, it now has 2 menu options to select the shading to use. I am going put back the original way of doing either normal, but using Blender’s own switch.

normal%20switch

The theme behind this is to the maximum extent possible, export what Blender is showing & by extension the more you know about Blender, the better your export results. Probably going cause a bunch of topics, but do not care. This topic can just be referenced linked as the answer. Not going to fight Blender’s UI improvements


Export from blender. Strange shading
#2

This is now done, but a note that the Blender use_Smooth shading switch is on a per vertex basis. Those 2 menu items switch every vertex, but if there is some way in edit mode to change only some vertices, or a merge of 2 meshes where one is flat shaded & another is smooth, the exporter should work just as Blender does.

This far more powerful than anything exportable before. A edge split modifier might be able, but monkeying is probably required.

I merged a flat shaded cube on the left, with a smooth shaded on the right, and this is what I got. When i put out the beta, can someone remember to an export test of this?
mixedShading