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-02-18 22:21:36 +0300
committerHans Goudey <h.goudey@me.com>2022-02-18 22:21:36 +0300
commit969c4a45ce09100edc961fd0dc6f37d4689373c7 (patch)
tree73930cda7e3eab5c538df678abeaca7f823888c7 /source/blender/blenkernel/intern/mesh.cc
parenteaa4aa864427e8aaa0bb1d4f0ce930b562aabc05 (diff)
Cleanup: Use functions for accessing mesh normal dirty state
It's better not to expose the details of where the dirty flags are stored to every place that wants to know if the normals are dirty. Some of these places are relics from before vertex normals were computed lazily anyway, so this is more of an incrememtal cleanup. This will make part of the fix for T95839 simpler.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.cc')
-rw-r--r--source/blender/blenkernel/intern/mesh.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc
index 76a15fd0a1c..351535a6f78 100644
--- a/source/blender/blenkernel/intern/mesh.cc
+++ b/source/blender/blenkernel/intern/mesh.cc
@@ -1116,11 +1116,9 @@ Mesh *BKE_mesh_new_nomain_from_template_ex(const Mesh *me_src,
/* Ensure that when no normal layers exist, they are marked dirty, because
* normals might not have been included in the mask of copied layers. */
- if (!CustomData_has_layer(&me_dst->vdata, CD_NORMAL)) {
- me_dst->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
- }
- if (!CustomData_has_layer(&me_dst->pdata, CD_NORMAL)) {
- me_dst->runtime.cd_dirty_poly |= CD_MASK_NORMAL;
+ if (!CustomData_has_layer(&me_dst->vdata, CD_NORMAL) ||
+ !CustomData_has_layer(&me_dst->pdata, CD_NORMAL)) {
+ BKE_mesh_normals_tag_dirty(me_dst);
}
/* The destination mesh should at least have valid primary CD layers,