From c9675b460e7478bfb67d53f7753fda2f50be8ae3 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Fri, 28 Nov 2014 14:29:56 +0100 Subject: [PATCH] Material not set in edit derived meshes after last material modification commits. --- source/blender/blenkernel/intern/editderivedmesh.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index aa82ab57a1a..559eefc834e 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();