diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-10-27 15:55:10 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-10-29 11:41:26 +0300 |
commit | 3fc97727df6d09636072ca884ab90cb3d9bca6f6 (patch) | |
tree | 342703067cf88719ddc7056aed5d3e5bbce474b1 | |
parent | 6a5d2f4ea2261528ae9d15c66852635b05743d97 (diff) |
CustomData color copying: use interpolated alpha
The alpha of the first layer was always used
here since introduction in rBee4453f08369 and was not updated when
customdata support for alpha was added.
Now also use the interpolated alpha.
thx @brecht noticing!
ref T81914
Reviewers: brecht, mont29
Maniphest Tasks: T81914
Differential Revision: https://developer.blender.org/D9358
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 466a0115a9d..d762b1b0604 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -751,6 +751,7 @@ static void layerCopyValue_mloopcol(const void *source, m2->r = m1->r; m2->g = m1->g; m2->b = m1->b; + m2->a = m1->a; } else { /* Modes that support 'real' mix factor. */ unsigned char src[4] = {m1->r, m1->g, m1->b, m1->a}; @@ -771,13 +772,14 @@ static void layerCopyValue_mloopcol(const void *source, else { memcpy(tmp_col, src, sizeof(tmp_col)); } + blend_color_interpolate_byte(dst, dst, tmp_col, mixfactor); m2->r = (char)dst[0]; m2->g = (char)dst[1]; m2->b = (char)dst[2]; + m2->a = (char)dst[3]; } - m2->a = m1->a; } static bool layerEqual_mloopcol(const void *data1, const void *data2) @@ -1281,7 +1283,7 @@ static void layerCopyValue_propcol(const void *source, return; /* Do Nothing! */ } } - copy_v3_v3(m2->color, m1->color); + copy_v4_v4(m2->color, m1->color); } else { /* Modes that support 'real' mix factor. */ if (mixmode == CDT_MIX_MIX) { @@ -1301,9 +1303,8 @@ static void layerCopyValue_propcol(const void *source, } blend_color_interpolate_float(m2->color, m2->color, tmp_col, mixfactor); - copy_v3_v3(m2->color, m1->color); + copy_v4_v4(m2->color, m1->color); } - m2->color[3] = m1->color[3]; } static bool layerEqual_propcol(const void *data1, const void *data2) |