From a769c4a3a02beee982ca45a8ff5d4f711cf5d6fc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 May 2017 19:07:31 +1000 Subject: [PATCH] Fix weight-painting out of facemask mode w/ hidden faces Own error in recent commit --- source/blender/draw/intern/draw_cache_impl_mesh.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index 5ff39878f72..6fbe4222299 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -2894,8 +2894,10 @@ struct Batch *DRW_mesh_batch_cache_get_triangles_with_select_id(struct Mesh *me, cache->triangles_with_select_id = Batch_create( PRIM_TRIANGLES, mesh_batch_cache_get_tri_select_id(rdata, cache, use_hide), NULL); - VertexBuffer *vbo = mesh_batch_cache_get_tri_pos_and_normals_visible_only(rdata, cache); - Batch_add_VertexBuffer(cache->triangles_with_select_id, vbo); + VertexBuffer *vbo_tris = use_hide ? + mesh_batch_cache_get_tri_pos_and_normals_visible_only(rdata, cache) : + mesh_batch_cache_get_tri_pos_and_normals(rdata, cache); + Batch_add_VertexBuffer(cache->triangles_with_select_id, vbo_tris); mesh_render_data_free(rdata); }