Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-07-16 19:58:29 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-07-16 19:58:29 +0400
commit951694e7c493e7398e5cf44d2c729709b75626f9 (patch)
treec8f2e554ebd4e6d4f61ba099dcfde30fb512e7d2
parentd6442d9881292e6c33c67317b9dfa7cc48516376 (diff)
Fix issue with multiple materials not displaying colors correctly.
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index c34aefe31a2..348e6e526fe 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -220,7 +220,8 @@ static struct TextureDrawState {
bool use_backface_culling;
unsigned char obcol[4];
float stencil_col[4];
-} Gtexdraw = {NULL, NULL, false, false, 0, 0, 0, false, {0, 0, 0, 0}, {0.0f, 0.0f, 0.0f, 1.0f}};
+ bool is_texpaint;
+} Gtexdraw = {NULL, NULL, false, false, 0, 0, 0, false, {0, 0, 0, 0}, {0.0f, 0.0f, 0.0f, 1.0f}, false};
static bool set_draw_settings_cached(int clearcache, MTFace *texface, Material *ma, struct TextureDrawState gtexdraw)
{
@@ -389,11 +390,12 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O
Gtexdraw.ob = ob;
Gtexdraw.stencil = (imapaint->flag & IMAGEPAINT_PROJECT_LAYER_STENCIL) ? imapaint->stencil : NULL;
Gtexdraw.stencil_invert = ((imapaint->flag & IMAGEPAINT_PROJECT_LAYER_STENCIL_INV) != 0);
+ Gtexdraw.is_texpaint = (ob->mode == OB_MODE_TEXTURE_PAINT);
copy_v3_v3(Gtexdraw.stencil_col, imapaint->stencil_col);
Gtexdraw.is_tex = is_tex;
/* load the stencil texture here */
- if ((ob->mode == OB_MODE_TEXTURE_PAINT) && (Gtexdraw.stencil != NULL)) {
+ if (Gtexdraw.is_texpaint && (Gtexdraw.stencil != NULL)) {
glActiveTexture(GL_TEXTURE1);
if (GPU_verify_image(Gtexdraw.stencil, NULL, false, false, false, false)) {
glEnable(GL_TEXTURE_2D);
@@ -520,7 +522,7 @@ static DMDrawOption draw_tface__set_draw(MTFace *tface, const bool UNUSED(has_mc
if (ma && (ma->game.flag & GEMAT_INVISIBLE)) return 0;
- if (tface)
+ if (tface || Gtexdraw.is_texpaint)
set_draw_settings_cached(0, tface, ma, Gtexdraw);
/* always use color from mcol, as set in update_tface_color_layer */