diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/BLI_pbvh.h | 5 | ||||
-rw-r--r-- | source/blender/blenlib/intern/pbvh.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h index b3e424b5916..92ad2a04224 100644 --- a/source/blender/blenlib/BLI_pbvh.h +++ b/source/blender/blenlib/BLI_pbvh.h @@ -191,6 +191,7 @@ typedef struct PBVHVertexIter { struct MVert *mverts; int totvert; int *vert_indices; + float *vmask; /* result: these are all computed in the macro, but we assume * that compiler optimization's will skip the ones we don't use */ @@ -198,6 +199,7 @@ typedef struct PBVHVertexIter { float *co; short *no; float *fno; + float *mask; } PBVHVertexIter; #ifdef _MSC_VER @@ -228,6 +230,7 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, if(vi.grid) { \ vi.co= CCG_elem_co(vi.key, vi.grid); \ vi.fno= CCG_elem_no(vi.key, vi.grid); \ + vi.mask= CCG_elem_mask(vi.key, vi.grid); \ vi.grid= CCG_elem_next(vi.key, vi.grid); \ if(vi.gh) { \ if(BLI_BITMAP_GET(vi.gh, vi.gy * vi.gridsize + vi.gx)) \ @@ -240,6 +243,8 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, continue; \ vi.co= vi.mvert->co; \ vi.no= vi.mvert->no; \ + if(vi.vmask) \ + vi.mask= &vi.vmask[vi.vert_indices[vi.gx]]; \ } \ #define BLI_pbvh_vertex_iter_end \ diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c index ec6c9d0604c..c157ba7b575 100644 --- a/source/blender/blenlib/intern/pbvh.c +++ b/source/blender/blenlib/intern/pbvh.c @@ -1885,4 +1885,8 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, vi->gh= NULL; if (vi->grids && mode == PBVH_ITER_UNIQUE) vi->grid_hidden= bvh->grid_hidden; + + vi->mask= NULL; + if(!vi->grids) + vi->vmask= CustomData_get_layer(bvh->vdata, CD_PAINT_MASK); } |