From d95bb087d0346164ab35df003ed8c4a27088e9eb Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Wed, 9 Oct 2019 19:03:57 +0200 Subject: Sculpt: Fix wireframe drawing With this commit sculpt mode draws the real mesh wireframe instead of the triangulated version by ignoring non real edges when building the PBVH GPU buffers Reviewed By: brecht Differential Revision: https://developer.blender.org/D6032 --- source/blender/blenkernel/intern/pbvh.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/pbvh.c') diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 8549ad1f7f0..4e193e35109 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -27,6 +27,7 @@ #include "BLI_ghash.h" #include "BLI_task.h" +#include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "BKE_pbvh.h" @@ -533,6 +534,7 @@ static void pbvh_build(PBVH *bvh, BB *cb, BBC *prim_bbc, int totprim) * (which means it may rewrite it if needed, see #BKE_pbvh_vert_coords_apply(). */ void BKE_pbvh_build_mesh(PBVH *bvh, + const Mesh *mesh, const MPoly *mpoly, const MLoop *mloop, MVert *verts, @@ -545,6 +547,7 @@ void BKE_pbvh_build_mesh(PBVH *bvh, BBC *prim_bbc = NULL; BB cb; + bvh->mesh = mesh; bvh->type = PBVH_FACES; bvh->mpoly = mpoly; bvh->mloop = mloop; @@ -1222,7 +1225,8 @@ static void pbvh_update_draw_buffer_cb(void *__restrict userdata, bvh->looptri, bvh->verts, node->prim_indices, - node->totprim); + node->totprim, + bvh->mesh); break; case PBVH_BMESH: node->draw_buffers = GPU_pbvh_bmesh_buffers_build(bvh->flags & -- cgit v1.2.3