Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Show First 20 Lines • Show All 463 Lines • ▼ Show 20 Lines | void BKE_object_free_derived_caches(Object *ob) | ||||
| if (ob->runtime.mesh_deform_eval != NULL) { | if (ob->runtime.mesh_deform_eval != NULL) { | ||||
| Mesh *mesh_deform_eval = ob->runtime.mesh_deform_eval; | Mesh *mesh_deform_eval = ob->runtime.mesh_deform_eval; | ||||
| BKE_mesh_free(mesh_deform_eval); | BKE_mesh_free(mesh_deform_eval); | ||||
| BKE_libblock_free_data(&mesh_deform_eval->id, false); | BKE_libblock_free_data(&mesh_deform_eval->id, false); | ||||
| MEM_freeN(mesh_deform_eval); | MEM_freeN(mesh_deform_eval); | ||||
| ob->runtime.mesh_deform_eval = NULL; | ob->runtime.mesh_deform_eval = NULL; | ||||
| } | } | ||||
| BKE_object_to_mesh_clear(ob); | |||||
| BKE_object_free_curve_cache(ob); | BKE_object_free_curve_cache(ob); | ||||
| /* clear grease pencil data */ | /* clear grease pencil data */ | ||||
| DRW_gpencil_freecache(ob); | DRW_gpencil_freecache(ob); | ||||
| } | } | ||||
| void BKE_object_free_derived_mesh_caches(struct Object *ob) | void BKE_object_free_derived_mesh_caches(struct Object *ob) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 4,012 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Object *ob = bmain->objects.first; | Object *ob = bmain->objects.first; | ||||
| int select_id = 1; | int select_id = 1; | ||||
| while (ob) { | while (ob) { | ||||
| ob->runtime.select_id = select_id++; | ob->runtime.select_id = select_id++; | ||||
| ob = ob->id.next; | ob = ob->id.next; | ||||
| } | } | ||||
| } | } | ||||
| Mesh *BKE_object_to_mesh(Object *object) | |||||
| { | |||||
| BKE_object_to_mesh_clear(object); | |||||
| Mesh *mesh = BKE_mesh_new_from_object(object); | |||||
| object->runtime.object_as_temp_mesh = mesh; | |||||
| return mesh; | |||||
| } | |||||
| void BKE_object_to_mesh_clear(Object *object) | |||||
| { | |||||
| if (object->runtime.object_as_temp_mesh == NULL) { | |||||
| return; | |||||
| } | |||||
| BKE_id_free(NULL, object->runtime.object_as_temp_mesh); | |||||
| object->runtime.object_as_temp_mesh = NULL; | |||||
| } | |||||