[Bf-blender-cvs] [b7b5c99] blender-v2.73-release: Fix T43099: Modifiers in edit mode might mess up materials

Sergey Sharybin noreply at git.blender.org
Tue Jan 6 10:44:58 CET 2015

Commit: b7b5c99215f08f84b148b14202a42d56a86fa5fc
Author: Sergey Sharybin
Date:   Fri Jan 2 14:23:54 2015 +0500
Branches: blender-v2.73-release

Fix T43099: Modifiers in edit mode might mess up materials

The issue was originall caused by 2e8ba17 by removing necessery call
GPU_enable_material(). It was probably removed because in some cases
material was enabled after calling setDrawOptions.

That wasn't always a case for edit mode.

This is absolutely to be included to 2.73


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


diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 68fc6e6..9168954 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -527,6 +527,7 @@ static void emDM_drawMappedFaces(DerivedMesh *dm,
 			               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