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:
authorCampbell Barton <ideasman42@gmail.com>2016-05-13 15:03:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-05-13 15:16:14 +0300
commit6276726bc4594f61753e51b8e877cf3c5018c808 (patch)
treeadaaaab329bfd0056197eeda5d48b73f0533dc7a
parent029ccca0feb2d74180aa7693f9118b781bad29a7 (diff)
Fix T47652: Texture shading mode fails to update material colors
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 345e47940d5..a73a055c5c8 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -713,6 +713,8 @@ static void update_tface_color_layer(DerivedMesh *dm, bool use_mcol)
}
}
}
+
+ dm->dirty |= DM_DIRTY_MCOL_UPDATE_DRAW;
}
static DMDrawOption draw_tface_mapped__set_draw(void *userData, int origindex, int UNUSED(mat_nr))
@@ -999,7 +1001,16 @@ static void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d
else {
userData.me = NULL;
- update_tface_color_layer(dm, !(ob->mode & OB_MODE_TEXTURE_PAINT));
+ if ((ob->mode & OB_MODE_ALL_PAINT) == 0) {
+
+ /* Note: this isn't efficient and runs on every redraw,
+ * its needed so material colors are used for vertex colors.
+ * In the future we will likely remove 'texface' so, just avoid running this where possible,
+ * (when vertex paint or weight paint are used). */
+
+ update_tface_color_layer(dm, !(ob->mode & OB_MODE_TEXTURE_PAINT));
+ }
+
dm->drawFacesTex(
dm, draw_tface__set_draw, compareDrawOptions,
&userData, dm_draw_flag);