From 91dd29fd45d190728f29cc2f6cf9cd5549392f61 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 21 Sep 2022 13:17:05 -0500 Subject: Attributes: Allow calling "finish" on empty accessors This removes some boilerplate when creating many optional attributes. --- source/blender/bmesh/intern/bmesh_mesh_convert.cc | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'source/blender/bmesh') 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); } -- cgit v1.2.3