diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-18 22:21:36 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-18 22:21:36 +0300 |
commit | 969c4a45ce09100edc961fd0dc6f37d4689373c7 (patch) | |
tree | 73930cda7e3eab5c538df678abeaca7f823888c7 /source/blender/blenkernel/intern/mesh_convert.cc | |
parent | eaa4aa864427e8aaa0bb1d4f0ce930b562aabc05 (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_convert.cc')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_convert.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/mesh_convert.cc b/source/blender/blenkernel/intern/mesh_convert.cc index 22e4c3bf13c..3562f6c6b17 100644 --- a/source/blender/blenkernel/intern/mesh_convert.cc +++ b/source/blender/blenkernel/intern/mesh_convert.cc @@ -1500,11 +1500,9 @@ void BKE_mesh_nomain_to_mesh(Mesh *mesh_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(&tmp.vdata, CD_NORMAL)) { - tmp.runtime.cd_dirty_vert |= CD_MASK_NORMAL; - } - if (!CustomData_has_layer(&tmp.pdata, CD_NORMAL)) { - tmp.runtime.cd_dirty_poly |= CD_MASK_NORMAL; + if (!CustomData_has_layer(&tmp.vdata, CD_NORMAL) || + !CustomData_has_layer(&tmp.pdata, CD_NORMAL)) { + BKE_mesh_normals_tag_dirty(&tmp); } if (CustomData_has_layer(&mesh_src->vdata, CD_SHAPEKEY)) { |