Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh.cc
| Show First 20 Lines • Show All 875 Lines • ▼ Show 20 Lines | static void mesh_clear_geometry(Mesh *mesh) | ||||
| mesh->totvert = 0; | mesh->totvert = 0; | ||||
| mesh->totedge = 0; | mesh->totedge = 0; | ||||
| mesh->totface = 0; | mesh->totface = 0; | ||||
| mesh->totloop = 0; | mesh->totloop = 0; | ||||
| mesh->totpoly = 0; | mesh->totpoly = 0; | ||||
| mesh->act_face = -1; | mesh->act_face = -1; | ||||
| mesh->totselect = 0; | mesh->totselect = 0; | ||||
| BLI_freelistN(&mesh->vertex_group_names); | |||||
| } | } | ||||
| void BKE_mesh_clear_geometry(Mesh *mesh) | void BKE_mesh_clear_geometry(Mesh *mesh) | ||||
| { | { | ||||
| BKE_animdata_free(&mesh->id, false); | |||||
| BKE_mesh_runtime_clear_cache(mesh); | BKE_mesh_runtime_clear_cache(mesh); | ||||
| mesh_clear_geometry(mesh); | mesh_clear_geometry(mesh); | ||||
| } | } | ||||
| static void mesh_tessface_clear_intern(Mesh *mesh, int free_customdata) | static void mesh_tessface_clear_intern(Mesh *mesh, int free_customdata) | ||||
| { | { | ||||
| if (free_customdata) { | if (free_customdata) { | ||||
| CustomData_free(&mesh->fdata, mesh->totface); | CustomData_free(&mesh->fdata, mesh->totface); | ||||
| ▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | void BKE_mesh_copy_parameters(Mesh *me_dst, const Mesh *me_src) | ||||
| me_dst->face_sets_color_default = me_src->face_sets_color_default; | me_dst->face_sets_color_default = me_src->face_sets_color_default; | ||||
| /* Copy texture space. */ | /* Copy texture space. */ | ||||
| me_dst->texflag = me_src->texflag; | me_dst->texflag = me_src->texflag; | ||||
| copy_v3_v3(me_dst->loc, me_src->loc); | copy_v3_v3(me_dst->loc, me_src->loc); | ||||
| copy_v3_v3(me_dst->size, me_src->size); | copy_v3_v3(me_dst->size, me_src->size); | ||||
| me_dst->vertex_group_active_index = me_src->vertex_group_active_index; | me_dst->vertex_group_active_index = me_src->vertex_group_active_index; | ||||
| me_dst->attributes_active_index = me_src->attributes_active_index; | |||||
| } | } | ||||
| void BKE_mesh_copy_parameters_for_eval(Mesh *me_dst, const Mesh *me_src) | void BKE_mesh_copy_parameters_for_eval(Mesh *me_dst, const Mesh *me_src) | ||||
| { | { | ||||
| /* User counts aren't handled, don't copy into a mesh from #G_MAIN. */ | /* User counts aren't handled, don't copy into a mesh from #G_MAIN. */ | ||||
| BLI_assert(me_dst->id.tag & (LIB_TAG_NO_MAIN | LIB_TAG_COPIED_ON_WRITE)); | BLI_assert(me_dst->id.tag & (LIB_TAG_NO_MAIN | LIB_TAG_COPIED_ON_WRITE)); | ||||
| BKE_mesh_copy_parameters(me_dst, me_src); | BKE_mesh_copy_parameters(me_dst, me_src); | ||||
| ▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines | |||||