diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-08-16 03:01:17 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-08-16 03:01:17 +0300 |
commit | 7f3eb055dd0c708cb775332115be37dec0075e43 (patch) | |
tree | d488fee1138598198d386bd90181498d15e6beb4 /source/blender/blenkernel/intern/pbvh.c | |
parent | c5feb4e6fe27f013cc17b841729fb6c5097b4848 (diff) |
Sculpt: Improve sculpt debug draw
* Fixed crash in debug draw code. Apparently this is
only used by PBVH draw?
* Debug draw code can now be forcibly enabled in release
mode (i.e. RelWithDebugInfo) by uncommenting a commented
out #define.
* Fixed colors in debug draw mode.
* PBVH node boxes in debug mode now flash a different color
when they are updated.
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 4e6418942be..d7fa2ca8e32 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -1330,6 +1330,8 @@ static void pbvh_update_draw_buffer_cb(void *__restrict userdata, } if (node->flag & PBVH_UpdateDrawBuffers) { + node->debug_draw_gen++; + const int update_flags = pbvh_get_buffers_update_flags(pbvh); switch (pbvh->header.type) { case PBVH_GRIDS: @@ -2899,13 +2901,13 @@ void BKE_pbvh_draw_cb(PBVH *pbvh, void BKE_pbvh_draw_debug_cb( PBVH *pbvh, - void (*draw_fn)(void *user_data, const float bmin[3], const float bmax[3], PBVHNodeFlags flag), + void (*draw_fn)(PBVHNode *node, void *user_data, const float bmin[3], const float bmax[3], PBVHNodeFlags flag), void *user_data) { for (int a = 0; a < pbvh->totnode; a++) { PBVHNode *node = &pbvh->nodes[a]; - draw_fn(user_data, node->vb.bmin, node->vb.bmax, node->flag); + draw_fn(node, user_data, node->vb.bmin, node->vb.bmax, node->flag); } } @@ -3330,3 +3332,8 @@ void BKE_pbvh_ensure_node_loops(PBVH *pbvh) MEM_SAFE_FREE(visit); } + +int BKE_pbvh_debug_draw_gen_get(PBVHNode *node) +{ + return node->debug_draw_gen; +} |