Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_main_api.c
| Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
| # include "BKE_lattice.h" | # include "BKE_lattice.h" | ||||
| # include "BKE_lib_remap.h" | # include "BKE_lib_remap.h" | ||||
| # include "BKE_light.h" | # include "BKE_light.h" | ||||
| # include "BKE_lightprobe.h" | # include "BKE_lightprobe.h" | ||||
| # include "BKE_linestyle.h" | # include "BKE_linestyle.h" | ||||
| # include "BKE_mask.h" | # include "BKE_mask.h" | ||||
| # include "BKE_material.h" | # include "BKE_material.h" | ||||
| # include "BKE_mball.h" | # include "BKE_mball.h" | ||||
| # include "BKE_heightmap.h" | |||||
| # include "BKE_mesh.h" | # include "BKE_mesh.h" | ||||
| # include "BKE_movieclip.h" | # include "BKE_movieclip.h" | ||||
| # include "BKE_node.h" | # include "BKE_node.h" | ||||
| # include "BKE_object.h" | # include "BKE_object.h" | ||||
| # include "BKE_paint.h" | # include "BKE_paint.h" | ||||
| # include "BKE_particle.h" | # include "BKE_particle.h" | ||||
| # include "BKE_pointcloud.h" | # include "BKE_pointcloud.h" | ||||
| # include "BKE_scene.h" | # include "BKE_scene.h" | ||||
| Show All 19 Lines | |||||
| # include "DNA_hair_types.h" | # include "DNA_hair_types.h" | ||||
| # include "DNA_lattice_types.h" | # include "DNA_lattice_types.h" | ||||
| # include "DNA_light_types.h" | # include "DNA_light_types.h" | ||||
| # include "DNA_lightprobe_types.h" | # include "DNA_lightprobe_types.h" | ||||
| # include "DNA_mask_types.h" | # include "DNA_mask_types.h" | ||||
| # include "DNA_material_types.h" | # include "DNA_material_types.h" | ||||
| # include "DNA_mesh_types.h" | # include "DNA_mesh_types.h" | ||||
| # include "DNA_meta_types.h" | # include "DNA_meta_types.h" | ||||
| # include "DNA_heightmap_types.h" | |||||
| # include "DNA_movieclip_types.h" | # include "DNA_movieclip_types.h" | ||||
| # include "DNA_node_types.h" | # include "DNA_node_types.h" | ||||
| # include "DNA_particle_types.h" | # include "DNA_particle_types.h" | ||||
| # include "DNA_pointcloud_types.h" | # include "DNA_pointcloud_types.h" | ||||
| # include "DNA_simulation_types.h" | # include "DNA_simulation_types.h" | ||||
| # include "DNA_sound_types.h" | # include "DNA_sound_types.h" | ||||
| # include "DNA_speaker_types.h" | # include "DNA_speaker_types.h" | ||||
| # include "DNA_text_types.h" | # include "DNA_text_types.h" | ||||
| ▲ Show 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | static MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name) | ||||
| MetaBall *mb = BKE_mball_add(bmain, safe_name); | MetaBall *mb = BKE_mball_add(bmain, safe_name); | ||||
| id_us_min(&mb->id); | id_us_min(&mb->id); | ||||
| WM_main_add_notifier(NC_ID | NA_ADDED, NULL); | WM_main_add_notifier(NC_ID | NA_ADDED, NULL); | ||||
| return mb; | return mb; | ||||
| } | } | ||||
| static HeightMap *rna_Main_heightmaps_new(Main *bmain, const char *name) | |||||
| { | |||||
| char safe_name[MAX_ID_NAME - 2]; | |||||
| rna_idname_validate(name, safe_name); | |||||
| HeightMap *hm = BKE_heightmap_add(bmain, safe_name); | |||||
| id_us_min(&hm->id); | |||||
| WM_main_add_notifier(NC_ID | NA_ADDED, NULL); | |||||
| return hm; | |||||
| } | |||||
| static VFont *rna_Main_fonts_load(Main *bmain, | static VFont *rna_Main_fonts_load(Main *bmain, | ||||
| ReportList *reports, | ReportList *reports, | ||||
| const char *filepath, | const char *filepath, | ||||
| bool check_existing) | bool check_existing) | ||||
| { | { | ||||
| VFont *font; | VFont *font; | ||||
| errno = 0; | errno = 0; | ||||
| ▲ Show 20 Lines • Show All 1,002 Lines • ▼ Show 20 Lines | RNA_def_boolean(func, | ||||
| "Decrement user counter of all datablocks used by this metaball data"); | "Decrement user counter of all datablocks used by this metaball data"); | ||||
| RNA_def_boolean( | RNA_def_boolean( | ||||
| func, "do_ui_user", true, "", "Make sure interface does not reference this metaball data"); | func, "do_ui_user", true, "", "Make sure interface does not reference this metaball data"); | ||||
| func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag"); | func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag"); | ||||
| parm = RNA_def_boolean(func, "value", 0, "Value", ""); | parm = RNA_def_boolean(func, "value", 0, "Value", ""); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| } | } | ||||
| void RNA_def_main_heightmaps(BlenderRNA *brna, PropertyRNA *cprop) | |||||
| { | |||||
| StructRNA *srna; | |||||
| FunctionRNA *func; | |||||
| PropertyRNA *parm; | |||||
| RNA_def_property_srna(cprop, "BlendDataHeightMaps"); | |||||
| srna = RNA_def_struct(brna, "BlendDataHeightMaps", NULL); | |||||
| RNA_def_struct_sdna(srna, "Main"); | |||||
| RNA_def_struct_ui_text(srna, "Main HeightMaps", "Collection of heightmaps"); | |||||
| func = RNA_def_function(srna, "new", "rna_Main_heightmaps_new"); | |||||
| RNA_def_function_ui_description(func, "Add a new metaball to the main database"); | |||||
| parm = RNA_def_string(func, "name", "HeightMap", 0, "", "New name for the data-block"); | |||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | |||||
| /* return type */ | |||||
| parm = RNA_def_pointer(func, "heightmap", "HeightMap", "", "New metaball data-block"); | |||||
| RNA_def_function_return(func, parm); | |||||
| func = RNA_def_function(srna, "remove", "rna_Main_ID_remove"); | |||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | |||||
| RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile"); | |||||
| parm = RNA_def_pointer(func, "heightmap", "HeightMap", "", "Metaball to remove"); | |||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | |||||
| RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | |||||
| RNA_def_boolean(func, | |||||
| "do_unlink", | |||||
| true, | |||||
| "", | |||||
| "Unlink all usages of this metaball before deleting it " | |||||
| "(WARNING: will also delete objects instancing that metaball data)"); | |||||
| RNA_def_boolean(func, | |||||
| "do_id_user", | |||||
| true, | |||||
| "", | |||||
| "Decrement user counter of all datablocks used by this metaball data"); | |||||
| RNA_def_boolean( | |||||
| func, "do_ui_user", true, "", "Make sure interface does not reference this metaball data"); | |||||
| } | |||||
| void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop) | void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| RNA_def_property_srna(cprop, "BlendDataFonts"); | RNA_def_property_srna(cprop, "BlendDataFonts"); | ||||
| srna = RNA_def_struct(brna, "BlendDataFonts", NULL); | srna = RNA_def_struct(brna, "BlendDataFonts", NULL); | ||||
| ▲ Show 20 Lines • Show All 959 Lines • Show Last 20 Lines | |||||