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:
authorCampbell Barton <ideasman42@gmail.com>2015-11-11 11:07:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-11-11 11:07:04 +0300
commit69674f387569bddafc27227ba3e104a262301a44 (patch)
treeede19387e2049c19d9b89ecdb28068e36a664d08 /source/blender/blenkernel/intern/customdata.c
parent8c84a1873d8d4ef461bb14bbc9b180cf2d111351 (diff)
Fix T46694: UVLoop incorrectly copied flag
Error in copying customdata flag lead to pin being randomly enabled.
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r--source/blender/blenkernel/intern/customdata.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index f210d34d220..32a21e64552 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -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 */