1
2
3 """
4 The Blender.Scene.Radio submodule.
5
6 Radio
7 =====
8
9 This module gives access to B{Scene Radiosity Contexts} in Blender.
10
11 Example::
12 import Blender
13 from Blender import Scene
14
15 # Only the current scene has a radiosity context.
16 # Naturally, any scene can be made the current one
17 # with scene.makeCurrent()
18
19 scn = Scene.GetCurrent()
20
21 # this is the only way to access the radiosity object:
22
23 radio = scn.getRadiosityContext()
24
25 radio.setDrawType('Gouraud')
26 radio.setMode('ShowLimits', 'Z')
27
28 radio.collectMeshes() # prepare patches
29 radio.go() # calculate radiosity
30 Blender.Redraw(-1)
31
32
33 @type Modes: readonly dictionary
34 @var Modes:
35 - ShowLimits
36 - Z
37
38 @type DrawTypes: readonly dictionary
39 @var DrawTypes:
40 - Wire
41 - Solid
42 - Gouraud
43 """
44
46 """
47 The Radiosity object
48 ====================
49 This object wraps the current Scene's radiosity context in Blender.
50 """
51
53 """
54 Start the radiosity simulation. It is necessary to call L{collectMeshes}
55 first.
56 """
57
59 """
60 Convert B{selected} visible meshes to patches for radiosity calculation.
61 @note: L{Object.Object.select} can be used to (un)select objects via
62 bpython.
63 """
64
66 """
67 Release all memory used by radiosity.
68 """
69
71 """
72 Add the new mesh created by the radiosity simulation (see L{go}) to
73 Blender. The radiosity results are stored in this mesh's vertex colors.
74 @note: see L{replaceMeshes} for a destructive alternative.
75 """
76
78 """
79 Replace the original input meshes with the B{one} calculated by the
80 radiosity simulation. The radiosity results are stored in this mesh's
81 vertex colors.
82 @note: see L{addMesh} for a non-destructive alternative.
83 """
84
86 """
87 Subdivide patches (optional, it may improve results).
88 """
89
91 """
92 Force an extra smoothing. This method can be called only after the
93 simulation has been calculated (L{go}).
94 """
95
97 """
98 Filter elements to remove aliasing artifacts. This method can be called
99 only after the simulation has been calculated (L{go}).
100 """
101
103 """
104 Pre-subdivision: detect high-energy patches and subdivide them
105 (optional, it may improve results).
106 """
107
109 """
110 Pre-subdivision: detect high-energy elements (nodes) and subdivide them
111 (optional, it may improve results).
112 """
113
115 """
116 Join elements (nodes) which differ less than the defined element limit.
117 This method can be called only after the simulation has been calculated
118 (L{go}).
119 """
120
122 """
123 Get hemicube size.
124 @rtype: int
125 @return: the current hemicube size.
126 """
127
129 """
130 Set hemicube size. The range is [100, 1000].
131 @type ival: int
132 @param ival: the new size.
133 """
134
136 """
137 Get maximum number of radiosity rounds.
138 @rtype: int
139 @return: the current maxiter value.
140 """
141
143 """
144 Set maximum number of radiosity rounds. The range is [0, 10000].
145 @type ival: int
146 @param ival: the maxiter new value.
147 """
148
150 """
151 Get maximum number of times the environment is tested to detect patches.
152 @rtype: int
153 @return: the current value.
154 """
155
157 """
158 Set the maximum number of times the environment is tested to detect
159 patches. The range is [0, 10].
160 @type ival: int
161 @param ival: the new value.
162 """
163
165 """
166 Get the number of times the environment is tested to detect elements.
167 @rtype: int
168 @return: the current value.
169 """
170
172 """
173 Set number of times the environment is tested to detect elements. The
174 range is [0, 10].
175 @type ival: int
176 @param ival: the new value.
177 """
178
180 """
181 Get the range for removing doubles.
182 @rtype: int
183 @return: the current value.
184 """
185
187 """
188 Set the range for removing doubles. The range is [0, 50].
189 @type ival: int
190 @param ival: the new value.
191 """
192
194 """
195 Get the maximum number of initial shoot patches evaluated.
196 @rtype: int
197 @return: the current value.
198 """
199
201 """
202 Set the maximum number of initial shoot patches evaluated. The range is
203 [1, 250].
204 @type ival: int
205 @param ival: the new value.
206 """
207
209 """
210 Get the maximum size of a patch.
211 @rtype: int
212 @return: the current value.
213 """
214
216 """
217 Set the maximum size of a patch. The range is [10, 1000].
218 @type ival: int
219 @param ival: the new value.
220 """
221
223 """
224 Get the minimum size of a patch.
225 @rtype: int
226 @return: the current value.
227 """
228
230 """
231 Set the minimum size of a patch. The range is [10, 1000].
232 @type ival: int
233 @param ival: the new value.
234 """
235
237 """
238 Get the maximum size of an element.
239 @rtype: int
240 @return: the current value.
241 """
242
244 """
245 Set the maximum size of an element. The range is [1, 100].
246 @type ival: int
247 @param ival: the new value.
248 """
249
251 """
252 Get the minimum size of an element. The range is [1, 100].
253 @rtype: int
254 @return: the current value.
255 """
256
258 """
259 Set the minimum size of an element. The range is [1, 100].
260 @type ival: int
261 @param ival: the new value.
262 """
263
265 """
266 Get the maximum number of elements.
267 @rtype: int
268 @return: the current value.
269 """
270
272 """
273 Set the maximum number of elements. The range is [1, 250000].
274 @type ival: int
275 @param ival: the new value.
276 """
277
279 """
280 Get lower thresholdo of unshot energy.
281 @rtype: float
282 @return: the current value.
283 """
284
286 """
287 Set lower threshold of unshot energy. The range is [0.0, 1.0].
288 @type fval: float
289 @param fval: the new value.
290 """
291
293 """
294 Get the energy value multiplier.
295 @rtype: float
296 @return: the current value.
297 """
298
300 """
301 Set the energy value multiplier. The range is [0.001, 250.0].
302 @type fval: float
303 @param fval: the new value.
304 """
305
307 """
308 Get change in the contrast of energy values.
309 @rtype: float
310 @return: the current value.
311 """
312
314 """
315 Set change in the contrast of energy values. The range is [0.2, 10.0].
316 @type fval: float
317 @param fval: the new value.
318 """
319
321 """
322 Get the draw type: Wire, Solid or Gouraud as an int value, see L{DrawTypes}.
323 @rtype: int
324 @return: the current draw type.
325 """
326
328 """
329 Set the draw type.
330 @type dt: string or int
331 @param dt: either 'Wire', 'Solid' or 'Gouraud' or the equivalent entry in
332 the L{DrawTypes} dictionary.
333 """
334
336 """
337 Get mode as an int (or'ed bitflags), see L{Modes} dictionary.
338 @rtype: int
339 @return: the current value.
340 """
341
342 - def setMode (mode1 = None, mode2 = None):
343 """
344 Set mode flags as strings: 'ShowLimits' and 'Z'. To set one give it as
345 only argument. Strings not passed in are unset, so setMode() unsets
346 both.
347 @type mode1: string
348 @param mode1: optional mode string.
349 @type mode2: string
350 @param mode2: optional mode string.
351 """
352