diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-27 15:44:45 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-27 15:59:41 +0300 |
commit | 770e91703d1196751432ef4a2db5ca7afed02aee (patch) | |
tree | 893865b32f87ccd1d6c04b442bd8c9bccad93ea2 /source/blender/editors/sculpt_paint/paint_mask.c | |
parent | d3a98b2c3b44244bff3b0386f33a277286b26f59 (diff) |
Fix part of T70295: sculpt drawing not clipping PBVH behind the camera
Use all 6 clipping planes for drawing.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_mask.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_mask.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index 3a8ea3c296c..52514fa8922 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -314,8 +314,10 @@ bool ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti * flip_plane(clip_planes_final[j], clip_planes[j], symmpass); } - BKE_pbvh_search_gather( - pbvh, BKE_pbvh_node_planes_contain_AABB, clip_planes_final, &nodes, &totnode); + PBVHFrustumPlanes frustum = {.planes = clip_planes_final, .num_planes = 4}; + BKE_pbvh_search_gather(pbvh, BKE_pbvh_node_frustum_contain_AABB, &frustum, &nodes, &totnode); + + negate_m4(clip_planes_final); MaskTaskData data = { .ob = ob, @@ -482,7 +484,6 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op) &data); ED_view3d_clipping_calc(&bb, clip_planes, vc.ar, vc.obact, &data.rect); - negate_m4(clip_planes); BKE_sculpt_update_object_for_edit(depsgraph, ob, false, true); pbvh = ob->sculpt->pbvh; @@ -504,8 +505,11 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op) /* gather nodes inside lasso's enclosing rectangle * (should greatly help with bigger meshes) */ + PBVHFrustumPlanes frustum = {.planes = clip_planes_final, .num_planes = 4}; BKE_pbvh_search_gather( - pbvh, BKE_pbvh_node_planes_contain_AABB, clip_planes_final, &nodes, &totnode); + pbvh, BKE_pbvh_node_frustum_contain_AABB, &frustum, &nodes, &totnode); + + negate_m4(clip_planes_final); data.task_data.ob = ob; data.task_data.pbvh = pbvh; |