diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-08 20:26:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-08 20:26:36 +0300 |
commit | 305c455ffe36161baeb9495942808ddb7ac486bb (patch) | |
tree | 86201d85dc166cacee1eb137f73c9a30829ad971 /source | |
parent | 65ae4e27b03ca0f386bf312980046193f105e5f3 (diff) |
Cleanup: mesh_runtime naming
- BKE_mesh_get_looptri_num -> BKE_mesh_runtime_looptri_len
- BKE_mesh_runtime_recalc_looptri -> BKE_mesh_runtime_looptri_recalc
- BKE_mesh_get_looptri_array -> BKE_mesh_runtime_looptri_ensure
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/bvhutils.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_runtime.c | 16 | ||||
-rw-r--r-- | source/blender/editors/armature/meshlaplacian.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index ecfc986215b..a170a2a32eb 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -193,9 +193,9 @@ void BKE_mesh_apply_vert_coords(struct Mesh *mesh, float (*vertCoords)[3]); /* *** mesh_runtime.c *** */ -void BKE_mesh_runtime_recalc_looptri(struct Mesh *mesh); -int BKE_mesh_get_looptri_num(struct Mesh *mesh); -const struct MLoopTri *BKE_mesh_get_looptri_array(struct Mesh *mesh); +int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh); +void BKE_mesh_runtime_looptri_recalc(struct Mesh *mesh); +const struct MLoopTri *BKE_mesh_runtime_looptri_ensure(struct Mesh *mesh); /* *** mesh_evaluate.c *** */ diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 00aa89b3776..5c2d81f5841 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -1184,14 +1184,14 @@ BVHTree *BKE_bvhtree_from_mesh_looptri( mvert = mesh->mvert; mloop = mesh->mloop; - looptri = BKE_mesh_get_looptri_array(mesh); + looptri = BKE_mesh_runtime_looptri_ensure(mesh); /* Not in cache */ if (tree == NULL) { BLI_rw_mutex_lock(&cache_rwlock, THREAD_LOCK_WRITE); tree = bvhcache_find(mesh->runtime.bvh_cache, BVHTREE_FROM_LOOPTRI); if (tree == NULL) { - int looptri_num = BKE_mesh_get_looptri_num(mesh); + int looptri_num = BKE_mesh_runtime_looptri_len(mesh); /* this assert checks we have looptris, * if not caller should use DM_ensure_looptri() */ diff --git a/source/blender/blenkernel/intern/mesh_runtime.c b/source/blender/blenkernel/intern/mesh_runtime.c index 02caf454b7e..96fc472ac8f 100644 --- a/source/blender/blenkernel/intern/mesh_runtime.c +++ b/source/blender/blenkernel/intern/mesh_runtime.c @@ -80,7 +80,7 @@ static void mesh_ensure_looptri_data(Mesh *mesh) } /* This is a ported copy of CDDM_recalc_looptri(dm). */ -void BKE_mesh_runtime_recalc_looptri(Mesh *mesh) +void BKE_mesh_runtime_looptri_recalc(Mesh *mesh) { mesh_ensure_looptri_data(mesh); BLI_assert(mesh->totpoly == 0 || mesh->runtime.looptris.array_wip != NULL); @@ -97,15 +97,15 @@ void BKE_mesh_runtime_recalc_looptri(Mesh *mesh) } /* This is a ported copy of dm_getNumLoopTri(dm). */ -int BKE_mesh_get_looptri_num(Mesh *mesh) +int BKE_mesh_runtime_looptri_len(const Mesh *mesh) { - const int numlooptris = poly_to_tri_count(mesh->totpoly, mesh->totloop); - BLI_assert(ELEM(mesh->runtime.looptris.num, 0, numlooptris)); - return numlooptris; + const int looptri_len = poly_to_tri_count(mesh->totpoly, mesh->totloop); + BLI_assert(ELEM(mesh->runtime.looptris.num, 0, looptri_len)); + return looptri_len; } /* This is a ported copy of dm_getLoopTriArray(dm). */ -const MLoopTri *BKE_mesh_get_looptri_array(Mesh *mesh) +const MLoopTri *BKE_mesh_runtime_looptri_ensure(Mesh *mesh) { MLoopTri *looptri; @@ -114,14 +114,14 @@ const MLoopTri *BKE_mesh_get_looptri_array(Mesh *mesh) BLI_rw_mutex_unlock(&loops_cache_lock); if (looptri != NULL) { - BLI_assert(BKE_mesh_get_looptri_num(mesh) == mesh->runtime.looptris.num); + BLI_assert(BKE_mesh_runtime_looptri_len(mesh) == mesh->runtime.looptris.num); } else { BLI_rw_mutex_lock(&loops_cache_lock, THREAD_LOCK_WRITE); /* We need to ensure array is still NULL inside mutex-protected code, some other thread might have already * recomputed those looptris. */ if (mesh->runtime.looptris.array == NULL) { - BKE_mesh_runtime_recalc_looptri(mesh); + BKE_mesh_runtime_looptri_recalc(mesh); } looptri = mesh->runtime.looptris.array; BLI_rw_mutex_unlock(&loops_cache_lock); diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 5503a4880df..31f31460dfe 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1463,7 +1463,7 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa Mesh *me = mdb->cagemesh; mdb->cagemesh_cache.mpoly = me->mpoly; mdb->cagemesh_cache.mloop = me->mloop; - mdb->cagemesh_cache.looptri = BKE_mesh_get_looptri_array(me); + mdb->cagemesh_cache.looptri = BKE_mesh_runtime_looptri_ensure(me); mdb->cagemesh_cache.poly_nors = CustomData_get_layer(&me->pdata, CD_NORMAL); /* can be NULL */ } diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index af81ac8423b..d90d5227e17 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -69,7 +69,7 @@ typedef struct EditMeshData { /** - * \warning Typical access is done via #BKE_mesh_get_looptri_array, #BKE_mesh_get_looptri_num. + * \warning Typical access is done via #BKE_mesh_runtime_looptri_ensure, #BKE_mesh_runtime_looptri_len. */ struct LooptrisData { /* WARNING! swapping between array (ready-to-be-used data) and array_wip (where data is actually computed) |