diff options
Diffstat (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c')
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 445fc23b069..2ad17b7d0b9 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1240,13 +1240,15 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes) MEM_freeN(faces); } - /* should be per face */ - if(faceFlags && faceFlags[0] & ME_SMOOTH) - glShadeModel(GL_SMOOTH); + if(dm->numFaceData) { + /* should be per face */ + if(!setMaterial(faceFlags[1], NULL)) + return; - BLI_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL); - - glShadeModel(GL_FLAT); + glShadeModel((faceFlags[0] & ME_SMOOTH)? GL_SMOOTH: GL_FLAT); + BLI_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL); + glShadeModel(GL_FLAT); + } return; } |