diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-21 21:17:05 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-21 21:17:05 +0300 |
commit | 91dd29fd45d190728f29cc2f6cf9cd5549392f61 (patch) | |
tree | 72a579bcacdcc96e0bd8806364d80199d156bdfd /source/blender/bmesh | |
parent | 600c069e0ef5334575164e5c4d758efe7324b0c7 (diff) |
Attributes: Allow calling "finish" on empty accessors
This removes some boilerplate when creating many optional attributes.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh_convert.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.cc b/source/blender/bmesh/intern/bmesh_mesh_convert.cc index 6f1552e6a0f..399d5e1517b 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_convert.cc +++ b/source/blender/bmesh/intern/bmesh_mesh_convert.cc @@ -1368,21 +1368,12 @@ void BM_mesh_bm_to_me_for_eval(BMesh *bm, Mesh *me, const CustomData_MeshMasks * } bm->elem_index_dirty &= ~(BM_FACE | BM_LOOP); - if (material_index_attribute) { - material_index_attribute.finish(); - } - assert_bmesh_has_no_mesh_only_attributes(*bm); - if (hide_vert_attribute) { - hide_vert_attribute.finish(); - } - if (hide_edge_attribute) { - hide_edge_attribute.finish(); - } - if (hide_poly_attribute) { - hide_poly_attribute.finish(); - } + material_index_attribute.finish(); + hide_vert_attribute.finish(); + hide_edge_attribute.finish(); + hide_poly_attribute.finish(); me->cd_flag = BM_mesh_cd_flag_from_bmesh(bm); } |