From da8c799a7f2e8f618b472892c012d2eaf0a4dbf5 Mon Sep 17 00:00:00 2001 From: Mikhail Rachinskiy Date: Thu, 6 Jan 2022 20:22:49 +0400 Subject: PLY: do not write face normals to vertices Spliting edges for this purpose is doing more harm than good, additionally not all DCCs import PLY normals anyway, including Blender. --- io_mesh_ply/export_ply.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/io_mesh_ply/export_ply.py b/io_mesh_ply/export_ply.py index 1a28f3cf..3bb21858 100644 --- a/io_mesh_ply/export_ply.py +++ b/io_mesh_ply/export_ply.py @@ -80,7 +80,7 @@ def save_mesh(filepath, bm, use_ascii, use_normals, use_uv, use_color): use_uv = use_uv and uv_lay is not None use_color = use_color and col_lay is not None - uv = color = None + normal = uv = color = None ply_faces = [] ply_verts = [] @@ -91,10 +91,6 @@ def save_mesh(filepath, bm, use_ascii, use_normals, use_uv, use_color): pf = [] ply_faces.append(pf) - normal = None - if use_normals and not f.smooth: - normal = f.normal - for loop in f.loops: v = map_id = loop.vert @@ -108,7 +104,7 @@ def save_mesh(filepath, bm, use_ascii, use_normals, use_uv, use_color): pf.append(_id) continue - if use_normals and normal is None: + if use_normals: normal = v.normal if use_color: color = tuple(int(x * 255.0) for x in loop[col_lay]) -- cgit v1.2.3