diff options
author | Hans Goudey <h.goudey@me.com> | 2022-01-14 01:36:50 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-01-14 01:36:50 +0300 |
commit | 0c5ccae79d62127106af589f2d732cf40aa5213a (patch) | |
tree | ac1e5e1a66f9abbba4d6d40bb1a3bcef92eb1cfd /source/blender | |
parent | cfa53e0fbeed7178c7876413e2010fd3347d7f72 (diff) |
Fix: Incorrect logic in mesh validation for removing layers
The mask is only used if it's not zero. Adding the normal mask made
it not zero, but it didn't include anything else, so all custom data
layers except normals were removed. The fix is to only add normals
to the mask when it should be used.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_validate.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index f11e8b3f93c..005c916b4e0 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -1008,13 +1008,12 @@ bool BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData_MeshMasks mask = {0}; if (check_meshmask) { mask = CD_MASK_MESH; + /* Normal data isn't in the mask since it is derived data, + * but it is valid and should not be removed. */ + mask.vmask |= CD_MASK_NORMAL; + mask.pmask |= CD_MASK_NORMAL; } - /* Normal data isn't in the mask since it is derived data, - * but it is valid and should not be removed. */ - mask.vmask |= CD_MASK_NORMAL; - mask.pmask |= CD_MASK_NORMAL; - is_valid &= mesh_validate_customdata( vdata, mask.vmask, totvert, do_verbose, do_fixes, &is_change_v); is_valid &= mesh_validate_customdata( |