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-02-20 18:59:04 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-02-21 17:40:17 +0300
commitfab573bac0e1fbc88f8208372b3a5a2f7415c517 (patch)
treead9a71bc42644a52958eb4327ac8fe0ffbfc6c8a /source/blender/blenkernel/intern/data_transfer.c
parent8986c92b651ddf7ec6b5b71f70a92a3d08b250b5 (diff)
Fix T59338: Blender crashes immediately after loading attached file in ~80% of my attempts.
Issue was a concurrent modification of an evaluated mesh by two other meshes using it as source for custom normals data transfer. Note that this fixes the crash (modifiers are strictly forbidden to modify any data besides their own!), but now will have to add a new CD type to be able to specifically request 'computed' clnors data layer, and not only 'encoded' one, for source mesh...
Diffstat (limited to 'source/blender/blenkernel/intern/data_transfer.c')
-rw-r--r--source/blender/blenkernel/intern/data_transfer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/data_transfer.c b/source/blender/blenkernel/intern/data_transfer.c
index 10d79ebdf96..3e5939b4e0f 100644
--- a/source/blender/blenkernel/intern/data_transfer.c
+++ b/source/blender/blenkernel/intern/data_transfer.c
@@ -249,7 +249,7 @@ int BKE_object_data_transfer_dttype_to_srcdst_index(const int dtdata_type)
static void data_transfer_dtdata_type_preprocess(
Mesh *me_src, Mesh *me_dst,
- const int dtdata_type, const bool dirty_nors_dst)
+ const int dtdata_type, const bool dirty_nors_dst, const bool is_modifier)
{
if (dtdata_type == DT_TYPE_LNOR) {
/* Compute custom normals into regular loop normals, which will be used for the transfer. */
@@ -267,7 +267,9 @@ static void data_transfer_dtdata_type_preprocess(
const bool use_split_nors_dst = (me_dst->flag & ME_AUTOSMOOTH) != 0;
const float split_angle_dst = me_dst->smoothresh;
- BKE_mesh_calc_normals_split(me_src);
+ if (!is_modifier) {
+ BKE_mesh_calc_normals_split(me_src);
+ }
float (*poly_nors_dst)[3];
float (*loop_nors_dst)[3];
@@ -1145,7 +1147,7 @@ bool BKE_object_data_transfer_ex(
continue;
}
- data_transfer_dtdata_type_preprocess(me_src, me_dst, dtdata_type, dirty_nors_dst);
+ data_transfer_dtdata_type_preprocess(me_src, me_dst, dtdata_type, dirty_nors_dst, is_modifier);
cddata_type = BKE_object_data_transfer_dttype_to_cdtype(dtdata_type);