diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-31 18:08:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-31 18:08:29 +0300 |
commit | 7f36fb458cbea8083d3b863da18e1cfb1fc04e1f (patch) | |
tree | 4d9f19950433d55d99fc4c0fbbc5c3056f0fa143 /source/blender/blenkernel/intern | |
parent | fede95aa68774d920478928a02858f96897e1fda (diff) | |
parent | 8a3b548cb2b2c7a05a4d0a1c613f788d38a04e85 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_intern.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 13 |
3 files changed, 3 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 00d6fa96856..99cfb406aea 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -608,11 +608,6 @@ void BKE_pbvh_build_grids(PBVH *bvh, CCGElem **grids, MEM_freeN(prim_bbc); } -void BKE_pbvh_set_ccgdm(PBVH *bvh, CCGDerivedMesh *ccgdm) -{ - bvh->ccgdm = ccgdm; -} - PBVH *BKE_pbvh_new(void) { PBVH *bvh = MEM_callocN(sizeof(PBVH), "pbvh"); @@ -1345,11 +1340,6 @@ void BKE_pbvh_get_grid_key(const PBVH *bvh, CCGKey *key) *key = bvh->gridkey; } -CCGDerivedMesh *BKE_pbvh_get_ccgdm(const PBVH *bvh) -{ - return bvh->ccgdm; -} - BMesh *BKE_pbvh_get_bmesh(PBVH *bvh) { diff --git a/source/blender/blenkernel/intern/pbvh_intern.h b/source/blender/blenkernel/intern/pbvh_intern.h index afd539b2273..4aef97bda47 100644 --- a/source/blender/blenkernel/intern/pbvh_intern.h +++ b/source/blender/blenkernel/intern/pbvh_intern.h @@ -149,8 +149,6 @@ struct PBVH { * objects in sculpt mode with different sizes at the same time, so now storing that common gpu buffer * in an opaque pointer per pbvh. See T47637. */ struct GridCommonGPUBuffer *grid_common_gpu_buffer; - /* The ccgdm is required for CD_ORIGINDEX lookup in vertex paint + multires */ - struct CCGDerivedMesh *ccgdm; /* Only used during BVH build and update, * don't need to remain valid after */ diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 9fda7f585b4..6db306854f4 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -2274,8 +2274,9 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) if (ob->sculpt->pbvh) { /* Note that we have to clean up exisitng pbvh instead of updating it in case it does not match current * grid_pbvh status. */ + const PBVHType pbvh_type = BKE_pbvh_type(ob->sculpt->pbvh); if (grid_pbvh) { - if (BKE_pbvh_get_ccgdm(ob->sculpt->pbvh) != NULL) { + if (pbvh_type == PBVH_GRIDS) { /* pbvh's grids, gridadj and gridfaces points to data inside ccgdm * but this can be freed on ccgdm release, this updates the pointers * when the ccgdm gets remade, the assumption is that the topology @@ -2289,7 +2290,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) ob->sculpt->pbvh = NULL; } } - else if (BKE_pbvh_get_ccgdm(ob->sculpt->pbvh) != NULL) { + else if (pbvh_type == PBVH_GRIDS) { BKE_pbvh_free(ob->sculpt->pbvh); ob->sculpt->pbvh = NULL; } @@ -2298,10 +2299,6 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) } if (ccgdm->pbvh) { - /* For grid pbvh, keep track of ccgdm */ - if (grid_pbvh) { - BKE_pbvh_set_ccgdm(ccgdm->pbvh, ccgdm); - } return ccgdm->pbvh; } @@ -2353,10 +2350,6 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) pbvh_show_mask_set(ccgdm->pbvh, ob->sculpt->show_mask); } - /* For grid pbvh, keep track of ccgdm. */ - if (grid_pbvh && ccgdm->pbvh) { - BKE_pbvh_set_ccgdm(ccgdm->pbvh, ccgdm); - } return ccgdm->pbvh; } |