[Bf-blender-cvs] [239eb95ef87] master: Fix T81865, T81860: CustomData Correction can fail on non standard names

Philipp Oeser noreply at git.blender.org
Tue Oct 20 16:25:01 CEST 2020


Commit: 239eb95ef879088d690eec331619c3ddabc595aa
Author: Philipp Oeser
Date:   Tue Oct 20 10:48:05 2020 +0200
Branches: master
https://developer.blender.org/rB239eb95ef879088d690eec331619c3ddabc595aa

Fix T81865, T81860: CustomData Correction can fail on non standard names

Caused by rBaafd71a8a160.

In the process of CustomData Correction, we need to make sure we also
have matching layer names [as was done before above commit], otherwise
this will create layers with default names, applying
(mesh_customdatacorrect_apply and friends) will fail then.

Maniphest Tasks: T81865

Differential Revision: https://developer.blender.org/D9278

===================================================================

M	source/blender/bmesh/intern/bmesh_construct.c

===================================================================

diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c
index 2e69c48708c..ca5693aa5ba 100644
--- a/source/blender/bmesh/intern/bmesh_construct.c
+++ b/source/blender/bmesh/intern/bmesh_construct.c
@@ -641,7 +641,8 @@ void BM_mesh_copy_init_customdata_all_layers(BMesh *bm_dst,
     const int size = *(&allocsize->totvert + i);
 
     for (int l = 0; l < src->totlayer; l++) {
-      CustomData_add_layer(dst, src->layers[l].type, CD_CALLOC, NULL, 0);
+      CustomData_add_layer_named(
+          dst, src->layers[l].type, CD_CALLOC, NULL, 0, src->layers[l].name);
     }
     CustomData_bmesh_init_pool(dst, size, htypes[i]);
   }



More information about the Bf-blender-cvs mailing list