From b0c0626cb0791c8819c9ba66d56ff8314527ee98 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Mar 2012 23:26:25 +0000 Subject: fix for weightpaint color with recent loopcolor abgr --> rgba conversion. --- source/blender/blenkernel/intern/DerivedMesh.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index c36660a3ab8..7d5a6118100 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -917,13 +917,15 @@ static void weightpaint_color(unsigned char r_col[4], ColorBand *coba, const flo { float colf[4]; - if(coba) do_colorband(coba, input, colf); - else weight_to_rgb(colf, input); + if(coba) { + do_colorband(coba, input, colf); + } + else { + weight_to_rgb(colf, input); + } - r_col[3] = (unsigned char)(colf[0] * 255.0f); - r_col[2] = (unsigned char)(colf[1] * 255.0f); - r_col[1] = (unsigned char)(colf[2] * 255.0f); - r_col[0] = 255; + rgb_float_to_uchar(r_col, colf); + r_col[3] = 255; /* really redundant */ } -- cgit v1.2.3