Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-08-31 18:08:29 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-08-31 18:08:29 +0300
commit7f36fb458cbea8083d3b863da18e1cfb1fc04e1f (patch)
tree4d9f19950433d55d99fc4c0fbbc5c3056f0fa143 /source/blender/blenkernel/intern/subsurf_ccg.c
parentfede95aa68774d920478928a02858f96897e1fda (diff)
parent8a3b548cb2b2c7a05a4d0a1c613f788d38a04e85 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c')
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c13
1 files changed, 3 insertions, 10 deletions
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;
}