diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-03-28 17:05:04 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-03-28 22:02:59 +0300 |
commit | a016ad2ea8d718a8f48be841fe463bc5a54e3be8 (patch) | |
tree | b12021f9504358563f85e2eee279a27eeb1e56a6 /source/blender/blenkernel/intern/mesh.c | |
parent | 06805251478c53a262bc1fe9a7224d1f1b5bf449 (diff) |
Fix part of T60735: invalid CD_ORIGINDEX data in some modifier stack evaluations.
BKE_mesh_new_nomain automatically added a CD_ORIGINDEX layer initialized to 0,
which was never filled in correctly. In 2.7 the equivalent function used to
modify the source derivedmesh and add valid original indices to it, but this
is no longer possible in the new design and was quite unpredictable anyway.
Now instead rely on mesh_calc_modifiers and the depsgraph to determine when
CD_ORIGINDEX should be added.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 4a3eb6adcf6..449c2f86b04 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -584,18 +584,6 @@ static void mesh_ensure_cdlayers_primary(Mesh *mesh, bool do_tessface) if (do_tessface && !CustomData_get_layer(&mesh->fdata, CD_MFACE)) CustomData_add_layer(&mesh->fdata, CD_MFACE, CD_CALLOC, NULL, mesh->totface); } -static void mesh_ensure_cdlayers_origindex(Mesh *mesh, bool do_tessface) -{ - if (!CustomData_get_layer(&mesh->vdata, CD_ORIGINDEX)) - CustomData_add_layer(&mesh->vdata, CD_ORIGINDEX, CD_CALLOC, NULL, mesh->totvert); - if (!CustomData_get_layer(&mesh->edata, CD_ORIGINDEX)) - CustomData_add_layer(&mesh->edata, CD_ORIGINDEX, CD_CALLOC, NULL, mesh->totedge); - if (!CustomData_get_layer(&mesh->pdata, CD_ORIGINDEX)) - CustomData_add_layer(&mesh->pdata, CD_ORIGINDEX, CD_CALLOC, NULL, mesh->totpoly); - - if (do_tessface && !CustomData_get_layer(&mesh->fdata, CD_ORIGINDEX)) - CustomData_add_layer(&mesh->fdata, CD_ORIGINDEX, CD_CALLOC, NULL, mesh->totface); -} Mesh *BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len) { @@ -619,7 +607,6 @@ Mesh *BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int lo mesh->totpoly = polys_len; mesh_ensure_cdlayers_primary(mesh, true); - mesh_ensure_cdlayers_origindex(mesh, true); BKE_mesh_update_customdata_pointers(mesh, false); return mesh; @@ -662,7 +649,6 @@ static Mesh *mesh_new_nomain_from_template_ex( /* The destination mesh should at least have valid primary CD layers, * even in cases where the source mesh does not. */ mesh_ensure_cdlayers_primary(me_dst, do_tessface); - mesh_ensure_cdlayers_origindex(me_dst, false); BKE_mesh_update_customdata_pointers(me_dst, false); return me_dst; |