Fix T45954: Inset w/ interpolated vertex color

Accumulating ubyte color was overflowing.

Thanks to @mont29 for suggested fix.
This commit is contained in:
Campbell Barton 2015-09-01 02:48:28 +10:00
parent 879c5d4568
commit 705776db1f
Notes: blender-bot 2023-02-14 08:45:12 +01:00
Referenced by issue #45954, Inset: VCol not correctly initiated for new vertices
1 changed files with 3 additions and 10 deletions

View File

@ -208,18 +208,11 @@ static void bm_loop_customdata_merge(
*/
const void *data_src;
CustomData_data_add(
CustomData_data_mix_value(
type,
BM_ELEM_CD_GET_VOID_P(l_a_inner_inset, offset),
BM_ELEM_CD_GET_VOID_P(l_b_inner_inset, offset));
CustomData_data_multiply(
type,
BM_ELEM_CD_GET_VOID_P(l_a_inner_inset, offset),
0.5f);
CustomData_data_copy_value(
type,
BM_ELEM_CD_GET_VOID_P(l_a_inner_inset, offset),
BM_ELEM_CD_GET_VOID_P(l_b_inner_inset, offset));
BM_ELEM_CD_GET_VOID_P(l_b_inner_inset, offset),
CDT_MIX_MIX, 0.5f);
/* use this as a reference (could be 'l_b_inner_inset' too) */
data_src = BM_ELEM_CD_GET_VOID_P(l_a_inner_inset, offset);