Commit: 500bc99da5dbcdf7c728833326fc29babaf529e0
Author: Jacques Lucke
Date: Tue Feb 16 14:25:35 2021 +0100
Branches: master
https://developer.blender.org/rB500bc99da5dbcdf7c728833326fc29babaf529e0
Fix T85697: implement interpolation for float custom data type
This just hasn't been implemented before.
===================================================================
M source/blender/blenkernel/intern/customdata.c
===================================================================
diff --git a/source/blender/blenkernel/intern/customdata.c
b/source/blender/blenkernel/intern/customdata.c
index 782b4fc200e..9188d8c1afd 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -473,6 +473,21 @@ static void layerCopy_propFloat(const void *source, void
*dest, int count)
memcpy(dest, source, sizeof(MFloatProperty) * count);
}
+static void layerInterp_propFloat(const void **sources,
+ const float *weights,
+ const float *UNUSED(sub_weights),
+ int count,
+ void *dest)
+{
+ float result = 0.0f;
+ for (int i = 0; i < count; i++) {
+ const float interp_weight = weights[i];
+ const float src = *(const float *)sources[i];
+ result += src * interp_weight;
+ }
+ *(float *)dest = result;
+}
+
static bool layerValidate_propFloat(void *data, const uint totitems, const
bool do_fixes)
{
MFloatProperty *fp = data;
@@ -1553,7 +1568,7 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
N_("Float"),
layerCopy_propFloat,
NULL,
- NULL,
+ layerInterp_propFloat,
NULL,
NULL,
layerValidate_propFloat},
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs