diff options
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.cc')
-rw-r--r-- | source/blender/blenkernel/intern/customdata.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc index 4492f8bbc64..b348e18a6a8 100644 --- a/source/blender/blenkernel/intern/customdata.cc +++ b/source/blender/blenkernel/intern/customdata.cc @@ -1450,6 +1450,21 @@ static bool layerValidate_propfloat2(void *data, const uint totitems, const bool return has_errors; } +static void layerInterp_propbool(const void **sources, + const float *weights, + const float *UNUSED(sub_weights), + int count, + void *dest) +{ + bool result = false; + for (int i = 0; i < count; i++) { + const float interp_weight = weights[i]; + const bool src = *(const bool *)sources[i]; + result |= src && (interp_weight > 0.0f); + } + *(bool *)dest = result; +} + static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { /* 0: CD_MVERT */ {sizeof(MVert), "MVert", 1, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}, @@ -1838,7 +1853,7 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { N_("Boolean"), nullptr, nullptr, - nullptr, + layerInterp_propbool, nullptr, nullptr, nullptr, |