Fix #117520: Data Transfer modifier not working with Vertex Groups

This was the case for custom normals.

There was an optimization in 91b4f9f1f6 that was skipping computation of
existing normals if the Mix Factor in the UI was at 1.0 (under the
assumption that in this case no old normals would be needed.

Problem is that the resulting mix factor is the product of the Mix
Factor in the UI and the weights, so just doing the check as in the
culprit commit is not enough.

Need to consider if weights are used.

Pull Request: https://projects.blender.org/blender/blender/pulls/117538
This commit is contained in:
Philipp Oeser
2024-01-26 16:44:59 +01:00
committed by Philipp Oeser
parent ebcdf19537
commit eead38ab97

View File

@@ -1060,7 +1060,7 @@ static bool data_transfer_layersmapping_generate(ListBase *r_map,
dst_data = static_cast<float3 *>(CustomData_add_layer(
&me_dst->corner_data, CD_NORMAL, CD_SET_DEFAULT, me_dst->corners_num));
}
if (mix_factor != 1.0f) {
if (mix_factor != 1.0f || mix_weights) {
MutableSpan(dst_data, me_dst->corners_num).copy_from(me_dst->corner_normals());
}
/* Post-process will convert it back to CD_CUSTOMLOOPNORMAL. */