Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_ID.c
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
| /* enum of ID-block types | /* enum of ID-block types | ||||
| * NOTE: need to keep this in line with the other defines for these | * NOTE: need to keep this in line with the other defines for these | ||||
| */ | */ | ||||
| EnumPropertyItem rna_enum_id_type_items[] = { | EnumPropertyItem rna_enum_id_type_items[] = { | ||||
| {ID_AC, "ACTION", ICON_ACTION, "Action", ""}, | {ID_AC, "ACTION", ICON_ACTION, "Action", ""}, | ||||
| {ID_AR, "ARMATURE", ICON_ARMATURE_DATA, "Armature", ""}, | {ID_AR, "ARMATURE", ICON_ARMATURE_DATA, "Armature", ""}, | ||||
| {ID_BR, "BRUSH", ICON_BRUSH_DATA, "Brush", ""}, | {ID_BR, "BRUSH", ICON_BRUSH_DATA, "Brush", ""}, | ||||
| {ID_CA, "CAMERA", ICON_CAMERA_DATA, "Camera", ""}, | {ID_CA, "CAMERA", ICON_CAMERA_DATA, "Camera", ""}, | ||||
| {ID_CF, "CACHEFILE", ICON_FILE, "Cache File", ""}, | |||||
| {ID_CU, "CURVE", ICON_CURVE_DATA, "Curve", ""}, | {ID_CU, "CURVE", ICON_CURVE_DATA, "Curve", ""}, | ||||
| {ID_VF, "FONT", ICON_FONT_DATA, "Font", ""}, | {ID_VF, "FONT", ICON_FONT_DATA, "Font", ""}, | ||||
| {ID_GD, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil", ""}, | {ID_GD, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil", ""}, | ||||
| {ID_GR, "GROUP", ICON_GROUP, "Group", ""}, | {ID_GR, "GROUP", ICON_GROUP, "Group", ""}, | ||||
| {ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""}, | {ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""}, | ||||
| {ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""}, | {ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""}, | ||||
| {ID_LA, "LAMP", ICON_LAMP_DATA, "Lamp", ""}, | {ID_LA, "LAMP", ICON_LAMP_DATA, "Lamp", ""}, | ||||
| {ID_LI, "LIBRARY", ICON_LIBRARY_DATA_DIRECT, "Library", ""}, | {ID_LI, "LIBRARY", ICON_LIBRARY_DATA_DIRECT, "Library", ""}, | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | static int rna_ID_name_editable(PointerRNA *ptr) | ||||
| return PROP_EDITABLE; | return PROP_EDITABLE; | ||||
| } | } | ||||
| short RNA_type_to_ID_code(StructRNA *type) | short RNA_type_to_ID_code(StructRNA *type) | ||||
| { | { | ||||
| if (RNA_struct_is_a(type, &RNA_Action)) return ID_AC; | if (RNA_struct_is_a(type, &RNA_Action)) return ID_AC; | ||||
| if (RNA_struct_is_a(type, &RNA_Armature)) return ID_AR; | if (RNA_struct_is_a(type, &RNA_Armature)) return ID_AR; | ||||
| if (RNA_struct_is_a(type, &RNA_Brush)) return ID_BR; | if (RNA_struct_is_a(type, &RNA_Brush)) return ID_BR; | ||||
| if (RNA_struct_is_a(type, &RNA_CacheFile)) return ID_CF; | |||||
| if (RNA_struct_is_a(type, &RNA_Camera)) return ID_CA; | if (RNA_struct_is_a(type, &RNA_Camera)) return ID_CA; | ||||
| if (RNA_struct_is_a(type, &RNA_Curve)) return ID_CU; | if (RNA_struct_is_a(type, &RNA_Curve)) return ID_CU; | ||||
| if (RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD; | if (RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD; | ||||
| if (RNA_struct_is_a(type, &RNA_Group)) return ID_GR; | if (RNA_struct_is_a(type, &RNA_Group)) return ID_GR; | ||||
| if (RNA_struct_is_a(type, &RNA_Image)) return ID_IM; | if (RNA_struct_is_a(type, &RNA_Image)) return ID_IM; | ||||
| if (RNA_struct_is_a(type, &RNA_Key)) return ID_KE; | if (RNA_struct_is_a(type, &RNA_Key)) return ID_KE; | ||||
| if (RNA_struct_is_a(type, &RNA_Lamp)) return ID_LA; | if (RNA_struct_is_a(type, &RNA_Lamp)) return ID_LA; | ||||
| if (RNA_struct_is_a(type, &RNA_Library)) return ID_LI; | if (RNA_struct_is_a(type, &RNA_Library)) return ID_LI; | ||||
| Show All 24 Lines | |||||
| StructRNA *ID_code_to_RNA_type(short idcode) | StructRNA *ID_code_to_RNA_type(short idcode) | ||||
| { | { | ||||
| switch (idcode) { | switch (idcode) { | ||||
| case ID_AC: return &RNA_Action; | case ID_AC: return &RNA_Action; | ||||
| case ID_AR: return &RNA_Armature; | case ID_AR: return &RNA_Armature; | ||||
| case ID_BR: return &RNA_Brush; | case ID_BR: return &RNA_Brush; | ||||
| case ID_CA: return &RNA_Camera; | case ID_CA: return &RNA_Camera; | ||||
| case ID_CF: return &RNA_CacheFile; | |||||
| case ID_CU: return &RNA_Curve; | case ID_CU: return &RNA_Curve; | ||||
| case ID_GD: return &RNA_GreasePencil; | case ID_GD: return &RNA_GreasePencil; | ||||
| case ID_GR: return &RNA_Group; | case ID_GR: return &RNA_Group; | ||||
| case ID_IM: return &RNA_Image; | case ID_IM: return &RNA_Image; | ||||
| case ID_KE: return &RNA_Key; | case ID_KE: return &RNA_Key; | ||||
| case ID_LA: return &RNA_Lamp; | case ID_LA: return &RNA_Lamp; | ||||
| case ID_LI: return &RNA_Library; | case ID_LI: return &RNA_Library; | ||||
| case ID_LS: return &RNA_FreestyleLineStyle; | case ID_LS: return &RNA_FreestyleLineStyle; | ||||
| ▲ Show 20 Lines • Show All 881 Lines • Show Last 20 Lines | |||||