[Bf-blender-cvs] [e08de974c36] master: Fix T83114: incorrect normals after joining subdivided meshes

Jacques Lucke noreply at git.blender.org
Tue Dec 8 18:09:18 CET 2020


Commit: e08de974c36a800538d8f9af0f902de6694e5d76
Author: Jacques Lucke
Date:   Tue Dec 8 18:07:50 2020 +0100
Branches: master
https://developer.blender.org/rBe08de974c36a800538d8f9af0f902de6694e5d76

Fix T83114: incorrect normals after joining subdivided meshes

This just makes sure that the mesh coming out of the subdivision
surface node has correct normals. Ideally, we would lazily compute
derived data like normals in more cases, but that can be solved later.
Correctness is more important right now.

In order to solve this better, it would be nice if functions like
`BKE_mesh_ensure_normals` would take a `const Mesh *`.
The mesh could be considered to be logically const, because
normals are derived data that is only cached for the current
state of the mesh.

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

M	source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc

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

diff --git a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc
index 197700cc521..543859aef3f 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc
@@ -16,6 +16,7 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BKE_mesh.h"
 #include "BKE_subdiv.h"
 #include "BKE_subdiv_mesh.h"
 
@@ -90,6 +91,7 @@ static void geo_node_subdivision_surface_exec(GeoNodeExecParams params)
   }
 
   Mesh *mesh_out = BKE_subdiv_to_mesh(subdiv, &mesh_settings, mesh_in);
+  BKE_mesh_calc_normals(mesh_out);
 
   geometry_set.replace_mesh(mesh_out);



More information about the Bf-blender-cvs mailing list