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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-03-08 13:49:49 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-03-08 19:53:31 +0300
commit8730984c708bdde6a2cf29fc4f29bd50c05b349c (patch)
treef3bf8b462ed4c42cd928fbace84efebe3be076e4 /source/blender/blenkernel/intern/mesh_remap.c
parentcdba2bc0fce86e814aaa5a969a018b5c1c9f8b3b (diff)
Fix (unreported) datatransfer code could still modify source mesh in some cases.
Source (i.e. other) mesh should not be modified in any case in modifier evaluation case (this is forbidden by design and can lead to all kind of threaded locks and crashes), and doing so even in operator case was never a good idea either. Now that we can specifically request needed data (poly and/or loop normals) from evaluation code, we can finally get rid of those computations inside data transfer/mesh remapping area. This is hopefully the last remaining bit of this 'bad crashing code' in datatransfer area.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_remap.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_remap.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index 55e8a96fa16..7219332774a 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -1251,18 +1251,13 @@ void BKE_mesh_remap_calc_loops_from_mesh(
}
}
if (need_pnors_src || need_lnors_src) {
- /* Simpler for now, calcNormals never stores pnors :( */
- if (!CustomData_has_layer(&me_src->pdata, CD_NORMAL)) {
- CustomData_add_layer(&me_src->pdata, CD_NORMAL, CD_CALLOC, NULL, me_src->totpoly);
- CustomData_set_layer_flag(&me_src->pdata, CD_NORMAL, CD_FLAG_TEMPORARY);
- }
- BKE_mesh_calc_normals_split(me_src);
-
if (need_pnors_src) {
poly_nors_src = CustomData_get_layer(&me_src->pdata, CD_NORMAL);
+ BLI_assert(poly_nors_src != NULL);
}
if (need_lnors_src) {
loop_nors_src = CustomData_get_layer(&me_src->ldata, CD_NORMAL);
+ BLI_assert(loop_nors_src != NULL);
}
}
}