From 91580c0929f96562895d262d621745956c3ad35e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Mar 2012 20:39:28 +0000 Subject: swap BMLoopCol r/b color, requires subversion bump. old mesh MCol 'r' was blue, 'b' was red, but theres no reason to keep this for bmesh with MLoopCol. Loading old files works, saving legacy format works too. What wont work is loading a file after this revision and loading it in an older revision since the bmesh merge. (it wont crash but the blue and red will be swapped on vertex color layers). --- source/blender/makesrna/intern/rna_mesh.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index ec56004f253..f7dee561250 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -432,18 +432,18 @@ static void rna_MeshLoopColor_color_get(PointerRNA *ptr, float *values) { MLoopCol *mcol = (MLoopCol *)ptr->data; - values[2] = (&mcol->r)[0]/255.0f; - values[1] = (&mcol->r)[1]/255.0f; - values[0] = (&mcol->r)[2]/255.0f; + values[0] = (&mcol->r)[0] / 255.0f; + values[1] = (&mcol->r)[1] / 255.0f; + values[2] = (&mcol->r)[2] / 255.0f; } static void rna_MeshLoopColor_color_set(PointerRNA *ptr, const float *values) { MLoopCol *mcol = (MLoopCol *)ptr->data; - (&mcol->r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255)); - (&mcol->r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255)); - (&mcol->r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255)); + (&mcol->r)[0] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255)); + (&mcol->r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255)); + (&mcol->r)[2] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255)); } static int rna_Mesh_texspace_editable(PointerRNA *ptr) -- cgit v1.2.3