diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-04-15 21:14:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-04-15 21:32:16 +0300 |
commit | 6675fd6b52554cf4ed63d5a740dfe60525cf1f3a (patch) | |
tree | bef9182349afb714136bdb2ebb55aef65df07d5c /source/blender/blenkernel/intern/pbvh.c | |
parent | 7f4b6a345e59bd4b05c8cab08d0c618eea9f827d (diff) |
dyntopo: don't allocate tessfaces while sculpting
Tessellation data isn't used for drawing or sculpting.
This frees up some memory ~approx 10% in own tests.
Also slight spee-up since it avoids calculating it in the first place.
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index c9e632b7295..e12d685fb67 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -943,6 +943,7 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes, int n; if (bvh->type == PBVH_BMESH) { + BLI_assert(face_nors == NULL); pbvh_bmesh_normals_update(nodes, totnode); return; } @@ -1280,6 +1281,16 @@ PBVHType BKE_pbvh_type(const PBVH *bvh) return bvh->type; } +bool BKE_pbvh_has_faces(const PBVH *bvh) +{ + if (bvh->type == PBVH_BMESH) { + return (bvh->bm->totface != 0); + } + else { + return (bvh->totprim != 0); + } +} + void BKE_pbvh_bounding_box(const PBVH *bvh, float min[3], float max[3]) { if (bvh->totnode) { |