Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/lib_id_delete.c
| Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_brush.h" | #include "BKE_brush.h" | ||||
| #include "BKE_camera.h" | #include "BKE_camera.h" | ||||
| #include "BKE_cachefile.h" | #include "BKE_cachefile.h" | ||||
| #include "BKE_collection.h" | #include "BKE_collection.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "BKE_font.h" | #include "BKE_font.h" | ||||
| #include "BKE_gpencil.h" | #include "BKE_gpencil.h" | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_idtype.h" | |||||
| #include "BKE_image.h" | #include "BKE_image.h" | ||||
| #include "BKE_ipo.h" | #include "BKE_ipo.h" | ||||
| #include "BKE_key.h" | #include "BKE_key.h" | ||||
| #include "BKE_light.h" | #include "BKE_light.h" | ||||
| #include "BKE_lattice.h" | #include "BKE_lattice.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_lib_override.h" | #include "BKE_lib_override.h" | ||||
| #include "BKE_lib_remap.h" | #include "BKE_lib_remap.h" | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | void BKE_libblock_free_data(ID *id, const bool do_id_user) | ||||
| } | } | ||||
| /* XXX TODO remove animdata handling from each type's freeing func, | /* XXX TODO remove animdata handling from each type's freeing func, | ||||
| * and do it here, like for copy! */ | * and do it here, like for copy! */ | ||||
| } | } | ||||
| void BKE_libblock_free_datablock(ID *id, const int UNUSED(flag)) | void BKE_libblock_free_datablock(ID *id, const int UNUSED(flag)) | ||||
| { | { | ||||
| const IDTypeInfo *idtype_info = BKE_idtype_get_info_from_id(id); | |||||
| printf("%s: ", __func__); | |||||
| if (idtype_info != NULL) { | |||||
| printf("Found IDTypeInfo for %c%c, using new code...\n", id->name[0], id->name[1]); | |||||
| if (idtype_info->free_data != NULL) { | |||||
| idtype_info->free_data(id); | |||||
| } | |||||
| return; | |||||
| } | |||||
| printf("No IDTypeInfo for %c%c, using old code...\n", id->name[0], id->name[1]); | |||||
| const short type = GS(id->name); | const short type = GS(id->name); | ||||
| switch (type) { | switch (type) { | ||||
| case ID_SCE: | case ID_SCE: | ||||
| BKE_scene_free_ex((Scene *)id, false); | BKE_scene_free_ex((Scene *)id, false); | ||||
| break; | break; | ||||
| case ID_LI: | case ID_LI: | ||||
| BKE_library_free((Library *)id); | BKE_library_free((Library *)id); | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 404 Lines • Show Last 20 Lines | |||||