diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-04-26 18:20:45 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-04-26 18:21:10 +0300 |
commit | 0fddc48fb2b518a4aa031a08ad4f39233c2c6f3c (patch) | |
tree | 6ec6093113cde87ce40304ffe7fa78c794dd020a /source/blender | |
parent | 8973d1e7697c8272ba15aa7ecb79f0de66930086 (diff) |
Minor cleanup in data transfer code.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/data_transfer.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_remap.c | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/data_transfer.c b/source/blender/blenkernel/intern/data_transfer.c index a57db5a7cbe..09b71db5ce9 100644 --- a/source/blender/blenkernel/intern/data_transfer.c +++ b/source/blender/blenkernel/intern/data_transfer.c @@ -340,6 +340,10 @@ static void data_transfer_dtdata_type_postprocess(Object *UNUSED(ob_src), const bool changed) { if (dtdata_type == DT_TYPE_LNOR) { + if (!changed) { + return; + } + /* Bake edited destination loop normals into custom normals again. */ MVert *verts_dst = me_dst->mvert; const int num_verts_dst = me_dst->totvert; @@ -358,10 +362,6 @@ static void data_transfer_dtdata_type_postprocess(Object *UNUSED(ob_src), BLI_assert(poly_nors_dst); - if (!changed) { - return; - } - if (!custom_nors_dst) { custom_nors_dst = CustomData_add_layer( ldata_dst, CD_CUSTOMLOOPNORMAL, CD_CALLOC, NULL, num_loops_dst); diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c index 6799c6f5c43..9a79951152f 100644 --- a/source/blender/blenkernel/intern/mesh_remap.c +++ b/source/blender/blenkernel/intern/mesh_remap.c @@ -323,7 +323,7 @@ void BKE_mesh_remap_calc_source_cddata_masks_from_map_modes(const int UNUSED(ver const int UNUSED(edge_mode), const int loop_mode, const int UNUSED(poly_mode), - CustomData_MeshMasks *cddata_mask) + CustomData_MeshMasks *r_cddata_mask) { /* vert, edge and poly mapping modes never need extra cddata from source object. */ const bool need_lnors_src = (loop_mode & MREMAP_USE_LOOP) && (loop_mode & MREMAP_USE_NORMAL); @@ -331,10 +331,10 @@ void BKE_mesh_remap_calc_source_cddata_masks_from_map_modes(const int UNUSED(ver ((loop_mode & MREMAP_USE_POLY) && (loop_mode & MREMAP_USE_NORMAL)); if (need_lnors_src) { - cddata_mask->lmask |= CD_MASK_NORMAL; + r_cddata_mask->lmask |= CD_MASK_NORMAL; } if (need_pnors_src) { - cddata_mask->pmask |= CD_MASK_NORMAL; + r_cddata_mask->pmask |= CD_MASK_NORMAL; } } |