Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_ID.c
| Show First 20 Lines • Show All 834 Lines • ▼ Show 20 Lines | static void rna_def_ID_materials(BlenderRNA *brna) | ||||
| srna = RNA_def_struct(brna, "IDMaterials", NULL); | srna = RNA_def_struct(brna, "IDMaterials", NULL); | ||||
| RNA_def_struct_sdna(srna, "ID"); | RNA_def_struct_sdna(srna, "ID"); | ||||
| RNA_def_struct_ui_text(srna, "ID Materials", "Collection of materials"); | RNA_def_struct_ui_text(srna, "ID Materials", "Collection of materials"); | ||||
| func = RNA_def_function(srna, "append", "rna_IDMaterials_append_id"); | func = RNA_def_function(srna, "append", "rna_IDMaterials_append_id"); | ||||
| RNA_def_function_flag(func, FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Add a new material to the data-block"); | RNA_def_function_ui_description(func, "Add a new material to the data-block"); | ||||
| parm = RNA_def_pointer(func, "material", "Material", "", "Material to add"); | parm = RNA_def_pointer(func, "material", "Material", "", "Material to add"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "pop", "rna_IDMaterials_pop_id"); | func = RNA_def_function(srna, "pop", "rna_IDMaterials_pop_id"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Remove a material from the data-block"); | RNA_def_function_ui_description(func, "Remove a material from the data-block"); | ||||
| parm = RNA_def_int(func, "index", -1, -MAXMAT, MAXMAT, "", "Index of material to remove", 0, MAXMAT); | parm = RNA_def_int(func, "index", -1, -MAXMAT, MAXMAT, "", "Index of material to remove", 0, MAXMAT); | ||||
| RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned"); | RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned"); | ||||
| parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove"); | parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| ▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | static void rna_def_ID(BlenderRNA *brna) | ||||
| func = RNA_def_function(srna, "user_clear", "rna_ID_user_clear"); | func = RNA_def_function(srna, "user_clear", "rna_ID_user_clear"); | ||||
| RNA_def_function_ui_description(func, "Clear the user count of a data-block so its not saved, " | RNA_def_function_ui_description(func, "Clear the user count of a data-block so its not saved, " | ||||
| "on reload the data will be removed"); | "on reload the data will be removed"); | ||||
| func = RNA_def_function(srna, "user_remap", "rna_ID_user_remap"); | func = RNA_def_function(srna, "user_remap", "rna_ID_user_remap"); | ||||
| RNA_def_function_ui_description(func, "Replace all usage in the .blend file of this ID by new given one"); | RNA_def_function_ui_description(func, "Replace all usage in the .blend file of this ID by new given one"); | ||||
| RNA_def_function_flag(func, FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_MAIN); | ||||
| parm = RNA_def_pointer(func, "new_id", "ID", "", "New ID to use"); | parm = RNA_def_pointer(func, "new_id", "ID", "", "New ID to use"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "make_local", "rna_ID_make_local"); | func = RNA_def_function(srna, "make_local", "rna_ID_make_local"); | ||||
| RNA_def_function_ui_description(func, "Make this datablock local, return local one " | RNA_def_function_ui_description(func, "Make this datablock local, return local one " | ||||
| "(may be a copy of the original, in case it is also indirectly used)"); | "(may be a copy of the original, in case it is also indirectly used)"); | ||||
| RNA_def_function_flag(func, FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_MAIN); | ||||
| parm = RNA_def_boolean(func, "clear_proxy", true, "", | parm = RNA_def_boolean(func, "clear_proxy", true, "", | ||||
| "Whether to clear proxies (the default behavior, " | "Whether to clear proxies (the default behavior, " | ||||
| "note that if object has to be duplicated to be made local, proxies are always cleared)"); | "note that if object has to be duplicated to be made local, proxies are always cleared)"); | ||||
| RNA_def_property_flag(parm, PROP_PYFUNC_OPTIONAL); | RNA_def_parameter_flags(parm, 0, PARM_PYFUNC_OPTIONAL); /* XXX TO BE REMOVED! useless here, only for registered stuff! */ | ||||
| parm = RNA_def_pointer(func, "id", "ID", "", "This ID, or the new ID if it was copied"); | parm = RNA_def_pointer(func, "id", "ID", "", "This ID, or the new ID if it was copied"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "user_of_id", "BKE_library_ID_use_ID"); | func = RNA_def_function(srna, "user_of_id", "BKE_library_ID_use_ID"); | ||||
| RNA_def_function_ui_description(func, "Count the number of times that ID uses/references given one"); | RNA_def_function_ui_description(func, "Count the number of times that ID uses/references given one"); | ||||
| parm = RNA_def_pointer(func, "id", "ID", "", "ID to count usages"); | parm = RNA_def_pointer(func, "id", "ID", "", "ID to count usages"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, "count", 0, 0, INT_MAX, | parm = RNA_def_int(func, "count", 0, 0, INT_MAX, | ||||
| "", "Number of usages/references of given id by current data-block", 0, INT_MAX); | "", "Number of usages/references of given id by current data-block", 0, INT_MAX); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "animation_data_create", "rna_ID_animation_data_create"); | func = RNA_def_function(srna, "animation_data_create", "rna_ID_animation_data_create"); | ||||
| RNA_def_function_flag(func, FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this"); | RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this"); | ||||
| parm = RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL"); | parm = RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL"); | ||||
| ▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines | |||||