From 3e86bb2d0bf1b13b4e482411dd176bac13e90961 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 8 Jun 2018 17:04:54 +0200 Subject: Sculpt/Paint: move PBVH building to use evaluated mesh instead of deprecated Derivedmesh. Pretty straightforward changes, merely mimicking dm-related code, which was already essentially using either Mesh or BMesh data to build the PBVH... Note that we "lose" the subsurf (a.k.a. grid) PBVH case here, but that one was already dead code in current blender2.8, since final dm is always a cddm built from evaluated mesh. Proper fix is pending new code for subsurf/multires area. --- source/blender/editors/sculpt_paint/paint_hide.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/sculpt_paint/paint_hide.c') diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c index b8bee42e53d..ac5b0624d56 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.c +++ b/source/blender/editors/sculpt_paint/paint_hide.c @@ -369,7 +369,6 @@ static int hide_show_exec(bContext *C, wmOperator *op) PartialVisArea area; PBVH *pbvh; PBVHNode **nodes; - DerivedMesh *dm; PBVHType pbvh_type; float clip_planes[4][4]; rcti rect; @@ -382,9 +381,9 @@ static int hide_show_exec(bContext *C, wmOperator *op) clip_planes_from_rect(C, clip_planes, &rect); - dm = mesh_get_derived_final(depsgraph, 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); -- cgit v1.2.3