[Bf-blender-cvs] [711a5c7] master: Don't use vertex colors in textured mesh display during texpaint.

Antony Riakiotakis noreply at git.blender.org
Fri Apr 10 13:05:44 CEST 2015


Commit: 711a5c79d8c4105dc0ccf771b79d66c79ee3c570
Author: Antony Riakiotakis
Date:   Fri Apr 10 13:05:17 2015 +0200
Branches: master
https://developer.blender.org/rB711a5c79d8c4105dc0ccf771b79d66c79ee3c570

Don't use vertex colors in textured mesh display during texpaint.

Wasn't that irritating?

===================================================================

M	source/blender/editors/space_view3d/drawmesh.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 755c633..b1f8d11 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -588,15 +588,19 @@ static DMDrawOption draw_tface__set_draw(MTFace *tface, const bool UNUSED(has_mc
 	return DM_DRAW_OPTION_NORMAL;
 }
 
-static void update_tface_color_layer(DerivedMesh *dm)
+static void update_tface_color_layer(DerivedMesh *dm, bool use_mcol)
 {
 	MTFace *tface = DM_get_tessface_data_layer(dm, CD_MTFACE);
 	MFace *mface = dm->getTessFaceArray(dm);
 	MCol *finalCol;
 	int i, j;
-	MCol *mcol = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
-	if (!mcol)
-		mcol = dm->getTessFaceDataArray(dm, CD_MCOL);
+	MCol *mcol = NULL;
+
+	if (use_mcol) {
+		mcol = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
+		if (!mcol)
+			mcol = dm->getTessFaceDataArray(dm, CD_MCOL);
+	}
 
 	if (CustomData_has_layer(&dm->faceData, CD_TEXTURE_MCOL)) {
 		finalCol = CustomData_get_layer(&dm->faceData, CD_TEXTURE_MCOL);
@@ -937,7 +941,7 @@ static void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d
 	else {		
 		drawTFace_userData userData;
 		
-		update_tface_color_layer(dm);
+		update_tface_color_layer(dm, !(ob->mode & OB_MODE_TEXTURE_PAINT));
 		
 		userData.mf = DM_get_tessface_data_layer(dm, CD_MFACE);
 		userData.tf = DM_get_tessface_data_layer(dm, CD_MTFACE);




More information about the Bf-blender-cvs mailing list