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>2013-01-08 20:39:36 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-08 20:39:36 +0400
commitb0c084c6cca1dd9703f580427d838ee9e6d9f849 (patch)
tree8916c7d8359bd384171641f3f692faefed5804f8 /source/blender/blenkernel/intern/customdata.c
parent0c1d1e6c30e8f11834d401b46bdc2018a4e942d9 (diff)
fix [#33797] decimate modifier bug on uv-coordinates when mesh uses vertex color
if vertex colors had no seams - it would interpolate the UV's too, now interpolate per-layer.
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r--source/blender/blenkernel/intern/customdata.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 19624e8a2b9..4c6b0c08158 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2629,6 +2629,19 @@ void CustomData_bmesh_set_layer_n(CustomData *data, void *block, int n, void *so
memcpy(dest, source, typeInfo->size);
}
+/**
+ * \param src_blocks must be pointers to the data, offset by layer->offset already.
+ */
+void CustomData_bmesh_interp_n(CustomData *data, void **src_blocks, const float *weights,
+ const float *sub_weights, int count, void *dest_block, int n)
+{
+ CustomDataLayer *layer = &data->layers[n];
+ const LayerTypeInfo *typeInfo = layerType_getInfo(layer->type);
+
+ typeInfo->interp(src_blocks, weights, sub_weights, count,
+ (char *)dest_block + layer->offset);
+}
+
void CustomData_bmesh_interp(CustomData *data, void **src_blocks, const float *weights,
const float *sub_weights, int count, void *dest_block)
{
@@ -2651,9 +2664,7 @@ void CustomData_bmesh_interp(CustomData *data, void **src_blocks, const float *w
for (j = 0; j < count; ++j) {
sources[j] = (char *)src_blocks[j] + layer->offset;
}
-
- typeInfo->interp(sources, weights, sub_weights, count,
- (char *)dest_block + layer->offset);
+ CustomData_bmesh_interp_n(data, sources, weights, sub_weights, count, dest_block, i);
}
}