From cccc6d6905be7ac32cbe8649faf6b17e9c9f636e Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 30 Aug 2022 16:27:43 -0500 Subject: Mesh: Avoid redundant custom data layer initialization In all these cases, it was clear that the layer values were set right after the layer was created anyway. So there's no point in using calloc or setting the values to zero first. See 25237d2625078c6d for more info. --- source/blender/blenkernel/intern/paint.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/paint.cc') diff --git a/source/blender/blenkernel/intern/paint.cc b/source/blender/blenkernel/intern/paint.cc index 1dfc47efcd5..4c3da5eabc4 100644 --- a/source/blender/blenkernel/intern/paint.cc +++ b/source/blender/blenkernel/intern/paint.cc @@ -1836,7 +1836,7 @@ static void sculpt_face_sets_ensure(Mesh *mesh) } int *new_face_sets = static_cast(CustomData_add_layer( - &mesh->pdata, CD_SCULPT_FACE_SETS, CD_SET_DEFAULT, nullptr, mesh->totpoly)); + &mesh->pdata, CD_SCULPT_FACE_SETS, CD_CONSTRUCT, nullptr, mesh->totpoly)); /* Initialize the new Face Set data-layer with a default valid visible ID and set the default * color to render it white. */ @@ -2078,7 +2078,7 @@ void BKE_sculpt_face_sets_ensure_from_base_mesh_visibility(Mesh *mesh) else { initialize_new_face_sets = true; int *new_face_sets = static_cast(CustomData_add_layer( - &mesh->pdata, CD_SCULPT_FACE_SETS, CD_SET_DEFAULT, nullptr, mesh->totpoly)); + &mesh->pdata, CD_SCULPT_FACE_SETS, CD_CONSTRUCT, nullptr, mesh->totpoly)); /* Initialize the new Face Set data-layer with a default valid visible ID and set the default * color to render it white. */ -- cgit v1.2.3