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:
authorHans Goudey <h.goudey@me.com>2022-09-09 16:24:31 +0300
committerHans Goudey <h.goudey@me.com>2022-09-09 16:29:46 +0300
commit21f2bacad977d3fd83d9e4730f2a14dc9932f043 (patch)
tree6ed900df22937d22efa891af1199c35bd6479088 /source/blender/editors/object
parent12c235a1c515d41a18c497d6647253698579c01d (diff)
Cleanup: Simplify BKE_mesh_nomain_to_mesh
- Remove "take ownership" argument which was confusing and always true - The argument made ownership very confusing - Better to avoid boolean arguments that switch a function's purpose - Remove "mask" argument which was basically wrong and not used properly - "EVERYTHING" was used because developers are wary of removing data - Instead use `CD_MASK_MESH` for its purpose of original mesh data - Remove use of shallow copied temporary mesh, which is unnecessary now - Split shape key processing into separate functions and use C++ types - Copy fields explicitly rather than using memcpy for the whole struct - Use higher level functions and avoid redundant code - The whole idea is pretty simple and can be built from standard logic - Adjust `CustomData` logic to be consistent with "assign" expectations - Clear the layer data from the source, and moves the anonymous ID Differential Revision: https://developer.blender.org/D15857
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_add.cc2
-rw-r--r--source/blender/editors/object/object_modifier.cc2
-rw-r--r--source/blender/editors/object/object_remesh.cc4
3 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc
index ddd54aa7953..c651affd96a 100644
--- a/source/blender/editors/object/object_add.cc
+++ b/source/blender/editors/object/object_add.cc
@@ -3151,7 +3151,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
BKE_mesh_edges_set_draw_render(me_eval);
BKE_object_material_from_eval_data(bmain, newob, &me_eval->id);
Mesh *new_mesh = (Mesh *)newob->data;
- BKE_mesh_nomain_to_mesh(me_eval, new_mesh, newob, &CD_MASK_MESH, true);
+ BKE_mesh_nomain_to_mesh(me_eval, new_mesh, newob);
if (do_merge_customdata) {
BKE_mesh_merge_customdata_for_apply_modifier(new_mesh);
diff --git a/source/blender/editors/object/object_modifier.cc b/source/blender/editors/object/object_modifier.cc
index 9bb82cc086c..2de33a3563a 100644
--- a/source/blender/editors/object/object_modifier.cc
+++ b/source/blender/editors/object/object_modifier.cc
@@ -763,7 +763,7 @@ static bool modifier_apply_obdata(
Main *bmain = DEG_get_bmain(depsgraph);
BKE_object_material_from_eval_data(bmain, ob, &mesh_applied->id);
- BKE_mesh_nomain_to_mesh(mesh_applied, me, ob, &CD_MASK_MESH, true);
+ BKE_mesh_nomain_to_mesh(mesh_applied, me, ob);
/* Anonymous attributes shouldn't be available on the applied geometry. */
me->attributes_for_write().remove_anonymous();
diff --git a/source/blender/editors/object/object_remesh.cc b/source/blender/editors/object/object_remesh.cc
index 09489c50e9d..a6b51048209 100644
--- a/source/blender/editors/object/object_remesh.cc
+++ b/source/blender/editors/object/object_remesh.cc
@@ -179,7 +179,7 @@ static int voxel_remesh_exec(bContext *C, wmOperator *op)
BKE_remesh_reproject_vertex_paint(new_mesh, mesh);
}
- BKE_mesh_nomain_to_mesh(new_mesh, mesh, ob, &CD_MASK_MESH, true);
+ BKE_mesh_nomain_to_mesh(new_mesh, mesh, ob);
if (smooth_normals) {
BKE_mesh_smooth_flag_set(static_cast<Mesh *>(ob->data), true);
@@ -905,7 +905,7 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update
BKE_mesh_remesh_reproject_paint_mask(new_mesh, mesh);
}
- BKE_mesh_nomain_to_mesh(new_mesh, mesh, ob, &CD_MASK_MESH, true);
+ BKE_mesh_nomain_to_mesh(new_mesh, mesh, ob);
if (qj->smooth_normals) {
BKE_mesh_smooth_flag_set(static_cast<Mesh *>(ob->data), true);