Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-12-08 20:07:50 +0300
committerJacques Lucke <jacques@blender.org>2020-12-08 20:07:50 +0300
commite08de974c36a800538d8f9af0f902de6694e5d76 (patch)
treec6677b66d8f4c52d8bda34d2e828bc4cda055943
parent40dd70882cd32c79b2f1a9320ea32f13431b22c9 (diff)
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.
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc2
1 files changed, 2 insertions, 0 deletions
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);