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
This commit is contained in:
Sergey Sharybin 2015-01-02 14:23:54 +05:00
parent 84dde30662
commit b7b5c99215
Notes: blender-bot 2023-02-14 09:40:10 +01:00
Referenced by issue #43099, Modifier "Armature" change the material in a mesh when active or desactive "Show in edit mode" if is in "mode edit"
1 changed files with 1 additions and 0 deletions

View File

@ -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();