diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-17 22:39:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-17 22:39:01 +0300 |
commit | 7b30e2386bea9a085f91e5454a5cc3a451d0b249 (patch) | |
tree | ee4b8c8961fff891839c055aa430f310dabaf1c4 /source/blender/editors/space_view3d | |
parent | b45749727ccc70f6155f7acfd4f7acc2c242d277 (diff) |
Only use material callback when enabled
Vert/Face select in painting modes weren't drawing after recent changes.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 9ccacbad4a2..757eecfe1db 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -1236,17 +1236,18 @@ void draw_mesh_paint_vcolor_faces(DerivedMesh *dm, const bool use_light, void *facemask_cb, void *user_data, const Mesh *me) { + DMSetMaterial setMaterial = GPU_object_materials_check() ? GPU_enable_material : NULL; + if (use_light) { draw_mesh_paint_light_begin(); } if (me->mloopcol) { - dm->drawMappedFaces(dm, facemask_cb, GPU_enable_material, NULL, user_data, - DM_DRAW_USE_COLORS); + dm->drawMappedFaces(dm, facemask_cb, setMaterial, NULL, user_data, DM_DRAW_USE_COLORS); } else { glColor3f(1.0f, 1.0f, 1.0f); - dm->drawMappedFaces(dm, facemask_cb, GPU_enable_material, NULL, user_data, 0); + dm->drawMappedFaces(dm, facemask_cb, setMaterial, NULL, user_data, 0); } if (use_light) { |