diff options
author | Miika Hamalainen <blender@miikah.org> | 2011-10-14 01:43:02 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2011-10-14 01:43:02 +0400 |
commit | 8be3249537e7930e0fa5adb59bc343455da309e9 (patch) | |
tree | 0f4f14b046742f4380540e06c529cd417ddbc541 /source/blender/editors/space_view3d/drawmesh.c | |
parent | 8bf78d7f5676520bf6f4241afb88fba506e342f4 (diff) | |
parent | 818c098004ff64adcc0ff24fe29d40850f5591ce (diff) |
Merge with trunk r40991
Diffstat (limited to 'source/blender/editors/space_view3d/drawmesh.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 581105e963c..63b7d0b4353 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -309,16 +309,24 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob) { unsigned char obcol[4]; - int istex, solidtex= 0; + int istex, solidtex; // XXX scene->obedit warning - if(v3d->drawtype==OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype!=OB_TEXTURE)) { + + /* texture draw is abused for mask selection mode, do this so wire draw + * with face selection in weight paint is not lit. */ + if((v3d->drawtype <= OB_WIRE) && (ob->mode & OB_MODE_WEIGHT_PAINT)) { + solidtex= FALSE; + Gtexdraw.islit= 0; + } + else if(v3d->drawtype==OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype!=OB_TEXTURE)) { /* draw with default lights in solid draw mode and edit mode */ - solidtex= 1; + solidtex= TRUE; Gtexdraw.islit= -1; } else { /* draw with lights in the scene otherwise */ + solidtex= FALSE; Gtexdraw.islit= GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp); } @@ -449,9 +457,9 @@ static void add_tface_color_layer(DerivedMesh *dm) } } else if (tface && tface->mode&TF_OBCOL) { for(j=0;j<4;j++) { - finalCol[i*4+j].r = FTOCHAR(Gtexdraw.obcol[0]); + finalCol[i*4+j].b = FTOCHAR(Gtexdraw.obcol[0]); finalCol[i*4+j].g = FTOCHAR(Gtexdraw.obcol[1]); - finalCol[i*4+j].b = FTOCHAR(Gtexdraw.obcol[2]); + finalCol[i*4+j].r = FTOCHAR(Gtexdraw.obcol[2]); } } else if (!mcol) { if (tface) { @@ -470,9 +478,9 @@ static void add_tface_color_layer(DerivedMesh *dm) else copy_v3_v3(col, &ma->r); for(j=0;j<4;j++) { - finalCol[i*4+j].b = FTOCHAR(col[2]); + finalCol[i*4+j].b = FTOCHAR(col[0]); finalCol[i*4+j].g = FTOCHAR(col[1]); - finalCol[i*4+j].r = FTOCHAR(col[0]); + finalCol[i*4+j].r = FTOCHAR(col[2]); } } else @@ -484,9 +492,9 @@ static void add_tface_color_layer(DerivedMesh *dm) } } else { for(j=0;j<4;j++) { - finalCol[i*4+j].b = mcol[i*4+j].r; + finalCol[i*4+j].r = mcol[i*4+j].r; finalCol[i*4+j].g = mcol[i*4+j].g; - finalCol[i*4+j].r = mcol[i*4+j].b; + finalCol[i*4+j].b = mcol[i*4+j].b; } } } |