Attributes: Remove asserts for DefaultMixer negative weight

The attribute smoothing node asks for the ability to have a factor
outside the range of 0 and 1. The problem with this is that there is a
negative weight assertion for some of the mixers. If mixing between 0
and 1, then at a factor of 2, one of the elements will be negative.

Differential Revision: https://developer.blender.org/D16351
This commit is contained in:
Iliya Katueshenock
2022-12-02 14:44:54 -06:00
committed by Hans Goudey
parent ce16fa0f4c
commit 18e386613c
2 changed files with 0 additions and 6 deletions

View File

@@ -285,7 +285,6 @@ template<typename T> class SimpleMixer {
*/
void set(const int64_t index, const T &value, const float weight = 1.0f)
{
BLI_assert(weight >= 0.0f);
buffer_[index] = value * weight;
total_weights_[index] = weight;
}
@@ -295,7 +294,6 @@ template<typename T> class SimpleMixer {
*/
void mix_in(const int64_t index, const T &value, const float weight = 1.0f)
{
BLI_assert(weight >= 0.0f);
buffer_[index] += value * weight;
total_weights_[index] += weight;
}

View File

@@ -23,7 +23,6 @@ void ColorGeometry4fMixer::set(const int64_t index,
const ColorGeometry4f &color,
const float weight)
{
BLI_assert(weight >= 0.0f);
buffer_[index].r = color.r * weight;
buffer_[index].g = color.g * weight;
buffer_[index].b = color.b * weight;
@@ -35,7 +34,6 @@ void ColorGeometry4fMixer::mix_in(const int64_t index,
const ColorGeometry4f &color,
const float weight)
{
BLI_assert(weight >= 0.0f);
ColorGeometry4f &output_color = buffer_[index];
output_color.r += color.r * weight;
output_color.g += color.g * weight;
@@ -89,7 +87,6 @@ void ColorGeometry4bMixer::ColorGeometry4bMixer::set(int64_t index,
const ColorGeometry4b &color,
const float weight)
{
BLI_assert(weight >= 0.0f);
accumulation_buffer_[index][0] = color.r * weight;
accumulation_buffer_[index][1] = color.g * weight;
accumulation_buffer_[index][2] = color.b * weight;
@@ -99,7 +96,6 @@ void ColorGeometry4bMixer::ColorGeometry4bMixer::set(int64_t index,
void ColorGeometry4bMixer::mix_in(int64_t index, const ColorGeometry4b &color, float weight)
{
BLI_assert(weight >= 0.0f);
float4 &accum_value = accumulation_buffer_[index];
accum_value[0] += color.r * weight;
accum_value[1] += color.g * weight;