Fix #119426: Enabling dyntopo creates duplicate mask attribute

The CustomData API automatically creates a unique attribute with
a unique name for generic data types. Caused by f2bcd73bd2.

Pull Request: https://projects.blender.org/blender/blender/pulls/119441
This commit is contained in:
Hans Goudey 2024-03-14 13:22:08 +01:00 • committed by Hans Goudey
parent 1640121a63
commit 961d8ef6d5

View file

@ -100,7 +100,7 @@ void enable_ex(Main *bmain, Depsgraph *depsgraph, Object *ob)
BM_mesh_bm_from_me(ss->bm, mesh, &convert_params);
triangulate(ss->bm);
BM_data_layer_add_named(ss->bm, &ss->bm->vdata, CD_PROP_FLOAT, ".sculpt_mask");
BM_data_layer_ensure_named(ss->bm, &ss->bm->vdata, CD_PROP_FLOAT, ".sculpt_mask");
/* Make sure the data for existing faces are initialized. */
if (mesh->faces_num != ss->bm->totface) {