Minor cleanup in data transfer code.

This commit is contained in:
Bastien Montagne 2019-04-26 17:20:45 +02:00
parent 8973d1e769
commit 0fddc48fb2
2 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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;
}
}