[Bf-blender-cvs] [a92f2931ceb] master: Cleanup: Avoid double negative in face corner normal calculation

Hans Goudey noreply at git.blender.org
Thu Dec 8 22:14:43 CET 2022


Commit: a92f2931cebb9a08a4d5c293ca7bbb9fad71951d
Author: Hans Goudey
Date:   Thu Dec 8 14:45:48 2022 -0600
Branches: master
https://developer.blender.org/rBa92f2931cebb9a08a4d5c293ca7bbb9fad71951d

Cleanup: Avoid double negative in face corner normal calculation

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

M	source/blender/blenkernel/intern/mesh_normals.cc

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

diff --git a/source/blender/blenkernel/intern/mesh_normals.cc b/source/blender/blenkernel/intern/mesh_normals.cc
index e7788d82769..900785ace5c 100644
--- a/source/blender/blenkernel/intern/mesh_normals.cc
+++ b/source/blender/blenkernel/intern/mesh_normals.cc
@@ -1784,7 +1784,10 @@ static void mesh_normals_loop_custom_set(const MVert *mverts,
    * matching given custom lnors.
    * Note this code *will never* unsharp edges! And quite obviously,
    * when we set custom normals per vertices, running this is absolutely useless. */
-  if (!use_vertices) {
+  if (use_vertices) {
+    done_loops.fill(true);
+  }
+  else {
     for (int i = 0; i < numLoops; i++) {
       if (!lnors_spacearr.lspacearr[i]) {
         /* This should not happen in theory, but in some rare case (probably ugly geometry)
@@ -1883,9 +1886,6 @@ static void mesh_normals_loop_custom_set(const MVert *mverts,
                                 &lnors_spacearr,
                                 nullptr);
   }
-  else {
-    done_loops.fill(true);
-  }
 
   /* And we just have to convert plain object-space custom normals to our
    * lnor space-encoded ones. */



More information about the Bf-blender-cvs mailing list