Skip to content
Snippets Groups Projects
Commit e08de974 authored by Jacques Lucke's avatar Jacques Lucke
Browse files

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.
parent 40dd7088
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "MEM_guardedalloc.h" #include "MEM_guardedalloc.h"
#include "BKE_mesh.h"
#include "BKE_subdiv.h" #include "BKE_subdiv.h"
#include "BKE_subdiv_mesh.h" #include "BKE_subdiv_mesh.h"
...@@ -90,6 +91,7 @@ static void geo_node_subdivision_surface_exec(GeoNodeExecParams params) ...@@ -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); Mesh *mesh_out = BKE_subdiv_to_mesh(subdiv, &mesh_settings, mesh_in);
BKE_mesh_calc_normals(mesh_out);
geometry_set.replace_mesh(mesh_out); geometry_set.replace_mesh(mesh_out);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment