Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_rna.c
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_property_type_items[] = { | ||||
| {PROP_FLOAT, "FLOAT", 0, "Float", ""}, | {PROP_FLOAT, "FLOAT", 0, "Float", ""}, | ||||
| {PROP_STRING, "STRING", 0, "String", ""}, | {PROP_STRING, "STRING", 0, "String", ""}, | ||||
| {PROP_ENUM, "ENUM", 0, "Enumeration", ""}, | {PROP_ENUM, "ENUM", 0, "Enumeration", ""}, | ||||
| {PROP_POINTER, "POINTER", 0, "Pointer", ""}, | {PROP_POINTER, "POINTER", 0, "Pointer", ""}, | ||||
| {PROP_COLLECTION, "COLLECTION", 0, "Collection", ""}, | {PROP_COLLECTION, "COLLECTION", 0, "Collection", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| /* XXX Keep in sync with bpy_props.c's property_subtype_xxx_items ??? | /* Keep in sync with RNA_types.h PropertySubType and bpy_props.c's property_subtype_xxx_items */ | ||||
| * Currently it is not... | |||||
| */ | |||||
| const EnumPropertyItem rna_enum_property_subtype_items[] = { | const EnumPropertyItem rna_enum_property_subtype_items[] = { | ||||
| {PROP_NONE, "NONE", 0, "None", ""}, | {PROP_NONE, "NONE", 0, "None", ""}, | ||||
| /* strings */ | /* strings */ | ||||
| {PROP_FILEPATH, "FILEPATH", 0, "File Path", ""}, | {PROP_FILEPATH, "FILEPATH", 0, "File Path", ""}, | ||||
| {PROP_DIRPATH, "DIRPATH", 0, "Directory Path", ""}, | {PROP_DIRPATH, "DIRPATH", 0, "Directory Path", ""}, | ||||
| {PROP_FILENAME, "FILENAME", 0, "File Name", ""}, | {PROP_FILENAME, "FILENAME", 0, "File Name", ""}, | ||||
| {PROP_BYTESTRING, "BYTESTRING", 0, "Byte String", ""}, | |||||
| {PROP_PASSWORD, "PASSWORD", 0, "Password", "A string that is displayed hidden ('********')"}, | {PROP_PASSWORD, "PASSWORD", 0, "Password", "A string that is displayed hidden ('********')"}, | ||||
| /* numbers */ | /* numbers */ | ||||
| {PROP_PIXEL, "PIXEL", 0, "Pixel", ""}, | {PROP_PIXEL, "PIXEL", 0, "Pixel", ""}, | ||||
| {PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned", ""}, | {PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned", ""}, | ||||
| {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""}, | {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""}, | ||||
| {PROP_FACTOR, "FACTOR", 0, "Factor", ""}, | {PROP_FACTOR, "FACTOR", 0, "Factor", ""}, | ||||
| {PROP_ANGLE, "ANGLE", 0, "Angle", ""}, | {PROP_ANGLE, "ANGLE", 0, "Angle", ""}, | ||||
| {PROP_TIME, "TIME", 0, "Time", ""}, | {PROP_TIME, "TIME", 0, "Time", ""}, | ||||
| {PROP_DISTANCE, "DISTANCE", 0, "Distance", ""}, | {PROP_DISTANCE, "DISTANCE", 0, "Distance", ""}, | ||||
| {PROP_DISTANCE_CAMERA, "DISTANCE_CAMERA", 0, "Camera Distance", ""}, | {PROP_DISTANCE_CAMERA, "DISTANCE_CAMERA", 0, "Camera Distance", ""}, | ||||
| {PROP_POWER, "POWER", 0, "Power", ""}, | |||||
| {PROP_TEMPERATURE, "TEMPERATURE", 0, "Temperature", ""}, | |||||
| /* number arrays */ | /* number arrays */ | ||||
| {PROP_COLOR, "COLOR", 0, "Color", ""}, | {PROP_COLOR, "COLOR", 0, "Color", ""}, | ||||
| {PROP_TRANSLATION, "TRANSLATION", 0, "Translation", ""}, | {PROP_TRANSLATION, "TRANSLATION", 0, "Translation", ""}, | ||||
| {PROP_DIRECTION, "DIRECTION", 0, "Direction", ""}, | {PROP_DIRECTION, "DIRECTION", 0, "Direction", ""}, | ||||
| {PROP_VELOCITY, "VELOCITY", 0, "Velocity", ""}, | {PROP_VELOCITY, "VELOCITY", 0, "Velocity", ""}, | ||||
| {PROP_ACCELERATION, "ACCELERATION", 0, "Acceleration", ""}, | {PROP_ACCELERATION, "ACCELERATION", 0, "Acceleration", ""}, | ||||
| {PROP_MATRIX, "MATRIX", 0, "Matrix", ""}, | {PROP_MATRIX, "MATRIX", 0, "Matrix", ""}, | ||||
| ▲ Show 20 Lines • Show All 2,621 Lines • ▼ Show 20 Lines | static void rna_def_struct(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Property Tags", "Tags that properties can use to influence behavior"); | prop, "Property Tags", "Tags that properties can use to influence behavior"); | ||||
| } | } | ||||
| static void rna_def_property(BlenderRNA *brna) | static void rna_def_property(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem subtype_items[] = { | |||||
| {PROP_NONE, "NONE", 0, "None", ""}, | |||||
| {PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""}, | |||||
| {PROP_DIRPATH, "DIR_PATH", 0, "Directory Path", ""}, | |||||
| {PROP_PIXEL, "PIXEL", 0, "Pixel", ""}, | |||||
| {PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned Number", ""}, | |||||
| {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""}, | |||||
| {PROP_FACTOR, "FACTOR", 0, "Factor", ""}, | |||||
| {PROP_ANGLE, "ANGLE", 0, "Angle", ""}, | |||||
| {PROP_TIME, "TIME", 0, "Time", ""}, | |||||
| {PROP_DISTANCE, "DISTANCE", 0, "Distance", ""}, | |||||
| {PROP_COLOR, "COLOR", 0, "Color", ""}, | |||||
| {PROP_TRANSLATION, "TRANSLATION", 0, "Translation", ""}, | |||||
| {PROP_DIRECTION, "DIRECTION", 0, "Direction", ""}, | |||||
| {PROP_MATRIX, "MATRIX", 0, "Matrix", ""}, | |||||
| {PROP_EULER, "EULER", 0, "Euler", ""}, | |||||
| {PROP_QUATERNION, "QUATERNION", 0, "Quaternion", ""}, | |||||
| {PROP_XYZ, "XYZ", 0, "XYZ", ""}, | |||||
| {PROP_COLOR_GAMMA, "COLOR_GAMMA", 0, "Gamma Corrected Color", ""}, | |||||
| {PROP_COORDS, "COORDINATES", 0, "Vector Coordinates", ""}, | |||||
| {PROP_LAYER, "LAYER", 0, "Layer", ""}, | |||||
| {PROP_LAYER_MEMBER, "LAYER_MEMBERSHIP", 0, "Layer Membership", ""}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| EnumPropertyItem dummy_prop_tags[] = { | EnumPropertyItem dummy_prop_tags[] = { | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| srna = RNA_def_struct(brna, "Property", NULL); | srna = RNA_def_struct(brna, "Property", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Property Definition", "RNA property definition"); | RNA_def_struct_ui_text(srna, "Property Definition", "RNA property definition"); | ||||
| RNA_def_struct_refine_func(srna, "rna_Property_refine"); | RNA_def_struct_refine_func(srna, "rna_Property_refine"); | ||||
| RNA_def_struct_ui_icon(srna, ICON_RNA); | RNA_def_struct_ui_icon(srna, ICON_RNA); | ||||
| Show All 28 Lines | static void rna_def_property(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_enum_items(prop, rna_enum_property_type_items); | RNA_def_property_enum_items(prop, rna_enum_property_type_items); | ||||
| RNA_def_property_enum_funcs(prop, "rna_Property_type_get", NULL, NULL); | RNA_def_property_enum_funcs(prop, "rna_Property_type_get", NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Type", "Data type of the property"); | RNA_def_property_ui_text(prop, "Type", "Data type of the property"); | ||||
| prop = RNA_def_property(srna, "subtype", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "subtype", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_enum_items(prop, subtype_items); | RNA_def_property_enum_items(prop, rna_enum_property_subtype_items); | ||||
| RNA_def_property_enum_funcs(prop, "rna_Property_subtype_get", NULL, NULL); | RNA_def_property_enum_funcs(prop, "rna_Property_subtype_get", NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Subtype", "Semantic interpretation of the property"); | RNA_def_property_ui_text(prop, "Subtype", "Semantic interpretation of the property"); | ||||
| prop = RNA_def_property(srna, "srna", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "srna", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_struct_type(prop, "Struct"); | RNA_def_property_struct_type(prop, "Struct"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_Property_srna_get", NULL, NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_Property_srna_get", NULL, NULL, NULL); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| ▲ Show 20 Lines • Show All 511 Lines • Show Last 20 Lines | |||||