diff options
Diffstat (limited to 'source/blender/blenkernel/BKE_pbvh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_pbvh.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h index 8fb6f140822..87875314aec 100644 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@ -58,6 +58,10 @@ typedef struct { float (*co)[3]; } PBVHProxyNode; +typedef struct { + float (*color)[4]; +} PBVHColorBufferNode; + typedef enum { PBVH_Leaf = 1 << 0, @@ -75,6 +79,7 @@ typedef enum { PBVH_FullyUnmasked = 1 << 12, PBVH_UpdateTopology = 1 << 13, + PBVH_UpdateColor = 1 << 14, } PBVHNodeFlags; typedef struct PBVHFrustumPlanes { @@ -252,6 +257,7 @@ bool BKE_pbvh_bmesh_update_topology(PBVH *pbvh, void BKE_pbvh_node_mark_update(PBVHNode *node); void BKE_pbvh_node_mark_update_mask(PBVHNode *node); +void BKE_pbvh_node_mark_update_color(PBVHNode *node); void BKE_pbvh_node_mark_update_visibility(PBVHNode *node); void BKE_pbvh_node_mark_rebuild_draw(PBVHNode *node); void BKE_pbvh_node_mark_redraw(PBVHNode *node); @@ -352,6 +358,7 @@ typedef struct PBVHVertexIter { struct MVert *mverts; int totvert; const int *vert_indices; + struct MPropCol *vcol; float *vmask; /* bmesh */ @@ -368,6 +375,7 @@ typedef struct PBVHVertexIter { short *no; float *fno; float *mask; + float *col; bool visible; } PBVHVertexIter; @@ -419,7 +427,9 @@ void pbvh_vertex_iter_init(PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int m vi.no = vi.mvert->no; \ vi.index = vi.vert_indices[vi.i]; \ if (vi.vmask) \ - vi.mask = &vi.vmask[vi.vert_indices[vi.gx]]; \ + vi.mask = &vi.vmask[vi.index]; \ + if (vi.vcol) \ + vi.col = vi.vcol[vi.index].color; \ } \ else { \ if (!BLI_gsetIterator_done(&vi.bm_unique_verts)) { \ @@ -472,6 +482,9 @@ void BKE_pbvh_parallel_range_settings(struct TaskParallelSettings *settings, struct MVert *BKE_pbvh_get_verts(const PBVH *pbvh); +PBVHColorBufferNode *BKE_pbvh_node_color_buffer_get(PBVHNode *node); +void BKE_pbvh_node_color_buffer_free(PBVH *pbvh); + #ifdef __cplusplus } #endif |