[Bf-extensions-cvs] [da8c799a] master: PLY: do not write face normals to vertices

Mikhail Rachinskiy noreply at git.blender.org
Thu Jan 6 17:28:00 CET 2022


Commit: da8c799a7f2e8f618b472892c012d2eaf0a4dbf5
Author: Mikhail Rachinskiy
Date:   Thu Jan 6 20:22:49 2022 +0400
Branches: master
https://developer.blender.org/rBAda8c799a7f2e8f618b472892c012d2eaf0a4dbf5

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.

===================================================================

M	io_mesh_ply/export_ply.py

===================================================================

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])



More information about the Bf-extensions-cvs mailing list