Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_runtime.c
| Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | bool BKE_mesh_runtime_clear_edit_data(Mesh *mesh) | ||||
| BKE_mesh_runtime_reset_edit_data(mesh); | BKE_mesh_runtime_reset_edit_data(mesh); | ||||
| MEM_freeN(mesh->runtime.edit_data); | MEM_freeN(mesh->runtime.edit_data); | ||||
| mesh->runtime.edit_data = NULL; | mesh->runtime.edit_data = NULL; | ||||
| return true; | return true; | ||||
| } | } | ||||
| void BKE_mesh_runtime_clear_geometry_for_edit_mode(Mesh *me) | |||||
| { | |||||
| EditMeshEval *em_eval = &me->runtime.edit_eval; | |||||
| /* All have been moved to #EditMeshData. */ | |||||
| if (em_eval->mesh_cage) { | |||||
| BKE_id_free(NULL, em_eval->mesh_cage); | |||||
| } | |||||
| if (em_eval->mesh_final && em_eval->mesh_final != em_eval->mesh_cage) { | |||||
| BKE_id_free(NULL, em_eval->mesh_final); | |||||
| } | |||||
| em_eval->mesh_cage = em_eval->mesh_final = NULL; | |||||
| MEM_SAFE_FREE(em_eval->bb_cage); | |||||
| } | |||||
| void BKE_mesh_runtime_clear_geometry(Mesh *mesh) | void BKE_mesh_runtime_clear_geometry(Mesh *mesh) | ||||
| { | { | ||||
| if (mesh->runtime.bvh_cache) { | if (mesh->runtime.bvh_cache) { | ||||
| bvhcache_free(mesh->runtime.bvh_cache); | bvhcache_free(mesh->runtime.bvh_cache); | ||||
| mesh->runtime.bvh_cache = NULL; | mesh->runtime.bvh_cache = NULL; | ||||
| } | } | ||||
| MEM_SAFE_FREE(mesh->runtime.looptris.array); | MEM_SAFE_FREE(mesh->runtime.looptris.array); | ||||
| /* TODO(sergey): Does this really belong here? */ | /* TODO(sergey): Does this really belong here? */ | ||||
| if (mesh->runtime.subdiv_ccg != NULL) { | if (mesh->runtime.subdiv_ccg != NULL) { | ||||
| BKE_subdiv_ccg_destroy(mesh->runtime.subdiv_ccg); | BKE_subdiv_ccg_destroy(mesh->runtime.subdiv_ccg); | ||||
| mesh->runtime.subdiv_ccg = NULL; | mesh->runtime.subdiv_ccg = NULL; | ||||
| } | } | ||||
| BKE_mesh_runtime_clear_geometry_for_edit_mode(mesh); | |||||
| BKE_shrinkwrap_discard_boundary_data(mesh); | BKE_shrinkwrap_discard_boundary_data(mesh); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Mesh Batch Cache Callbacks | /** \name Mesh Batch Cache Callbacks | ||||
| * \{ */ | * \{ */ | ||||
| ▲ Show 20 Lines • Show All 196 Lines • Show Last 20 Lines | |||||