[Bf-blender-cvs] [c9675b4] master: Material not set in edit derived meshes after last material modification commits.

Antony Riakiotakis noreply at git.blender.org
Fri Nov 28 14:30:09 CET 2014


Commit: c9675b460e7478bfb67d53f7753fda2f50be8ae3
Author: Antony Riakiotakis
Date:   Fri Nov 28 14:29:56 2014 +0100
Branches: master
https://developer.blender.org/rBc9675b460e7478bfb67d53f7753fda2f50be8ae3

Material not set in edit derived meshes after last material modification
commits.

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

M	source/blender/blenkernel/intern/editderivedmesh.c

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

diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index aa82ab5..559eefc 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -56,6 +56,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "GPU_extensions.h"
+#include "GPU_draw.h"
 #include "GPU_glew.h"
 
 extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */
@@ -607,13 +608,17 @@ static void emDM_drawMappedFaces(DerivedMesh *dm,
 			int drawSmooth;
 
 			efa = ltri[0]->f;
-			drawSmooth = lnors || ((flag & DM_DRAW_ALWAYS_SMOOTH) ? 1 : BM_elem_flag_test(efa, BM_ELEM_SMOOTH));
-
+			drawSmooth = lnors || ((flag & DM_DRAW_ALWAYS_SMOOTH) ? 1 : BM_elem_flag_test(efa, BM_ELEM_SMOOTH));			
+			
 			draw_option = (!setDrawOptions ?
 			               DM_DRAW_OPTION_NORMAL :
 			               setDrawOptions(userData, BM_elem_index_get(efa)));
+
 			if (draw_option != DM_DRAW_OPTION_SKIP) {
 				const GLenum poly_type = GL_TRIANGLES; /* BMESH NOTE, this is odd but keep it for now to match trunk */
+
+				GPU_enable_material(efa->mat_nr + 1, NULL);
+				
 				if (draw_option == DM_DRAW_OPTION_STIPPLE) { /* enabled with stipple */
 
 					if (poly_prev != GL_ZERO) glEnd();




More information about the Bf-blender-cvs mailing list