4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Contributor(s): Blender Foundation (2008).
22 * ***** END GPL LICENSE BLOCK *****
27 #include "RNA_define.h"
28 #include "RNA_types.h"
30 #include "rna_internal.h"
32 #include "DNA_radio_types.h"
38 void RNA_def_radio(BlenderRNA *brna)
42 static EnumPropertyItem prop_drawtype_items[] = {
43 {RAD_WIREFRAME, "WIREFRAME", 0, "Wireframe", "Enables Wireframe draw mode"},
44 {RAD_SOLID, "SOLID", 0, "Solid", "Enables Solid draw mode"},
45 {RAD_GOURAUD, "GOURAUD", 0, "Gouraud", "Enables Gouraud draw mode"},
46 {0, NULL, 0, NULL, NULL}};
48 srna= RNA_def_struct(brna, "Radiosity", NULL);
49 RNA_def_struct_ui_text(srna, "Radiosity", "Settings for radiosity simulation of indirect diffuse lighting.");
50 RNA_def_struct_sdna(srna, "Radio");
53 prop= RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE);
54 RNA_def_property_enum_sdna(prop, NULL, "drawtype");
55 RNA_def_property_enum_items(prop, prop_drawtype_items);
56 RNA_def_property_ui_text(prop, "Draw Mode", "Radiosity draw modes.");
59 prop= RNA_def_property(srna, "hemi_resolution", PROP_INT, PROP_NONE);
60 RNA_def_property_int_sdna(prop, NULL, "hemires");
61 RNA_def_property_range(prop, 100, 1000);
62 RNA_def_property_ui_text(prop, "Hemi Resolution", "Sets the size of a hemicube.");
64 prop= RNA_def_property(srna, "max_iterations", PROP_INT, PROP_NONE);
65 RNA_def_property_int_sdna(prop, NULL, "maxiter");
66 RNA_def_property_range(prop, 0, 10000);
67 RNA_def_property_ui_text(prop, "Max Iterations", "Limits the maximum number of radiosity rounds.");
69 prop= RNA_def_property(srna, "multiplier", PROP_FLOAT, PROP_NONE);
70 RNA_def_property_float_sdna(prop, NULL, "radfac");
71 RNA_def_property_range(prop, 0.001f, 250.0f);
72 RNA_def_property_ui_text(prop, "Multiplier", "Multiplies the energy values.");
74 prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
75 RNA_def_property_float_sdna(prop, NULL, "gamma");
76 RNA_def_property_range(prop, 0.2f, 10.0f);
77 RNA_def_property_ui_text(prop, "Gamma", "Changes the contrast of the energy values.");
79 prop= RNA_def_property(srna, "convergence", PROP_FLOAT, PROP_NONE);
80 RNA_def_property_float_sdna(prop, NULL, "convergence");
81 RNA_def_property_range(prop, 0.0f, 1.0f);
82 RNA_def_property_ui_text(prop, "Convergence", "Sets the lower threshold of unshot energy.");
84 prop= RNA_def_property(srna, "element_max", PROP_INT, PROP_NONE);
85 RNA_def_property_int_sdna(prop, NULL, "elma");
86 RNA_def_property_range(prop, 1, 500);
87 RNA_def_property_ui_text(prop, "Element Max", "Sets maximum size of an element");
89 prop= RNA_def_property(srna, "element_min", PROP_INT, PROP_NONE);
90 RNA_def_property_int_sdna(prop, NULL, "elmi");
91 RNA_def_property_range(prop, 1, 100);
92 RNA_def_property_ui_text(prop, "Element Min", "Sets minimum size of an element");
94 prop= RNA_def_property(srna, "patch_max", PROP_INT, PROP_NONE);
95 RNA_def_property_int_sdna(prop, NULL, "pama");
96 RNA_def_property_range(prop, 10, 1000);
97 RNA_def_property_ui_text(prop, "Patch Max", "Sets maximum size of a patch.");
99 prop= RNA_def_property(srna, "patch_min", PROP_INT, PROP_NONE);
100 RNA_def_property_int_sdna(prop, NULL, "pami");
101 RNA_def_property_range(prop, 10, 1000);
102 RNA_def_property_ui_text(prop, "Patch Min", "Sets minimum size of a patch.");
104 prop= RNA_def_property(srna, "subshoot_patch", PROP_INT, PROP_NONE);
105 RNA_def_property_int_sdna(prop, NULL, "subshootp");
106 RNA_def_property_range(prop, 0, 10);
107 RNA_def_property_ui_text(prop, "SubShoot Patch", "Sets the number of times the environment is tested to detect paths.");
109 prop= RNA_def_property(srna, "subshoot_element", PROP_INT, PROP_NONE);
110 RNA_def_property_int_sdna(prop, NULL, "subshoote");
111 RNA_def_property_range(prop, 0, 10);
112 RNA_def_property_ui_text(prop, "SubShoot Element", "Sets the number of times the environment is tested to detect elements.");
114 prop= RNA_def_property(srna, "max_elements", PROP_INT, PROP_NONE);
115 RNA_def_property_int_sdna(prop, NULL, "maxnode");
116 RNA_def_property_range(prop, 1, 250000);
117 RNA_def_property_ui_text(prop, "Max Elements", "Sets the maximum allowed number of elements.");
119 prop= RNA_def_property(srna, "max_subdiv_shoot", PROP_INT, PROP_NONE);
120 RNA_def_property_int_sdna(prop, NULL, "maxsublamp");
121 RNA_def_property_range(prop, 1, 250);
122 RNA_def_property_ui_text(prop, "Max Subdiv Shoot", "Sets the maximum number of initial shoot patches that are evaluated");
124 prop= RNA_def_property(srna, "remove_doubles_limit", PROP_INT, PROP_NONE);
125 RNA_def_property_int_sdna(prop, NULL, "nodelim");
126 RNA_def_property_range(prop, 0, 50);
127 RNA_def_property_ui_text(prop, "Remove Doubles Limit", "Sets the range for removing doubles");
130 prop= RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE);
131 RNA_def_property_boolean_sdna(prop, NULL, "flag", RAD_SHOWLIMITS);
132 RNA_def_property_ui_text(prop, "Show Limits", "Draws patch and element limits");
134 prop= RNA_def_property(srna, "show_z", PROP_BOOLEAN, PROP_NONE);
135 RNA_def_property_boolean_sdna(prop, NULL, "flag", RAD_SHOWZ);
136 RNA_def_property_ui_text(prop, "Show Z", "Draws limits differently");