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.
This commit is contained in:
Jacques Lucke 2020-12-08 18:07:50 +01:00
parent 40dd70882c
commit e08de974c3
Notes: blender-bot 2023-02-14 06:46:23 +01:00
Referenced by issue #83114, Geometry nodes: Shading issue when self-instanced
1 changed files with 2 additions and 0 deletions

View File

@ -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);