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/blenkernel/intern/mesh.c | |
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/blenkernel/intern/mesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 253541ea20a..e81c814e3d5 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1942,11 +1942,11 @@ static void bm_corners_to_loops(Mesh *me, int findex, int loopstart, int numTex, mloopcol = CustomData_get_n(&me->ldata, CD_MLOOPCOL, loopstart, i); mcol = CustomData_get_n(&me->fdata, CD_MCOL, findex, i); - mloopcol->r = mcol[0].r; mloopcol->g = mcol[0].g; mloopcol->b = mcol[0].b; mloopcol->a = mcol[0].a; mloopcol++; - mloopcol->r = mcol[1].r; mloopcol->g = mcol[1].g; mloopcol->b = mcol[1].b; mloopcol->a = mcol[1].a; mloopcol++; - mloopcol->r = mcol[2].r; mloopcol->g = mcol[2].g; mloopcol->b = mcol[2].b; mloopcol->a = mcol[2].a; mloopcol++; + MESH_MLOOPCOL_FROM_MCOL(mloopcol, &mcol[0]); mloopcol++; + MESH_MLOOPCOL_FROM_MCOL(mloopcol, &mcol[1]); mloopcol++; + MESH_MLOOPCOL_FROM_MCOL(mloopcol, &mcol[2]); mloopcol++; if (mf->v4) { - mloopcol->r = mcol[3].r; mloopcol->g = mcol[3].g; mloopcol->b = mcol[3].b; mloopcol->a = mcol[3].a; mloopcol++; + MESH_MLOOPCOL_FROM_MCOL(mloopcol, &mcol[3]); mloopcol++; } } @@ -2293,10 +2293,7 @@ void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata, for (j=0; j < mf_len; j++) { mloopcol = CustomData_get_n(ldata, CD_MLOOPCOL, lindex[j], i); - mcol[j].r = mloopcol->r; - mcol[j].g = mloopcol->g; - mcol[j].b = mloopcol->b; - mcol[j].a = mloopcol->a; + MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]); } } @@ -2305,10 +2302,7 @@ void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata, for (j=0; j < mf_len; j++) { mloopcol = CustomData_get(ldata, lindex[j], CD_WEIGHT_MLOOPCOL); - mcol[j].r = mloopcol->r; - mcol[j].g = mloopcol->g; - mcol[j].b = mloopcol->b; - mcol[j].a = mloopcol->a; + MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]); } } |