Fix T46694: UVLoop incorrectly copied flag

Error in copying customdata flag lead to pin being randomly enabled.
This commit is contained in:
Campbell Barton 2015-11-11 19:07:04 +11:00
parent 8c84a1873d
commit 69674f3875
Notes: blender-bot 2023-02-14 08:27:40 +01:00
Referenced by issue #46694, Edge Loop Slide Correct UV random vertex Pin on the UV
1 changed files with 10 additions and 3 deletions

View File

@ -909,6 +909,7 @@ static void layerInterp_mloopuv(
const float *sub_weights, int count, void *dest)
{
float uv[2];
int flag = 0;
int i;
zero_v2(uv);
@ -916,9 +917,12 @@ static void layerInterp_mloopuv(
if (sub_weights) {
const float *sub_weight = sub_weights;
for (i = 0; i < count; i++) {
float weight = weights ? weights[i] : 1.0f;
float weight = (weights ? weights[i] : 1.0f) * (*sub_weight);
const MLoopUV *src = sources[i];
madd_v2_v2fl(uv, src->uv, (*sub_weight) * weight);
madd_v2_v2fl(uv, src->uv, weight);
if (weight > 0.0f) {
flag |= src->flag;
}
sub_weight++;
}
}
@ -927,12 +931,15 @@ static void layerInterp_mloopuv(
float weight = weights ? weights[i] : 1;
const MLoopUV *src = sources[i];
madd_v2_v2fl(uv, src->uv, weight);
if (weight > 0.0f) {
flag |= src->flag;
}
}
}
/* delay writing to the destination incase dest is in sources */
((MLoopUV *)dest)->flag = ((MLoopUV *)sources)->flag;
copy_v2_v2(((MLoopUV *)dest)->uv, uv);
((MLoopUV *)dest)->flag = flag;
}
/* origspace is almost exact copy of mloopuv's, keep in sync */