Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/mball_tessellate.cc')
-rw-r--r--source/blender/blenkernel/intern/mball_tessellate.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/mball_tessellate.cc b/source/blender/blenkernel/intern/mball_tessellate.cc
index f8a64a7cd8b..85c7504e61e 100644
--- a/source/blender/blenkernel/intern/mball_tessellate.cc
+++ b/source/blender/blenkernel/intern/mball_tessellate.cc
@@ -1462,13 +1462,10 @@ Mesh *BKE_mball_polygonize(Depsgraph *depsgraph, Scene *scene, Object *ob)
Mesh *mesh = (Mesh *)BKE_id_new_nomain(ID_ME, ((ID *)ob->data)->name + 2);
- mesh->totvert = int(process.curvertex);
- MVert *mvert = static_cast<MVert *>(
- CustomData_add_layer(&mesh->vdata, CD_MVERT, CD_CONSTRUCT, nullptr, mesh->totvert));
- for (int i = 0; i < mesh->totvert; i++) {
- copy_v3_v3(mvert[i].co, process.co[i]);
- }
- MEM_freeN(process.co);
+ mesh->totvert = (int)process.curvertex;
+ CustomData_add_layer_named(
+ &mesh->vdata, CD_PROP_FLOAT3, CD_ASSIGN, process.co, mesh->totvert, "position");
+ process.co = nullptr;
mesh->totpoly = int(process.curindex);
MPoly *mpoly = static_cast<MPoly *>(