[Bf-blender-cvs] [d5f2d544524] refactor-mesh-remove-pointers: Merge branch 'master' into refactor-mesh-remove-pointers
Hans Goudey
noreply at git.blender.org
Thu Sep 1 23:10:37 CEST 2022
Commit: d5f2d5445240e75f3fe1f87e07c30cf0eed41eb0
Author: Hans Goudey
Date: Thu Sep 1 16:10:28 2022 -0500
Branches: refactor-mesh-remove-pointers
https://developer.blender.org/rBd5f2d5445240e75f3fe1f87e07c30cf0eed41eb0
Merge branch 'master' into refactor-mesh-remove-pointers
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/mesh_legacy_convert.cc
index 635ab73b869,58096081ad1..c2a4b0176c6
--- a/source/blender/blenkernel/intern/mesh_legacy_convert.cc
+++ b/source/blender/blenkernel/intern/mesh_legacy_convert.cc
@@@ -184,7 -185,14 +184,13 @@@ static void convert_mfaces_to_mpolys(I
CustomData_free(pdata, totpoly_i);
totpoly = totface_i;
- mpoly = (MPoly *)MEM_calloc_arrayN((size_t)totpoly, sizeof(MPoly), "mpoly converted");
- CustomData_add_layer(pdata, CD_MPOLY, CD_ASSIGN, mpoly, totpoly);
+ mpoly = (MPoly *)CustomData_add_layer(pdata, CD_MPOLY, CD_SET_DEFAULT, nullptr, totpoly);
+ int *material_indices = static_cast<int *>(
+ CustomData_get_layer_named(pdata, CD_PROP_INT32, "material_index"));
+ if (material_indices == nullptr) {
+ material_indices = static_cast<int *>(CustomData_add_layer_named(
+ pdata, CD_PROP_INT32, CD_SET_DEFAULT, nullptr, totpoly, "material_index"));
+ }
numTex = CustomData_number_of_layers(fdata, CD_MTFACE);
numCol = CustomData_number_of_layers(fdata, CD_MCOL);
diff --cc source/blender/editors/sculpt_paint/paint_utils.c
index 99ff053876e,adf21154842..7336166d651
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@@ -28,8 -28,8 +28,9 @@@
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_image.h"
+ #include "BKE_layer.h"
#include "BKE_material.h"
+#include "BKE_mesh.h"
#include "BKE_mesh_runtime.h"
#include "BKE_paint.h"
#include "BKE_report.h"
More information about the Bf-blender-cvs
mailing list