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:
authorHans Goudey <h.goudey@me.com>2022-01-13 21:50:55 +0300
committerHans Goudey <h.goudey@me.com>2022-01-13 21:50:55 +0300
commit81d1a88526e0afa08c58c1d8ac45e1a483ede03f (patch)
tree14c5bbe2a8eeb54006070dae8adad2654b1d8de7
parent9951bb46e441680fa53fe717f2ba3fafebd3e8f8 (diff)
Cleanup: Use helper functions to check if normals are dirtytemp-vert-normals-cleanup
-rw-r--r--source/blender/blenkernel/intern/mesh_normals.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/mesh_normals.cc b/source/blender/blenkernel/intern/mesh_normals.cc
index debb1f1e3de..08a17060549 100644
--- a/source/blender/blenkernel/intern/mesh_normals.cc
+++ b/source/blender/blenkernel/intern/mesh_normals.cc
@@ -356,8 +356,7 @@ static void mesh_calc_normals_poly_and_vertex(MVert *mvert,
const float (*BKE_mesh_vertex_normals_ensure(const Mesh *mesh))[3]
{
- if (!(mesh->runtime.cd_dirty_vert & CD_MASK_NORMAL ||
- mesh->runtime.cd_dirty_poly & CD_MASK_NORMAL)) {
+ if (!(BKE_mesh_vertex_normals_are_dirty(mesh) || BKE_mesh_poly_normals_are_dirty(mesh))) {
BLI_assert(CustomData_has_layer(&mesh->vdata, CD_NORMAL) || mesh->totvert == 0);
return (const float(*)[3])CustomData_get_layer(&mesh->vdata, CD_NORMAL);
}
@@ -368,8 +367,7 @@ const float (*BKE_mesh_vertex_normals_ensure(const Mesh *mesh))[3]
ThreadMutex *normals_mutex = (ThreadMutex *)mesh->runtime.normals_mutex;
BLI_mutex_lock(normals_mutex);
- if (!(mesh->runtime.cd_dirty_vert & CD_MASK_NORMAL ||
- mesh->runtime.cd_dirty_poly & CD_MASK_NORMAL)) {
+ if (!(BKE_mesh_vertex_normals_are_dirty(mesh) || BKE_mesh_poly_normals_are_dirty(mesh))) {
BLI_assert(CustomData_has_layer(&mesh->vdata, CD_NORMAL));
BLI_mutex_unlock(normals_mutex);
return (const float(*)[3])CustomData_get_layer(&mesh->vdata, CD_NORMAL);
@@ -398,7 +396,7 @@ const float (*BKE_mesh_vertex_normals_ensure(const Mesh *mesh))[3]
const float (*BKE_mesh_poly_normals_ensure(const Mesh *mesh))[3]
{
- if (!(mesh->runtime.cd_dirty_poly & CD_MASK_NORMAL)) {
+ if (!BKE_mesh_poly_normals_are_dirty(mesh)) {
BLI_assert(CustomData_has_layer(&mesh->pdata, CD_NORMAL) || mesh->totpoly == 0);
return (const float(*)[3])CustomData_get_layer(&mesh->pdata, CD_NORMAL);
}
@@ -409,7 +407,7 @@ const float (*BKE_mesh_poly_normals_ensure(const Mesh *mesh))[3]
ThreadMutex *normals_mutex = (ThreadMutex *)mesh->runtime.normals_mutex;
BLI_mutex_lock(normals_mutex);
- if (!(mesh->runtime.cd_dirty_poly & CD_MASK_NORMAL)) {
+ if (!BKE_mesh_poly_normals_are_dirty(mesh)) {
BLI_assert(CustomData_has_layer(&mesh->pdata, CD_NORMAL));
BLI_mutex_unlock(normals_mutex);
return (const float(*)[3])CustomData_get_layer(&mesh->pdata, CD_NORMAL);