diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_hide.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_hide.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c index 0bec71f0566..4deec54a5b3 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.c +++ b/source/blender/editors/sculpt_paint/paint_hide.c @@ -46,13 +46,13 @@ #include "BKE_pbvh.h" #include "BKE_ccg.h" #include "BKE_context.h" -#include "BKE_DerivedMesh.h" #include "BKE_mesh.h" +#include "BKE_mesh_runtime.h" #include "BKE_multires.h" #include "BKE_paint.h" #include "BKE_subsurf.h" -#include "BIF_glutil.h" +#include "DEG_depsgraph.h" #include "WM_api.h" #include "WM_types.h" @@ -323,12 +323,10 @@ static void clip_planes_from_rect(bContext *C, { ViewContext vc; BoundBox bb; - bglMats mats = {{0}}; view3d_operator_needs_opengl(C); ED_view3d_viewcontext_init(C, &vc); - view3d_get_transformation(vc.ar, vc.rv3d, vc.obact, &mats); - ED_view3d_clipping_calc(&bb, clip_planes, &mats, rect); + ED_view3d_clipping_calc(&bb, clip_planes, vc.ar, vc.obact, rect); negate_m4(clip_planes); } @@ -364,12 +362,12 @@ static int hide_show_exec(bContext *C, wmOperator *op) { ARegion *ar = CTX_wm_region(C); Object *ob = CTX_data_active_object(C); + Depsgraph *depsgraph = CTX_data_depsgraph(C); Mesh *me = ob->data; PartialVisAction action; PartialVisArea area; PBVH *pbvh; PBVHNode **nodes; - DerivedMesh *dm; PBVHType pbvh_type; float clip_planes[4][4]; rcti rect; @@ -382,9 +380,9 @@ static int hide_show_exec(bContext *C, wmOperator *op) clip_planes_from_rect(C, clip_planes, &rect); - dm = mesh_get_derived_final(CTX_data_scene(C), ob, CD_MASK_BAREMESH); - pbvh = dm->getPBVH(ob, dm); - ob->sculpt->pbvh = pbvh; + Mesh *me_eval_deform = mesh_get_eval_deform(depsgraph, CTX_data_scene(C), ob, CD_MASK_BAREMESH); + pbvh = BKE_sculpt_object_pbvh_ensure(ob, me_eval_deform); + BLI_assert(ob->sculpt->pbvh == pbvh); get_pbvh_nodes(pbvh, &nodes, &totnode, clip_planes, area); pbvh_type = BKE_pbvh_type(pbvh); |