Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2019-08-14 23:54:23 +0300
committerPablo Dobarro <pablodp606@gmail.com>2019-08-14 23:59:31 +0300
commit037cf920b42d9b3404687235c524516e50a31561 (patch)
tree52a9bf3fe2f54ae356724acc0730539f15fb6fc1 /source/blender/blenkernel/BKE_pbvh.h
parent5489611e53176ad4c1d5ac626db6377b27624cce (diff)
Sculpt: mesh abstraction API
These functions make possible porting the tools from the sculpt branch, making them compatible with PBVH_FACES and PBVH_BMESH without duplicating the code. They can also help to simplify some existing code. These functions should not be used when working with PBVH_GRIDS data in SculptSession. PBVH_GRIDS needs to be removed from the sculpt code and converted to PBVH_FACES to be compatible with this API. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5352
Diffstat (limited to 'source/blender/blenkernel/BKE_pbvh.h')
-rw-r--r--source/blender/blenkernel/BKE_pbvh.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index 3806868e060..62544efad2c 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -301,6 +301,7 @@ typedef struct PBVHVertexIter {
int gx;
int gy;
int i;
+ int index;
/* grid */
struct CCGElem **grids;
@@ -369,6 +370,7 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, PBVHVertexIter *vi, int mo
continue; \
vi.co = vi.mvert->co; \
vi.no = vi.mvert->no; \
+ vi.index = vi.vert_indices[vi.i]; \
if (vi.vmask) \
vi.mask = &vi.vmask[vi.vert_indices[vi.gx]]; \
} \
@@ -385,6 +387,7 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, PBVHVertexIter *vi, int mo
continue; \
vi.co = vi.bm_vert->co; \
vi.fno = vi.bm_vert->no; \
+ vi.index = BM_elem_index_get(vi.bm_vert); \
vi.mask = BM_ELEM_CD_GET_VOID_P(vi.bm_vert, vi.cd_vert_mask_offset); \
}