Add access to mesh vertex customdata to the PBVH.
This commit is contained in:
parent
aa77bbd38d
commit
f95f558a8c
@ -276,7 +276,7 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
|
||||
BKE_mesh_tessface_ensure(me);
|
||||
|
||||
BLI_pbvh_build_mesh(cddm->pbvh, me->mface, me->mvert,
|
||||
me->totface, me->totvert);
|
||||
me->totface, me->totvert, &me->vdata);
|
||||
|
||||
deformed = ss->modifiers_active || me->key;
|
||||
|
||||
|
@ -2963,7 +2963,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
|
||||
ob->sculpt->pbvh= ccgdm->pbvh = BLI_pbvh_new();
|
||||
BLI_assert(!(me->mface == NULL && me->mpoly != NULL)); /* BMESH ONLY complain if mpoly is valid but not mface */
|
||||
BLI_pbvh_build_mesh(ccgdm->pbvh, me->mface, me->mvert,
|
||||
me->totface, me->totvert);
|
||||
me->totface, me->totvert, &me->vdata);
|
||||
}
|
||||
|
||||
return ccgdm->pbvh;
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
struct CCGElem;
|
||||
struct CCGKey;
|
||||
struct CustomData;
|
||||
struct DMFlagMat;
|
||||
struct DMGridAdjacency;
|
||||
struct ListBase;
|
||||
@ -57,7 +58,7 @@ typedef void (*BLI_pbvh_HitOccludedCallback)(PBVHNode *node, void *data, float*
|
||||
|
||||
PBVH *BLI_pbvh_new(void);
|
||||
void BLI_pbvh_build_mesh(PBVH *bvh, struct MFace *faces, struct MVert *verts,
|
||||
int totface, int totvert);
|
||||
int totface, int totvert, struct CustomData *vdata);
|
||||
void BLI_pbvh_build_grids(PBVH *bvh, struct CCGElem **grid_elems,
|
||||
struct DMGridAdjacency *gridadj, int totgrid,
|
||||
struct CCGKey *key, void **gridfaces, struct DMFlagMat *flagmats,
|
||||
|
@ -136,6 +136,7 @@ struct PBVH {
|
||||
/* Mesh data */
|
||||
MVert *verts;
|
||||
MFace *faces;
|
||||
CustomData *vdata;
|
||||
|
||||
/* Grid Data */
|
||||
CCGKey gridkey;
|
||||
@ -602,7 +603,7 @@ static void pbvh_build(PBVH *bvh, BB *cb, BBC *prim_bbc, int totprim)
|
||||
}
|
||||
|
||||
/* Do a full rebuild with on Mesh data structure */
|
||||
void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int totvert)
|
||||
void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int totvert, struct CustomData *vdata)
|
||||
{
|
||||
BBC *prim_bbc = NULL;
|
||||
BB cb;
|
||||
@ -614,6 +615,7 @@ void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int
|
||||
bvh->vert_bitmap = BLI_BITMAP_NEW(totvert, "bvh->vert_bitmap");
|
||||
bvh->totvert = totvert;
|
||||
bvh->leaf_limit = LEAF_LIMIT;
|
||||
bvh->vdata = vdata;
|
||||
|
||||
BB_reset(&cb);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user