FBX IO: Export corner normals instead of face normals #105150

Merged
Thomas Barlow merged 3 commits from Mysteryem/blender-addons:fbx_disable_face_normals_export into main 2024-02-07 03:36:05 +01:00
2 changed files with 8 additions and 6 deletions

View File

@ -5,7 +5,7 @@
bl_info = { bl_info = {
"name": "FBX format", "name": "FBX format",
"author": "Campbell Barton, Bastien Montagne, Jens Restemeier, @Mysteryem", "author": "Campbell Barton, Bastien Montagne, Jens Restemeier, @Mysteryem",
"version": (5, 11, 6), "version": (5, 11, 7),
"blender": (4, 1, 0), "blender": (4, 1, 0),
"location": "File > Import-Export", "location": "File > Import-Export",
"description": "FBX IO meshes, UVs, vertex colors, materials, textures, cameras, lamps and actions", "description": "FBX IO meshes, UVs, vertex colors, materials, textures, cameras, lamps and actions",

View File

@ -1162,11 +1162,13 @@ def fbx_data_mesh_elements(root, me_obj, scene_data, done_meshes):
# All faces are smooth shaded, so we can get normals from the vertices. # All faces are smooth shaded, so we can get normals from the vertices.
normal_source = me.vertex_normals normal_source = me.vertex_normals
normal_mapping = b"ByVertice" normal_mapping = b"ByVertice"
case 'FACE': # External software support for b"ByPolygon" normals does not seem to be as widely available as the other
# Either all faces or all edges are sharp, so we can get normals from the faces. # mappings. See blender/blender#117470.
normal_source = me.polygon_normals # case 'FACE':
normal_mapping = b"ByPolygon" # # Either all faces or all edges are sharp, so we can get normals from the faces.
case 'CORNER': # normal_source = me.polygon_normals
# normal_mapping = b"ByPolygon"
case 'CORNER' | 'FACE':
# We have a mix of sharp/smooth edges/faces or custom split normals, so need to get normals from # We have a mix of sharp/smooth edges/faces or custom split normals, so need to get normals from
# corners. # corners.
normal_source = me.corner_normals normal_source = me.corner_normals