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_scene_types.h"
36 /* prop_mode needs to be accessible from transform operator */
37 EnumPropertyItem prop_mode_items[] ={
38 {PROP_SMOOTH, "SMOOTH", "Smooth", ""},
39 {PROP_SPHERE, "SPHERE", "Sphere", ""},
40 {PROP_ROOT, "ROOT", "Root", ""},
41 {PROP_SHARP, "SHARP", "Sharp", ""},
42 {PROP_LIN, "LINEAR", "Linear", ""},
43 {PROP_CONST, "CONSTANT", "Constant", ""},
44 {PROP_RANDOM, "RANDOM", "Random", ""},
45 {0, NULL, NULL, NULL}};
49 #include "BKE_context.h"
50 #include "BKE_global.h"
52 PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
54 ListBaseIterator *internal= iter->internal;
56 /* we are actually iterating a Base list, so override get */
57 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
60 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
62 Scene *scene= (Scene*)ptr->data;
65 /* ensure we always have some layer selected */
74 if(values[i]) scene->lay |= (1<<i);
75 else scene->lay &= ~(1<<i);
79 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
81 Scene *data= (Scene*)ptr->data;
82 CLAMP(value, 1, data->r.efra);
86 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
88 Scene *data= (Scene*)ptr->data;
89 CLAMP(value, data->r.sfra, MAXFRAME);
93 static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
95 //Scene *scene= ptr->id.data;
96 //update_for_newframe();
101 void rna_def_sculpt(BlenderRNA *brna)
106 srna= RNA_def_struct(brna, "Sculpt", NULL);
107 RNA_def_struct_nested(brna, srna, "Scene");
108 RNA_def_struct_ui_text(srna, "Sculpt", "");
110 prop= RNA_def_property(srna, "symmetry_x", PROP_BOOLEAN, PROP_NONE);
111 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X);
112 RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis.");
114 prop= RNA_def_property(srna, "symmetry_y", PROP_BOOLEAN, PROP_NONE);
115 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Y);
116 RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis.");
118 prop= RNA_def_property(srna, "symmetry_z", PROP_BOOLEAN, PROP_NONE);
119 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Z);
120 RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis.");
122 prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
123 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_X);
124 RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices.");
126 prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
127 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Y);
128 RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices.");
130 prop= RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
131 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z);
132 RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices.");
134 prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
135 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DRAW_BRUSH);
136 RNA_def_property_ui_text(prop, "Show Brush", "");
138 prop= RNA_def_property(srna, "partial_redraw", PROP_BOOLEAN, PROP_NONE);
139 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DRAW_FAST);
140 RNA_def_property_ui_text(prop, "Partial Redraw", "Optimize sculpting by only refreshing modified faces.");
143 void rna_def_tool_settings(BlenderRNA *brna)
148 srna= RNA_def_struct(brna, "ToolSettings", NULL);
149 RNA_def_struct_nested(brna, srna, "Scene");
150 RNA_def_struct_ui_text(srna, "Tool Settings", "");
152 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
153 RNA_def_property_struct_type(prop, "Sculpt");
154 RNA_def_property_ui_text(prop, "Sculpt", "");
156 prop= RNA_def_property(srna, "vpaint", PROP_POINTER, PROP_NONE);
157 RNA_def_property_struct_type(prop, "VPaint");
158 RNA_def_property_ui_text(prop, "Vertex Paint", "");
160 rna_def_sculpt(brna);
163 void rna_def_scene_render_data(BlenderRNA *brna)
168 static EnumPropertyItem pixel_filter_items[] ={
169 {R_FILTER_BOX, "BOX", "Box", ""},
170 {R_FILTER_TENT, "TENT", "Tent", ""},
171 {R_FILTER_QUAD, "QUADRATIC", "Quadratic", ""},
172 {R_FILTER_CUBIC, "CUBIC", "Cubic", ""},
173 {R_FILTER_CATROM, "CATMULLROM", "Catmull-Rom", ""},
174 {R_FILTER_GAUSS, "GAUSSIAN", "Gaussian", ""},
175 {R_FILTER_MITCH, "MITCHELL", "Mitchell-Netravali", ""},
176 {0, NULL, NULL, NULL}};
178 static EnumPropertyItem alpha_mode_items[] ={
179 {R_ADDSKY, "SKY", "Sky", "Transparent pixels are filled with sky color"},
180 {R_ALPHAPREMUL, "PREMUL", "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
181 {R_ALPHAKEY, "STRAIGHT", "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
182 {0, NULL, NULL, NULL}};
184 static EnumPropertyItem color_mode_items[] ={
185 {R_PLANESBW, "BW", "BW", "Images are saved with BW (grayscale) data"},
186 {R_PLANES24, "RGB", "RGB", "Images are saved with RGB (color) data"},
187 {R_PLANES32, "RGBA", "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
188 {0, NULL, NULL, NULL}};
190 static EnumPropertyItem octree_resolution_items[] = {
191 {64, "OCTREE_RES_64", "64", ""},
192 {128, "OCTREE_RES_128", "128", ""},
193 {256, "OCTREE_RES_256", "256", ""},
194 {512, "OCTREE_RES_512", "512", ""},
195 {0, NULL, NULL, NULL}};
197 static EnumPropertyItem fixed_oversample_items[] = {
198 {5, "OVERSAMPLE_5", "5", ""},
199 {8, "OVERSAMPLE_8", "8", ""},
200 {11, "OVERSAMPLE_11", "11", ""},
201 {16, "OVERSAMPLE_16", "16", ""},
202 {0, NULL, NULL, NULL}};
204 static EnumPropertyItem field_order_items[] = {
205 {0, "FIELDS_EVENFIRST", "Even Fields First", ""},
206 {R_ODDFIELD, "FIELDS_ODDFIRST", "Odd Fields First", ""},
207 {0, NULL, NULL, NULL}};
209 static EnumPropertyItem threads_mode_items[] = {
210 {0, "THREADS_AUTO", "Auto-detect", ""},
211 {R_FIXED_THREADS, "THREADS_FIXED", "Fixed Number", ""},
212 {0, NULL, NULL, NULL}};
214 srna= RNA_def_struct(brna, "SceneRenderData", NULL);
215 RNA_def_struct_sdna(srna, "RenderData");
216 RNA_def_struct_nested(brna, srna, "Scene");
217 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock.");
219 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
220 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
221 RNA_def_property_enum_items(prop, color_mode_items);
222 RNA_def_property_ui_text(prop, "Colour Mode", "What Colour Mode images are saved in (BW, RGB, RGBA)");
224 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
225 RNA_def_property_int_sdna(prop, NULL, "xsch");
226 RNA_def_property_range(prop, 4, 10000);
227 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image.");
228 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
230 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
231 RNA_def_property_int_sdna(prop, NULL, "ysch");
232 RNA_def_property_range(prop, 4, 10000);
233 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image.");
234 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
236 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
237 RNA_def_property_int_sdna(prop, NULL, "size");
238 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
239 RNA_def_property_ui_text(prop, "Resolution %", "Preview scale for render resolution");
241 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
242 RNA_def_property_int_sdna(prop, NULL, "xparts");
243 RNA_def_property_range(prop, 1, 512);
244 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering.");
245 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
247 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
248 RNA_def_property_int_sdna(prop, NULL, "yparts");
249 RNA_def_property_range(prop, 1, 512);
250 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering.");
251 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
253 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
254 RNA_def_property_float_sdna(prop, NULL, "xasp");
255 RNA_def_property_range(prop, 1.0f, 200.0f);
256 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
257 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
259 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
260 RNA_def_property_float_sdna(prop, NULL, "yasp");
261 RNA_def_property_range(prop, 1.0f, 200.0f);
262 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
263 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
265 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
266 RNA_def_property_int_sdna(prop, NULL, "quality");
267 RNA_def_property_range(prop, 1, 100);
268 RNA_def_property_ui_text(prop, "Quality", "Quality setting for JPEG images, AVI Jpeg and SGI movies.");
269 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
271 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
272 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
273 RNA_def_property_range(prop, 1, 120);
274 RNA_def_property_ui_text(prop, "FPS", "Frames per second.");
275 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
277 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
278 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
279 RNA_def_property_range(prop, 0.1f, 120.0f);
280 RNA_def_property_ui_text(prop, "FPS Base", "Frames per second base");
281 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
283 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
284 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
285 RNA_def_property_range(prop, 0.0f, 2.0f);
286 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding.");
287 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
289 prop= RNA_def_property(srna, "pixel_filter", PROP_ENUM, PROP_NONE);
290 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
291 RNA_def_property_enum_items(prop, pixel_filter_items);
292 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining AA samples.");
293 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
295 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
296 RNA_def_property_float_sdna(prop, NULL, "gauss");
297 RNA_def_property_range(prop, 0.5f, 1.5f);
298 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples.");
299 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
301 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
302 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
303 RNA_def_property_enum_items(prop, alpha_mode_items);
304 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels.");
305 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
307 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
308 RNA_def_property_enum_sdna(prop, NULL, "ocres");
309 RNA_def_property_enum_items(prop, octree_resolution_items);
310 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator - use higher resolutions for larger scenes.");
311 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
313 prop= RNA_def_property(srna, "antialiasing", PROP_BOOLEAN, PROP_NONE);
314 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
315 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Renders and combines multiple samples per pixel to prevent aliasing.");
316 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
318 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
319 RNA_def_property_enum_sdna(prop, NULL, "osa");
320 RNA_def_property_enum_items(prop, fixed_oversample_items);
321 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "The number of fixed samples per pixel for anti-aliasing.");
322 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
324 prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
325 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
326 RNA_def_property_ui_text(prop, "Fields", "Renders image to two fields per frame, for interlaced TV display.");
327 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
329 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
330 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
331 RNA_def_property_enum_items(prop, field_order_items);
332 RNA_def_property_ui_text(prop, "Field Order", "");
334 prop= RNA_def_property(srna, "fields_still", PROP_BOOLEAN, PROP_NONE);
335 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
336 RNA_def_property_ui_text(prop, "Fields Still", "Disables the time difference between fields.");
337 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
339 prop= RNA_def_property(srna, "render_shadows", PROP_BOOLEAN, PROP_NONE);
340 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
341 RNA_def_property_ui_text(prop, "Render Shadows", "Calculate shadows while rendering.");
342 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
344 prop= RNA_def_property(srna, "render_envmaps", PROP_BOOLEAN, PROP_NONE);
345 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
346 RNA_def_property_ui_text(prop, "Render Environment Maps", "Calculate environment maps while rendering.");
347 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
349 prop= RNA_def_property(srna, "render_radiosity", PROP_BOOLEAN, PROP_NONE);
350 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
351 RNA_def_property_ui_text(prop, "Render Radiosity", "Calculate radiosity in a pre-process before rendering.");
352 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
354 prop= RNA_def_property(srna, "render_sss", PROP_BOOLEAN, PROP_NONE);
355 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
356 RNA_def_property_ui_text(prop, "Render SSS", "Calculate sub-surface scattering in materials rendering.");
357 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
359 prop= RNA_def_property(srna, "render_raytracing", PROP_BOOLEAN, PROP_NONE);
360 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
361 RNA_def_property_ui_text(prop, "Render Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects.");
362 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
364 prop= RNA_def_property(srna, "render_textures", PROP_BOOLEAN, PROP_NONE);
365 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
366 RNA_def_property_ui_text(prop, "Render Textures", "Use textures to affect material properties.");
367 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
369 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
370 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
371 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
372 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
374 prop= RNA_def_property(srna, "edge_intensity", PROP_INT, PROP_NONE);
375 RNA_def_property_int_sdna(prop, NULL, "edgeint");
376 RNA_def_property_range(prop, 0, 255);
377 RNA_def_property_ui_text(prop, "Edge Intensity", "Threshold for drawing outlines on geometry edges");
378 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
380 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
381 RNA_def_property_float_sdna(prop, NULL, "edgeR");
382 RNA_def_property_array(prop, 3);
383 RNA_def_property_ui_text(prop, "Edge Color", "");
384 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
386 prop= RNA_def_property(srna, "panorama", PROP_BOOLEAN, PROP_NONE);
387 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_PANORAMA);
388 RNA_def_property_ui_text(prop, "Panorama", "Render the scene with a cylindrical camera for pseudo-fisheye lens effects");
389 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
391 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
392 RNA_def_property_int_sdna(prop, NULL, "threads");
393 RNA_def_property_range(prop, 1, 8);
394 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
395 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
397 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
398 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
399 RNA_def_property_enum_items(prop, threads_mode_items);
400 RNA_def_property_ui_text(prop, "Threads Mode", "");
402 prop= RNA_def_property(srna, "motion_blur", PROP_BOOLEAN, PROP_NONE);
403 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
404 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur (uses number of anti-aliasing samples).");
405 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
407 prop= RNA_def_property(srna, "border", PROP_BOOLEAN, PROP_NONE);
408 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
409 RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size.");
410 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
412 prop= RNA_def_property(srna, "crop_to_border", PROP_BOOLEAN, PROP_NONE);
413 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
414 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size.");
415 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
417 prop= RNA_def_property(srna, "placeholders", PROP_BOOLEAN, PROP_NONE);
418 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
419 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch').");
420 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
422 prop= RNA_def_property(srna, "no_overwrite", PROP_BOOLEAN, PROP_NONE);
423 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
424 RNA_def_property_ui_text(prop, "No Overwrite", "Skip and don't overwrite existing files while rendering");
425 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
427 prop= RNA_def_property(srna, "do_composite", PROP_BOOLEAN, PROP_NONE);
428 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
429 RNA_def_property_ui_text(prop, "Do Composite", "Process the render result through the compositing pipeline");
430 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
432 prop= RNA_def_property(srna, "do_sequence", PROP_BOOLEAN, PROP_NONE);
433 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
434 RNA_def_property_ui_text(prop, "Do Sequence", "Process the render (and composited) result through the video sequence editor pipeline");
435 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
437 prop= RNA_def_property(srna, "file_extensions", PROP_BOOLEAN, PROP_NONE);
438 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
439 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
440 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
442 prop= RNA_def_property(srna, "free_image_textures", PROP_BOOLEAN, PROP_NONE);
443 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
444 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing.");
445 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
447 prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE);
448 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
449 RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and used SceneNodes to files in the temp directory (saves memory, allows Full Sampling).");
450 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
452 prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE);
453 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
454 RNA_def_property_ui_text(prop, "Full Sample","Saves for every OSA sample the entire RenderLayer results (Higher quality sampling but slower).");
455 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
457 prop= RNA_def_property(srna, "backbuf", PROP_BOOLEAN, PROP_NONE);
458 RNA_def_property_boolean_sdna(prop, NULL, "bufflag", R_BACKBUF);
459 RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image");
460 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
464 void RNA_def_scene(BlenderRNA *brna)
468 static EnumPropertyItem unwrapper_items[] = {
469 {0, "CONFORMAL", "Conformal", ""},
470 {1, "ANGLEBASED", "Angle Based", ""},
471 {0, NULL, NULL, NULL}};
473 srna= RNA_def_struct(brna, "Scene", "ID");
474 RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings.");
476 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
477 RNA_def_property_flag(prop, PROP_EDITABLE);
478 RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene.");
480 prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
481 RNA_def_property_flag(prop, PROP_EDITABLE);
482 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene.");
484 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_VECTOR);
485 RNA_def_property_float_sdna(prop, NULL, "cursor");
486 RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location.");
487 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
489 prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
490 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
491 RNA_def_property_struct_type(prop, "Object");
492 RNA_def_property_ui_text(prop, "Objects", "");
493 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0);
495 prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE);
496 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
497 RNA_def_property_array(prop, 20);
498 RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene.");
499 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
501 prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE);
502 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
503 RNA_def_property_enum_items(prop, prop_mode_items);
504 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode.");
506 prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_NONE);
507 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
508 RNA_def_property_int_sdna(prop, NULL, "r.cfra");
509 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
510 RNA_def_property_ui_text(prop, "Current Frame", "");
511 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
513 prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
514 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
515 RNA_def_property_int_sdna(prop, NULL, "r.sfra");
516 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
517 RNA_def_property_ui_text(prop, "Start Frame", "");
518 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
520 prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
521 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
522 RNA_def_property_int_sdna(prop, NULL, "r.efra");
523 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
524 RNA_def_property_ui_text(prop, "End Frame", "");
525 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
527 prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
528 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
529 RNA_def_property_int_sdna(prop, NULL, "frame_step");
530 RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
531 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
533 prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
534 RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
535 RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping.");
536 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
538 prop= RNA_def_property(srna, "unwrapper", PROP_ENUM, PROP_NONE);
539 RNA_def_property_enum_sdna(prop, NULL, "toolsettings->unwrapper");
540 RNA_def_property_enum_items(prop, unwrapper_items);
541 RNA_def_property_ui_text(prop, "Unwrapper", "Unwrap algorithm used by the Unwrap tool.");
543 prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
544 RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree.");
546 prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
547 RNA_def_property_pointer_sdna(prop, NULL, "ed");
548 RNA_def_property_struct_type(prop, "SequenceEditor");
549 RNA_def_property_ui_text(prop, "Sequence Editor", "");
551 prop= RNA_def_property(srna, "radiosity", PROP_POINTER, PROP_NONE);
552 RNA_def_property_pointer_sdna(prop, NULL, "radio");
553 RNA_def_property_ui_text(prop, "Radiosity", "");
555 prop= RNA_def_property(srna, "keyingsets", PROP_COLLECTION, PROP_NONE);
556 RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
557 RNA_def_property_struct_type(prop, "KeyingSet");
558 RNA_def_property_ui_text(prop, "Keying Sets", "Keying Sets for this Scene.");
560 prop= RNA_def_property(srna, "active_keyingset", PROP_INT, PROP_NONE);
561 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
562 RNA_def_property_ui_text(prop, "Active Keying Set", "Current Keying Set index.");
564 prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
565 RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
566 RNA_def_property_struct_type(prop, "ToolSettings");
567 RNA_def_property_ui_text(prop, "Tool Settings", "");
569 prop= RNA_def_property(srna, "render_data", PROP_POINTER, PROP_NONE);
570 RNA_def_property_pointer_sdna(prop, NULL, "r");
571 RNA_def_property_struct_type(prop, "SceneRenderData");
572 RNA_def_property_ui_text(prop, "Render Data", "");
574 prop= RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
575 RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
576 RNA_def_property_struct_type(prop, "TimelineMarker");
577 RNA_def_property_ui_text(prop, "Timeline Markers", "Markers used in all timelines for the current scene.");
579 rna_def_tool_settings(brna);
580 rna_def_scene_render_data(brna);