diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_solidify_nonmanifold.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_solidify_nonmanifold.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c index 997f5943060..1aa52d44509 100644 --- a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c +++ b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c @@ -158,7 +158,6 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, const uint numVerts = (uint)mesh->totvert; const uint numEdges = (uint)mesh->totedge; const uint numPolys = (uint)mesh->totpoly; - const uint numLoops = (uint)mesh->totloop; if (numPolys == 0 && numVerts != 0) { return mesh; @@ -170,8 +169,6 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, const short mat_ofs = mat_nrs > 1 ? smd->mat_ofs : 0; const short mat_ofs_rim = mat_nrs > 1 ? smd->mat_ofs_rim : 0; - float(*poly_nors)[3] = NULL; - /* #ofs_front and #ofs_back are the offset from the original * surface along the normal, where #oft_front is along the positive * and #oft_back is along the negative normal. */ @@ -217,10 +214,9 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, #define MOD_SOLIDIFY_EMPTY_TAG ((uint)-1) - /* Calculate only face normals. */ - poly_nors = MEM_malloc_arrayN(numPolys, sizeof(*poly_nors), __func__); - BKE_mesh_calc_normals_poly( - orig_mvert, (int)numVerts, orig_mloop, (int)numLoops, orig_mpoly, (int)numPolys, poly_nors); + /* Calculate only face normals. Copied because they are modified directly below. */ + float(*poly_nors)[3] = MEM_malloc_arrayN(numPolys, sizeof(float[3]), __func__); + memcpy(poly_nors, BKE_mesh_poly_normals_ensure(mesh), sizeof(float[3]) * numPolys); NewFaceRef *face_sides_arr = MEM_malloc_arrayN( numPolys * 2, sizeof(*face_sides_arr), "face_sides_arr in solidify"); |