Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/lib_id.c
| Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_collection.h" | #include "BKE_collection.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "BKE_font.h" | #include "BKE_font.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_gpencil.h" | #include "BKE_gpencil.h" | ||||
| #include "BKE_idcode.h" | #include "BKE_idcode.h" | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_idtype.h" | |||||
| #include "BKE_image.h" | #include "BKE_image.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_query.h" | #include "BKE_lib_query.h" | ||||
| #include "BKE_lib_remap.h" | #include "BKE_lib_remap.h" | ||||
| #include "BKE_linestyle.h" | #include "BKE_linestyle.h" | ||||
| ▲ Show 20 Lines • Show All 1,151 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /** | /** | ||||
| * Initialize an ID of given type, such that it has valid 'empty' data. | * Initialize an ID of given type, such that it has valid 'empty' data. | ||||
| * ID is assumed to be just calloc'ed. | * ID is assumed to be just calloc'ed. | ||||
| */ | */ | ||||
| void BKE_libblock_init_empty(ID *id) | void BKE_libblock_init_empty(ID *id) | ||||
| { | { | ||||
| const IDTypeInfo *idtype_info = BKE_idtype_get_info_from_id(id); | |||||
| printf("%s: ", __func__); | |||||
| if (idtype_info != NULL && idtype_info->init_data != NULL) { | |||||
| printf("Found IDTypeInfo for %c%c, using new code...\n", id->name[0], id->name[1]); | |||||
| idtype_info->init_data(id); | |||||
| return; | |||||
| } | |||||
| printf("No IDTypeInfo for %c%c, using old code...\n", id->name[0], id->name[1]); | |||||
| /* Note that only ID types that are not valid when filled of zero should have a callback here. */ | /* Note that only ID types that are not valid when filled of zero should have a callback here. */ | ||||
| switch ((ID_Type)GS(id->name)) { | switch ((ID_Type)GS(id->name)) { | ||||
| case ID_SCE: | case ID_SCE: | ||||
| BKE_scene_init((Scene *)id); | BKE_scene_init((Scene *)id); | ||||
| break; | break; | ||||
| case ID_LI: | case ID_LI: | ||||
| /* Nothing to do. */ | /* Nothing to do. */ | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 1,334 Lines • Show Last 20 Lines | |||||