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/modifiers/intern/MOD_boolean.cc')
-rw-r--r--source/blender/modifiers/intern/MOD_boolean.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_boolean.cc b/source/blender/modifiers/intern/MOD_boolean.cc
index 2a303c7741c..bb05ae3e1b3 100644
--- a/source/blender/modifiers/intern/MOD_boolean.cc
+++ b/source/blender/modifiers/intern/MOD_boolean.cc
@@ -248,13 +248,14 @@ static BMesh *BMD_mesh_bm_create(
BMeshCreateParams bmesh_create_params{};
BMesh *bm = BM_mesh_create(&allocsize, &bmesh_create_params);
- /* Needed so active layers are set based on `mesh` not `mesh_operand_ob`,
- * otherwise the wrong active render layer is used, see T92384. */
- BM_mesh_copy_init_customdata_from_mesh(bm, mesh, &allocsize);
-
- /* NOTE(@campbellbarton): Handle in #BM_mesh_bm_from_me, this is a local fix for T94197. */
- BM_mesh_cd_flag_apply(bm,
- mesh->cd_flag | mesh_operand_ob->cd_flag | BM_mesh_cd_flag_from_bmesh(bm));
+ /* Keep `mesh` first, needed so active layers are set based on `mesh` not `mesh_operand_ob`,
+ * otherwise the wrong active render layer is used, see T92384.
+ *
+ * NOTE: while initializing customer data layers the is not essential,
+ * it avoids the overhead of having to re-allocate #BMHeader.data when the 2nd mesh is added
+ * (if it contains additional custom-data layers). */
+ const Mesh *mesh_array[2] = {mesh, mesh_operand_ob};
+ BM_mesh_copy_init_customdata_from_mesh_array(bm, mesh_array, ARRAY_SIZE(mesh_array), &allocsize);
BMeshFromMeshParams bmesh_from_mesh_params{};
bmesh_from_mesh_params.calc_face_normal = true;