Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_convert.c
| Show All 32 Lines | |||||
| #include "BLI_edgehash.h" | #include "BLI_edgehash.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_DerivedMesh.h" | #include "BKE_DerivedMesh.h" | ||||
| #include "BKE_deform.h" | |||||
| #include "BKE_displist.h" | #include "BKE_displist.h" | ||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_key.h" | #include "BKE_key.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_lib_query.h" | #include "BKE_lib_query.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "BKE_mball.h" | #include "BKE_mball.h" | ||||
| ▲ Show 20 Lines • Show All 1,611 Lines • ▼ Show 20 Lines | void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, | ||||
| /* Clear any run-time data. | /* Clear any run-time data. | ||||
| * Even though this mesh won't typically have run-time data, the Python API can for e.g. | * Even though this mesh won't typically have run-time data, the Python API can for e.g. | ||||
| * create loop-triangle cache here, which is confusing when left in the mesh, see: T81136. */ | * create loop-triangle cache here, which is confusing when left in the mesh, see: T81136. */ | ||||
| BKE_mesh_runtime_clear_geometry(&tmp); | BKE_mesh_runtime_clear_geometry(&tmp); | ||||
| /* skip the listbase */ | /* skip the listbase */ | ||||
| MEMCPY_STRUCT_AFTER(mesh_dst, &tmp, id.prev); | MEMCPY_STRUCT_AFTER(mesh_dst, &tmp, id.prev); | ||||
| BKE_defgroup_copy_list(&mesh_dst->vertex_group_names, &mesh_src->vertex_group_names); | |||||
| mesh_dst->vertex_group_active_index = mesh_src->vertex_group_active_index; | |||||
| if (take_ownership) { | if (take_ownership) { | ||||
| if (alloctype == CD_ASSIGN) { | if (alloctype == CD_ASSIGN) { | ||||
| CustomData_free_typemask(&mesh_src->vdata, mesh_src->totvert, ~mask->vmask); | CustomData_free_typemask(&mesh_src->vdata, mesh_src->totvert, ~mask->vmask); | ||||
| CustomData_free_typemask(&mesh_src->edata, mesh_src->totedge, ~mask->emask); | CustomData_free_typemask(&mesh_src->edata, mesh_src->totedge, ~mask->emask); | ||||
| CustomData_free_typemask(&mesh_src->ldata, mesh_src->totloop, ~mask->lmask); | CustomData_free_typemask(&mesh_src->ldata, mesh_src->totloop, ~mask->lmask); | ||||
| CustomData_free_typemask(&mesh_src->pdata, mesh_src->totpoly, ~mask->pmask); | CustomData_free_typemask(&mesh_src->pdata, mesh_src->totpoly, ~mask->pmask); | ||||
| } | } | ||||
| BKE_id_free(NULL, mesh_src); | BKE_id_free(NULL, mesh_src); | ||||
| Show All 28 Lines | |||||