From f0888c51b889f3b96cb7c6cf4f4a163465c816d5 Mon Sep 17 00:00:00 2001 From: Thomas Barlow Date: Fri, 26 Jan 2024 02:31:17 +0000 Subject: [PATCH 1/2] FBX IO: Export corner normals instead of face normals Face normals do not seem to be as widely supported as vertex and corner normals, so meshes with the 'FACE' `.normals_domain` are now exported as corner normals instead. See blender/blender#117470. --- io_scene_fbx/export_fbx_bin.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index b4f5de98a..b71a53cd9 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -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. normal_source = me.vertex_normals normal_mapping = b"ByVertice" - case 'FACE': - # Either all faces or all edges are sharp, so we can get normals from the faces. - normal_source = me.polygon_normals - normal_mapping = b"ByPolygon" - case 'CORNER': + # External software support for b"ByPolygon" normals does not seem to be as widely available as the other + # mappings. See blender/blender#117470. + # case 'FACE': + # # Either all faces or all edges are sharp, so we can get normals from the faces. + # 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 # corners. normal_source = me.corner_normals -- 2.30.2 From 0492e1f7da1c18a4eeb8ff941a3267019faa8d7a Mon Sep 17 00:00:00 2001 From: Thomas Barlow Date: Wed, 7 Feb 2024 02:32:35 +0000 Subject: [PATCH 2/2] Increase FBX IO version --- io_scene_fbx/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index b07e1ede9..1a79d15bf 100644 --- a/io_scene_fbx/__init__.py +++ b/io_scene_fbx/__init__.py @@ -5,7 +5,7 @@ bl_info = { "name": "FBX format", "author": "Campbell Barton, Bastien Montagne, Jens Restemeier, @Mysteryem", - "version": (5, 11, 6), + "version": (5, 11, 7), "blender": (4, 1, 0), "location": "File > Import-Export", "description": "FBX IO meshes, UVs, vertex colors, materials, textures, cameras, lamps and actions", -- 2.30.2