diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-08-31 19:48:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-08-31 19:51:30 +0300 |
commit | 705776db1fbaa5a7563d7efae89f0c984afdea6d (patch) | |
tree | 5b854cafe808c6ce00265a5cad3284f6db1525fa | |
parent | 879c5d4568ee6651d73ae3b31541f5ed17b9f0a1 (diff) |
Fix T45954: Inset w/ interpolated vertex color
Accumulating ubyte color was overflowing.
Thanks to @mont29 for suggested fix.
-rw-r--r-- | source/blender/bmesh/operators/bmo_inset.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c index 6664bf6dc46..f55a62e9f1a 100644 --- a/source/blender/bmesh/operators/bmo_inset.c +++ b/source/blender/bmesh/operators/bmo_inset.c @@ -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); |