diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-18 00:39:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-18 00:39:28 +0400 |
commit | 91580c0929f96562895d262d621745956c3ad35e (patch) | |
tree | 7338f08f832189bca3b98e8e6308a0115b475de5 /source/blender/python/bmesh | |
parent | 8b7ea6fc90c43a7d2b04a5ced81614776bbba77c (diff) |
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).
Diffstat (limited to 'source/blender/python/bmesh')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types_meshdata.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c index 0a45a4688c8..e9841301201 100644 --- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c @@ -150,16 +150,12 @@ PyObject *BPy_BMLoopUV_CreatePyObject(struct MLoopUV *mloopuv) static void mloopcol_to_float(const MLoopCol *mloopcol, float col_r[3]) { - col_r[0] = ((float)mloopcol->b) / 255.0f; - col_r[1] = ((float)mloopcol->g) / 255.0f; - col_r[2] = ((float)mloopcol->r) / 255.0f; + rgb_uchar_to_float(col_r, (unsigned char *)&mloopcol->r); } static void mloopcol_from_float(MLoopCol *mloopcol, const float col[3]) { - mloopcol->b = FTOCHAR(col[0]); - mloopcol->g = FTOCHAR(col[1]); - mloopcol->r = FTOCHAR(col[2]); + rgb_float_to_uchar((unsigned char *)&mloopcol->r, col); } static unsigned char mathutils_bmloopcol_cb_index = -1; |