diff options
author | Jacques Lucke <jacques@blender.org> | 2022-02-10 20:03:37 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-02-10 20:03:37 +0300 |
commit | 25c4000796833966386b125744b17ede81aa62b1 (patch) | |
tree | e729ecb2f083835de90c808ed34d96a27c040873 /source/blender/blenkernel | |
parent | 720d653b418bb5760c5891a2c8b74b72ea9889a9 (diff) |
Fix T95613: remove anonymous attributes when converting object
This is the same behavior as when applying a geometry nodes modifier
that adds anonymous attributes.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh.cc | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index e1c706a82dc..376bb5c8d2e 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -327,6 +327,8 @@ void BKE_mesh_vert_coords_apply_with_mat4(struct Mesh *mesh, const float mat[4][4]); void BKE_mesh_vert_coords_apply(struct Mesh *mesh, const float (*vert_coords)[3]); +void BKE_mesh_anonymous_attributes_remove(struct Mesh *mesh); + /* *** mesh_tessellate.c *** */ /** diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc index 73fe279552d..76a15fd0a1c 100644 --- a/source/blender/blenkernel/intern/mesh.cc +++ b/source/blender/blenkernel/intern/mesh.cc @@ -1922,6 +1922,14 @@ void BKE_mesh_vert_coords_apply_with_mat4(Mesh *mesh, BKE_mesh_normals_tag_dirty(mesh); } +void BKE_mesh_anonymous_attributes_remove(Mesh *mesh) +{ + CustomData_free_layers_anonymous(&mesh->vdata, mesh->totvert); + CustomData_free_layers_anonymous(&mesh->edata, mesh->totedge); + CustomData_free_layers_anonymous(&mesh->pdata, mesh->totpoly); + CustomData_free_layers_anonymous(&mesh->ldata, mesh->totloop); +} + void BKE_mesh_calc_normals_split_ex(Mesh *mesh, MLoopNorSpaceArray *r_lnors_spacearr) { float(*r_loopnors)[3]; |