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"
35 #include "BKE_writeffmpeg.h"
36 #include <libavcodec/avcodec.h>
37 #include <libavformat/avformat.h>
42 /* prop_mode needs to be accessible from transform operator */
43 EnumPropertyItem prop_mode_items[] ={
44 {PROP_SMOOTH, "SMOOTH", 0, "Smooth", ""},
45 {PROP_SPHERE, "SPHERE", 0, "Sphere", ""},
46 {PROP_ROOT, "ROOT", 0, "Root", ""},
47 {PROP_SHARP, "SHARP", 0, "Sharp", ""},
48 {PROP_LIN, "LINEAR", 0, "Linear", ""},
49 {PROP_CONST, "CONSTANT", 0, "Constant", ""},
50 {PROP_RANDOM, "RANDOM", 0, "Random", ""},
51 {0, NULL, 0, NULL, NULL}};
55 #include "DNA_node_types.h"
57 #include "BKE_context.h"
58 #include "BKE_global.h"
61 #include "BLI_threads.h"
63 #include "RE_pipeline.h"
65 PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
67 ListBaseIterator *internal= iter->internal;
69 /* we are actually iterating a Base list, so override get */
70 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
73 static int layer_set(int lay, const int *values)
77 /* ensure we always have some layer selected */
86 if(values[i]) lay |= (1<<i);
93 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
95 Scene *scene= (Scene*)ptr->data;
97 scene->lay= layer_set(scene->lay, values);
100 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
102 Scene *data= (Scene*)ptr->data;
103 CLAMP(value, 1, data->r.efra);
107 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
109 Scene *data= (Scene*)ptr->data;
110 CLAMP(value, data->r.sfra, MAXFRAME);
114 static int rna_Scene_use_preview_range_get(PointerRNA *ptr)
116 Scene *data= (Scene*)ptr->data;
118 /* this is simply overloaded to assume that preview-range
119 * start frame cannot be less than 1 when on,
120 * so psfra=0 means 'off'
122 return (data->r.psfra != 0);
125 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
127 Scene *data= (Scene*)ptr->data;
129 /* if enable, copy range from render-range, otherwise just clear */
131 data->r.psfra= data->r.sfra;
132 data->r.pefra= data->r.efra;
139 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
141 Scene *data= (Scene*)ptr->data;
143 /* check if enabled already */
144 if (data->r.psfra == 0) {
145 /* set end of preview range to end frame, then clamp as per normal */
146 // TODO: or just refuse to set instead?
147 data->r.pefra= data->r.efra;
150 /* now set normally */
151 CLAMP(value, 1, data->r.pefra);
152 data->r.psfra= value;
155 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
157 Scene *data= (Scene*)ptr->data;
159 /* check if enabled already */
160 if (data->r.psfra == 0) {
161 /* set start of preview range to start frame, then clamp as per normal */
162 // TODO: or just refuse to set instead?
163 data->r.psfra= data->r.sfra;
166 /* now set normally */
167 CLAMP(value, data->r.psfra, MAXFRAME);
168 data->r.pefra= value;
171 static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
173 //Scene *scene= ptr->id.data;
174 //ED_update_for_newframe(C);
177 static int rna_SceneRenderData_threads_get(PointerRNA *ptr)
179 RenderData *rd= (RenderData*)ptr->data;
181 if(rd->mode & R_FIXED_THREADS)
184 return BLI_system_thread_count();
187 static int rna_SceneRenderData_save_buffers_get(PointerRNA *ptr)
189 RenderData *rd= (RenderData*)ptr->data;
191 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
194 static void rna_SceneRenderData_file_format_set(PointerRNA *ptr, int value)
196 RenderData *rd= (RenderData*)ptr->data;
200 ffmpeg_verify_image_type(rd);
204 static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr)
206 RenderData *rd= (RenderData*)ptr->data;
210 static void rna_SceneRenderData_active_layer_index_set(PointerRNA *ptr, int value)
212 RenderData *rd= (RenderData*)ptr->data;
216 static void rna_SceneRenderData_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
218 RenderData *rd= (RenderData*)ptr->data;
221 *max= BLI_countlist(&rd->layers)-1;
225 static void rna_SceneRenderData_engine_set(PointerRNA *ptr, int value)
227 RenderData *rd= (RenderData*)ptr->data;
228 RenderEngineType *type= BLI_findlink(&R_engines, value);
231 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
234 static EnumPropertyItem *rna_SceneRenderData_engine_itemf(bContext *C, PointerRNA *ptr, int *free)
236 RenderEngineType *type;
237 EnumPropertyItem *item= NULL;
238 EnumPropertyItem tmp = {0, "", 0, "", ""};
241 for(type=R_engines.first; type; type=type->next, a++) {
243 tmp.identifier= type->idname;
244 tmp.name= type->name;
245 RNA_enum_item_add(&item, &totitem, &tmp);
248 RNA_enum_item_end(&item, &totitem);
254 static int rna_SceneRenderData_engine_get(PointerRNA *ptr)
256 RenderData *rd= (RenderData*)ptr->data;
257 RenderEngineType *type;
260 for(type=R_engines.first; type; type=type->next, a++)
261 if(strcmp(type->idname, rd->engine) == 0)
267 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
269 Scene *scene= (Scene*)ptr->id.data;
270 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
272 BLI_strncpy(rl->name, value, sizeof(rl->name));
274 if(scene->nodetree) {
276 int index= BLI_findindex(&scene->r.layers, rl);
278 for(node= scene->nodetree->nodes.first; node; node= node->next) {
279 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
280 if(node->custom1==index)
281 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
287 static int rna_SceneRenderData_multiple_engines_get(PointerRNA *ptr)
289 return (BLI_countlist(&R_engines) > 1);
292 static int rna_SceneRenderData_use_game_engine_get(PointerRNA *ptr)
294 RenderData *rd= (RenderData*)ptr->data;
295 RenderEngineType *type;
297 for(type=R_engines.first; type; type=type->next)
298 if(strcmp(type->idname, rd->engine) == 0)
299 return (type->flag & RE_GAME);
304 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
306 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
307 rl->lay= layer_set(rl->lay, values);
310 static void rna_SceneRenderLayer_zmask_layer_set(PointerRNA *ptr, const int *values)
312 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
313 rl->lay_zmask= layer_set(rl->lay_zmask, values);
316 static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr)
318 Scene *scene= (Scene*)ptr->id.data;
321 ntreeCompositForceHidden(scene->nodetree, scene);
326 static void rna_def_sculpt(BlenderRNA *brna)
331 srna= RNA_def_struct(brna, "Sculpt", NULL);
332 RNA_def_struct_nested(brna, srna, "Scene");
333 RNA_def_struct_ui_text(srna, "Sculpt", "");
335 prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
336 RNA_def_property_struct_type(prop, "Brush");
337 RNA_def_property_ui_text(prop, "Brush", "");
339 prop= RNA_def_property(srna, "symmetry_x", PROP_BOOLEAN, PROP_NONE);
340 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X);
341 RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis.");
343 prop= RNA_def_property(srna, "symmetry_y", PROP_BOOLEAN, PROP_NONE);
344 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Y);
345 RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis.");
347 prop= RNA_def_property(srna, "symmetry_z", PROP_BOOLEAN, PROP_NONE);
348 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Z);
349 RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis.");
351 prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
352 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_X);
353 RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices.");
355 prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
356 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Y);
357 RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices.");
359 prop= RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
360 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z);
361 RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices.");
363 prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
364 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DRAW_BRUSH);
365 RNA_def_property_ui_text(prop, "Show Brush", "");
367 prop= RNA_def_property(srna, "partial_redraw", PROP_BOOLEAN, PROP_NONE);
368 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DRAW_FAST);
369 RNA_def_property_ui_text(prop, "Partial Redraw", "Optimize sculpting by only refreshing modified faces.");
372 static void rna_def_tool_settings(BlenderRNA *brna)
377 static EnumPropertyItem uv_select_mode_items[] = {
378 {UV_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."},
379 {UV_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."},
380 {UV_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."},
381 {UV_SELECT_ISLAND, "ISLAND", ICON_LINKEDSEL, "Island", "Island selection mode."},
382 {0, NULL, 0, NULL, NULL}};
384 static EnumPropertyItem mesh_select_mode_items[] = {
385 {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."},
386 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."},
387 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."},
388 {0, NULL, 0, NULL, NULL}};
390 static EnumPropertyItem snap_element_items[] = {
391 {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices."},
392 {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges."},
393 {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces."},
394 {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume."},
395 {0, NULL, 0, NULL, NULL}};
397 static EnumPropertyItem snap_mode_items[] = {
398 {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target."},
399 {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target."},
400 {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target."},
401 {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target."},
402 {0, NULL, 0, NULL, NULL}};
404 srna= RNA_def_struct(brna, "ToolSettings", NULL);
405 RNA_def_struct_ui_text(srna, "Tool Settings", "");
407 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
408 RNA_def_property_struct_type(prop, "Sculpt");
409 RNA_def_property_ui_text(prop, "Sculpt", "");
411 prop= RNA_def_property(srna, "vpaint", PROP_POINTER, PROP_NONE);
412 RNA_def_property_struct_type(prop, "VPaint");
413 RNA_def_property_ui_text(prop, "Vertex Paint", "");
415 prop= RNA_def_property(srna, "wpaint", PROP_POINTER, PROP_NONE);
416 RNA_def_property_struct_type(prop, "VPaint");
417 RNA_def_property_ui_text(prop, "Weight Paint", "");
420 prop= RNA_def_property(srna, "proportional_editing", PROP_BOOLEAN, PROP_NONE);
421 RNA_def_property_boolean_sdna(prop, NULL, "proportional", 0);
422 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode.");
424 prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE);
425 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
426 RNA_def_property_enum_items(prop, prop_mode_items);
427 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode.");
429 prop= RNA_def_property(srna, "automerge_editing", PROP_BOOLEAN, PROP_NONE);
430 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
431 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location.");
433 prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE);
434 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
435 RNA_def_property_ui_text(prop, "Snap", "Snap while Ctrl is held during transform.");
436 RNA_def_property_ui_icon(prop, ICON_SNAP_GEAR, 1);
438 prop= RNA_def_property(srna, "snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
439 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
440 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target.");
441 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
443 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
444 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
445 RNA_def_property_enum_items(prop, snap_element_items);
446 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to.");
448 prop= RNA_def_property(srna, "snap_mode", PROP_ENUM, PROP_NONE);
449 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
450 RNA_def_property_enum_items(prop, snap_mode_items);
451 RNA_def_property_ui_text(prop, "Snap Mode", "Which part to snap onto the target.");
453 prop= RNA_def_property(srna, "snap_peel_object", PROP_BOOLEAN, PROP_NONE);
454 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
455 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center.");
456 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
459 prop= RNA_def_property(srna, "uv_selection_mode", PROP_ENUM, PROP_NONE);
460 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
461 RNA_def_property_enum_items(prop, uv_select_mode_items);
462 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode.");
464 prop= RNA_def_property(srna, "uv_sync_selection", PROP_BOOLEAN, PROP_NONE);
465 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
466 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync.");
467 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
469 prop= RNA_def_property(srna, "uv_local_view", PROP_BOOLEAN, PROP_NONE);
470 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
471 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned.");
474 prop= RNA_def_property(srna, "mesh_selection_mode", PROP_ENUM, PROP_NONE);
475 RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
476 RNA_def_property_enum_items(prop, mesh_select_mode_items);
477 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Mesh selection and display mode.");
479 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_PERCENTAGE);
480 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
481 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups.");
484 rna_def_sculpt(brna);
487 void rna_def_render_layer_common(StructRNA *srna, int scene)
491 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
492 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
493 else RNA_def_property_string_sdna(prop, NULL, "name");
494 RNA_def_property_ui_text(prop, "Name", "Render layer name.");
495 RNA_def_struct_name_property(srna, prop);
496 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
497 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
499 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
500 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
501 RNA_def_property_struct_type(prop, "Material");
502 RNA_def_property_flag(prop, PROP_EDITABLE);
503 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer.");
504 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
505 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
507 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
508 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
509 RNA_def_property_struct_type(prop, "Group");
510 RNA_def_property_flag(prop, PROP_EDITABLE);
511 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer.");
512 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
513 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
516 prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE);
517 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
518 RNA_def_property_array(prop, 20);
519 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer.");
520 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
521 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
522 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
523 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
525 prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_NONE);
526 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
527 RNA_def_property_array(prop, 20);
528 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers.");
529 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_zmask_layer_set");
530 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_zmask_layer_set");
531 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
532 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
535 prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
536 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
537 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer.");
538 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
539 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
541 prop= RNA_def_property(srna, "zmask", PROP_BOOLEAN, PROP_NONE);
542 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
543 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values.");
544 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
545 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
547 prop= RNA_def_property(srna, "zmask_negate", PROP_BOOLEAN, PROP_NONE);
548 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
549 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front.");
550 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
551 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
553 prop= RNA_def_property(srna, "all_z", PROP_BOOLEAN, PROP_NONE);
554 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
555 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking.");
556 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
557 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
559 prop= RNA_def_property(srna, "solid", PROP_BOOLEAN, PROP_NONE);
560 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
561 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer.");
562 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
563 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
565 prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
566 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
567 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid).");
568 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
569 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
571 prop= RNA_def_property(srna, "ztransp", PROP_BOOLEAN, PROP_NONE);
572 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
573 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos).");
574 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
575 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
577 prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
578 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
579 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer.");
580 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
581 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
583 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
584 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
585 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces).");
586 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
587 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
589 prop= RNA_def_property(srna, "strand", PROP_BOOLEAN, PROP_NONE);
590 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
591 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer.");
592 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
593 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
596 prop= RNA_def_property(srna, "pass_combined", PROP_BOOLEAN, PROP_NONE);
597 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
598 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer.");
599 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
600 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
602 prop= RNA_def_property(srna, "pass_z", PROP_BOOLEAN, PROP_NONE);
603 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
604 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass.");
605 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
606 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
608 prop= RNA_def_property(srna, "pass_vector", PROP_BOOLEAN, PROP_NONE);
609 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
610 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass.");
611 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
612 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
614 prop= RNA_def_property(srna, "pass_normal", PROP_BOOLEAN, PROP_NONE);
615 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
616 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass.");
617 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
618 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
620 prop= RNA_def_property(srna, "pass_uv", PROP_BOOLEAN, PROP_NONE);
621 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
622 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass.");
623 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
624 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
626 prop= RNA_def_property(srna, "pass_mist", PROP_BOOLEAN, PROP_NONE);
627 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
628 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0).");
629 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
630 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
632 prop= RNA_def_property(srna, "pass_object_index", PROP_BOOLEAN, PROP_NONE);
633 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
634 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass.");
635 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
636 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
638 prop= RNA_def_property(srna, "pass_color", PROP_BOOLEAN, PROP_NONE);
639 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
640 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass.");
641 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
642 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
644 prop= RNA_def_property(srna, "pass_diffuse", PROP_BOOLEAN, PROP_NONE);
645 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
646 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass.");
647 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
648 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
650 prop= RNA_def_property(srna, "pass_specular", PROP_BOOLEAN, PROP_NONE);
651 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
652 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass.");
653 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
654 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
656 prop= RNA_def_property(srna, "pass_shadow", PROP_BOOLEAN, PROP_NONE);
657 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
658 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass.");
659 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
660 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
662 prop= RNA_def_property(srna, "pass_ao", PROP_BOOLEAN, PROP_NONE);
663 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
664 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass.");
665 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
666 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
668 prop= RNA_def_property(srna, "pass_reflection", PROP_BOOLEAN, PROP_NONE);
669 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
670 RNA_def_property_ui_text(prop, "Reflection", "Deliver ratraced reflection pass.");
671 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
672 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
674 prop= RNA_def_property(srna, "pass_refraction", PROP_BOOLEAN, PROP_NONE);
675 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
676 RNA_def_property_ui_text(prop, "Refraction", "Deliver ratraced refraction pass.");
677 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
678 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
680 prop= RNA_def_property(srna, "pass_specular_exclude", PROP_BOOLEAN, PROP_NONE);
681 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
682 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined.");
683 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
684 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
686 prop= RNA_def_property(srna, "pass_shadow_exclude", PROP_BOOLEAN, PROP_NONE);
687 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
688 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined.");
689 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
690 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
692 prop= RNA_def_property(srna, "pass_ao_exclude", PROP_BOOLEAN, PROP_NONE);
693 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
694 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined.");
695 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
696 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
698 prop= RNA_def_property(srna, "pass_reflection_exclude", PROP_BOOLEAN, PROP_NONE);
699 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
700 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude ratraced reflection pass from combined.");
701 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
702 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
704 prop= RNA_def_property(srna, "pass_refraction_exclude", PROP_BOOLEAN, PROP_NONE);
705 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
706 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude ratraced refraction pass from combined.");
707 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
708 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
711 void rna_def_scene_game_data(BlenderRNA *brna)
716 static EnumPropertyItem framing_types_items[] ={
717 {SCE_GAMEFRAMING_BARS, "BARS", 0, "Stretch", ""},
718 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", ""},
719 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", ""},
720 {0, NULL, 0, NULL, NULL}};
722 static EnumPropertyItem dome_modes_items[] ={
723 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
724 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
725 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
726 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
727 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
728 {0, NULL, 0, NULL, NULL}};
730 static EnumPropertyItem stereo_modes_items[] ={
731 // {STEREO_NOSTEREO, "NO_STEREO", 0, "No Stereo", ""},
732 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
733 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
734 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
735 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
736 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
737 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
738 // {STEREO_DOME, "DOME", 0, "Dome", ""},
739 {0, NULL, 0, NULL, NULL}};
741 static EnumPropertyItem stereo_items[] ={
742 {STEREO_NOSTEREO, "NO_STEREO", 0, "No Stereo", ""},
743 {STEREO_ENABLED, "STEREO", 0, "Stereo", ""},
744 {STEREO_DOME, "DOME", 0, "Dome", ""},
745 {0, NULL, 0, NULL, NULL}};
747 static EnumPropertyItem physics_engine_items[] = {
748 {WOPHY_NONE, "NONE", 0, "None", ""},
749 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
750 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
751 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
752 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
753 {WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
754 {0, NULL, 0, NULL, NULL}};
756 srna= RNA_def_struct(brna, "SceneGameData", NULL);
757 RNA_def_struct_sdna(srna, "GameData");
758 RNA_def_struct_nested(brna, srna, "Scene");
759 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock.");
761 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
762 RNA_def_property_int_sdna(prop, NULL, "xplay");
763 RNA_def_property_range(prop, 4, 10000);
764 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen.");
765 RNA_def_property_update(prop, NC_SCENE, NULL);
767 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
768 RNA_def_property_int_sdna(prop, NULL, "yplay");
769 RNA_def_property_range(prop, 4, 10000);
770 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen.");
771 RNA_def_property_update(prop, NC_SCENE, NULL);
773 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
774 RNA_def_property_int_sdna(prop, NULL, "depth");
775 RNA_def_property_range(prop, 8, 32);
776 RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display.");
777 RNA_def_property_update(prop, NC_SCENE, NULL);
779 // Do we need it here ? (since we already have it in World
780 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
781 RNA_def_property_int_sdna(prop, NULL, "freqplay");
782 RNA_def_property_range(prop, 4, 2000);
783 RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display.");
784 RNA_def_property_update(prop, NC_SCENE, NULL);
786 prop= RNA_def_property(srna, "fullscreen", PROP_BOOLEAN, PROP_NONE);
787 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
788 RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
789 RNA_def_property_update(prop, NC_SCENE, NULL);
792 prop= RNA_def_property(srna, "framing_type", PROP_ENUM, PROP_NONE);
793 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
794 RNA_def_property_enum_items(prop, framing_types_items);
795 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want.");
796 RNA_def_property_update(prop, NC_SCENE, NULL);
798 prop= RNA_def_property(srna, "framing_color", PROP_FLOAT, PROP_COLOR);
799 RNA_def_property_float_sdna(prop, NULL, "framing.col");
800 RNA_def_property_array(prop, 3);
801 RNA_def_property_ui_text(prop, "", "");
802 RNA_def_property_update(prop, NC_SCENE, NULL);
805 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
806 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
807 RNA_def_property_enum_items(prop, stereo_items);
808 RNA_def_property_ui_text(prop, "Stereo Options", "");
809 RNA_def_property_update(prop, NC_SCENE, NULL);
811 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
812 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
813 RNA_def_property_enum_items(prop, stereo_modes_items);
814 RNA_def_property_ui_text(prop, "Stereo Mode", "");
815 RNA_def_property_update(prop, NC_SCENE, NULL);
818 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
819 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
820 RNA_def_property_enum_items(prop, dome_modes_items);
821 RNA_def_property_ui_text(prop, "Dome Mode", "");
822 RNA_def_property_update(prop, NC_SCENE, NULL);
824 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
825 RNA_def_property_int_sdna(prop, NULL, "dome.res");
826 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
827 RNA_def_property_ui_text(prop, "Tesselation", "Tesselation level - check the generated mesh in wireframe mode");
828 RNA_def_property_update(prop, NC_SCENE, NULL);
830 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
831 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
832 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
833 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
834 RNA_def_property_update(prop, NC_SCENE, NULL);
836 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
837 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
838 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
839 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
840 RNA_def_property_update(prop, NC_SCENE, NULL);
842 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
843 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
844 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
845 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
846 RNA_def_property_update(prop, NC_SCENE, NULL);
848 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
849 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
850 RNA_def_property_struct_type(prop, "Text");
851 RNA_def_property_flag(prop, PROP_EDITABLE);
852 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
853 RNA_def_property_update(prop, NC_SCENE, NULL);
856 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
857 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
858 RNA_def_property_enum_items(prop, physics_engine_items);
859 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine.");
860 RNA_def_property_update(prop, NC_SCENE, NULL);
862 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_NONE);
863 RNA_def_property_float_sdna(prop, NULL, "gravity");
864 RNA_def_property_range(prop, 0.0, 25.0);
865 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine.");
866 RNA_def_property_update(prop, NC_SCENE, NULL);
868 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_FLOAT, PROP_NONE);
869 RNA_def_property_float_sdna(prop, NULL, "occlusionRes");
870 RNA_def_property_range(prop, 128.0, 1024.0);
871 RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precsion (slower)");
872 RNA_def_property_update(prop, NC_SCENE, NULL);
874 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
875 RNA_def_property_int_sdna(prop, NULL, "ticrate");
876 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
877 RNA_def_property_range(prop, 1, 250);
878 RNA_def_property_ui_text(prop, "Frames Per Second", "The nominal number of game frames per second. Physics fixed timestep = 1/fps, independently of actual frame rate.");
879 RNA_def_property_update(prop, NC_SCENE, NULL);
881 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
882 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
883 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
884 RNA_def_property_range(prop, 1, 5);
885 RNA_def_property_ui_text(prop, "Max Logic Steps", "Sets the maximum number of logic frame per game frame if graphics slows down the game, higher value allows better synchronization with physics");
886 RNA_def_property_update(prop, NC_SCENE, NULL);
888 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
889 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
890 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
891 RNA_def_property_range(prop, 1, 5);
892 RNA_def_property_ui_text(prop, "Max Physics Steps", "Sets the maximum number of physics step per game frame if graphics slows down the game, higher value allows physics to keep up with realtime");
893 RNA_def_property_update(prop, NC_SCENE, NULL);
895 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
896 RNA_def_property_int_sdna(prop, NULL, "physubstep");
897 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
898 RNA_def_property_range(prop, 1, 5);
899 RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
900 RNA_def_property_update(prop, NC_SCENE, NULL);
903 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
904 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
905 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustrum and occlusion culling");
906 RNA_def_property_update(prop, NC_SCENE, NULL);
908 // not used // deprecated !!!!!!!!!!!!!
909 prop= RNA_def_property(srna, "activity_culling", PROP_BOOLEAN, PROP_NONE);
910 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
911 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
912 RNA_def_property_update(prop, NC_SCENE, NULL);
914 // not used // deprecated !!!!!!!!!!!!!
915 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
916 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
917 RNA_def_property_range(prop, 0.0, 1000.0);
918 RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
919 RNA_def_property_update(prop, NC_SCENE, NULL);
922 static void rna_def_scene_render_layer(BlenderRNA *brna)
926 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
927 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer.");
929 rna_def_render_layer_common(srna, 1);
932 static void rna_def_scene_render_data(BlenderRNA *brna)
937 static EnumPropertyItem pixel_filter_items[] ={
938 {R_FILTER_BOX, "BOX", 0, "Box", ""},
939 {R_FILTER_TENT, "TENT", 0, "Tent", ""},
940 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""},
941 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""},
942 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""},
943 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""},
944 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""},
945 {0, NULL, 0, NULL, NULL}};
947 static EnumPropertyItem alpha_mode_items[] ={
948 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
949 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
950 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
951 {0, NULL, 0, NULL, NULL}};
953 static EnumPropertyItem color_mode_items[] ={
954 {R_PLANESBW, "BW", 0, "BW", "Images are saved with BW (grayscale) data"},
955 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
956 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
957 {0, NULL, 0, NULL, NULL}};
959 static EnumPropertyItem display_mode_items[] ={
960 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
961 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
962 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
963 {0, NULL, 0, NULL, NULL}};
965 static EnumPropertyItem octree_resolution_items[] = {
966 {64, "OCTREE_RES_64", 0, "64", ""},
967 {128, "OCTREE_RES_128", 0, "128", ""},
968 {256, "OCTREE_RES_256", 0, "256", ""},
969 {512, "OCTREE_RES_512", 0, "512", ""},
970 {0, NULL, 0, NULL, NULL}};
972 static EnumPropertyItem fixed_oversample_items[] = {
973 {5, "OVERSAMPLE_5", 0, "5", ""},
974 {8, "OVERSAMPLE_8", 0, "8", ""},
975 {11, "OVERSAMPLE_11", 0, "11", ""},
976 {16, "OVERSAMPLE_16", 0, "16", ""},
977 {0, NULL, 0, NULL, NULL}};
979 static EnumPropertyItem field_order_items[] = {
980 {0, "FIELDS_EVENFIRST", 0, "Even", "Even Fields First"},
981 {R_ODDFIELD, "FIELDS_ODDFIRST", 0, "Odd", "Odd Fields First"},
982 {0, NULL, 0, NULL, NULL}};
984 static EnumPropertyItem threads_mode_items[] = {
985 {0, "THREADS_AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
986 {R_FIXED_THREADS, "THREADS_FIXED", 0, "Fixed", "Manually determine the number of threads"},
987 {0, NULL, 0, NULL, NULL}};
989 static EnumPropertyItem stamp_font_size_items[] = {
990 {1, "STAMP_FONT_TINY", 0, "Tiny", ""},
991 {2, "STAMP_FONT_SMALL", 0, "Small", ""},
992 {3, "STAMP_FONT_MEDIUM", 0, "Medium", ""},
993 {0, "STAMP_FONT_LARGE", 0, "Large", ""},
994 {4, "STAMP_FONT_EXTRALARGE", 0, "Extra Large", ""},
995 {0, NULL, 0, NULL, NULL}};
998 static EnumPropertyItem image_type_items[] = {
999 {R_PNG, "PNG", 0, "PNG", ""},
1000 {R_JPEG90, "JPEG", 0, "JPEG", ""},
1001 #ifdef WITH_OPENJPEG
1002 {R_JP2, "JPEG2000", 0, "JPEG 2000", ""},
1004 {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff
1005 {R_BMP, "BMP", 0, "BMP", ""},
1006 {R_TARGA, "TARGA", 0, "Targa", ""},
1007 {R_RAWTGA, "RAWTARGA", 0, "Targa Raw", ""},
1008 //{R_DDS, "DDS", 0, "DDS", ""}, // XXX not yet implemented
1009 {R_HAMX, "HAMX", 0, "HamX", ""},
1010 {R_IRIS, "IRIS", 0, "Iris", ""},
1011 {0, "", 0, NULL, NULL},
1013 {R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""},
1014 {R_MULTILAYER, "MULTILAYER", 0, "MultiLayer", ""},
1016 {R_RADHDR, "RADHDR", 0, "Radiance HDR", ""},
1017 {R_CINEON, "CINEON", 0, "Cineon", ""},
1018 {R_DPX, "DPX", 0, "DPX", ""},
1019 {0, "", 0, NULL, NULL},
1020 {R_AVIRAW, "AVIRAW", 0, "AVI Raw", ""},
1021 {R_AVIJPEG, "AVIJPEG", 0, "AVI JPEG", ""},
1023 {R_AVICODEC, "AVICODEC", 0, "AVI Codec", ""},
1025 #ifdef WITH_QUICKTIME
1026 {R_QUICKTIME, "QUICKTIME", 0, "QuickTime", ""},
1029 {R_MOVIE, "MOVIE", 0, "Movie", ""},
1032 {R_H264, "H264", 0, "H.264", ""},
1033 {R_XVID, "XVID", 0, "Xvid", ""},
1037 {R_THEORA, "THEORA", 0, "Ogg Theora", ""},
1040 {R_FFMPEG, "FFMPEG", 0, "FFMpeg", ""},
1042 {0, "", 0, NULL, NULL},
1043 {R_FRAMESERVER, "FRAMESERVER", 0, "Frame Server", ""},
1044 {0, NULL, 0, NULL, NULL}};
1047 static EnumPropertyItem exr_codec_items[] = {
1048 {0, "NONE", 0, "None", ""},
1049 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
1050 {2, "ZIP", 0, "ZIP (lossless)", ""},
1051 {3, "PIZ", 0, "PIZ (lossless)", ""},
1052 {4, "RLE", 0, "RLE (lossless)", ""},
1053 {0, NULL, 0, NULL, NULL}};
1056 #ifdef WITH_OPENJPEG
1057 static EnumPropertyItem jp2_preset_items[] = {
1058 {0, "NO_PRESET", 0, "No Preset", ""},
1059 {1, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 2048x1080", ""},
1060 {2, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
1061 {3, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 4096x2160", ""},
1062 {4, "R_JPEG2K_CINE_PRESET", 0, "Cine-Scope 24fps 2048x858", ""},
1063 {5, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
1064 {6, "R_JPEG2K_CINE_PRESET", 0, "Cine-Flat 24fps 1998x1080", ""},
1065 {7, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
1066 {0, NULL, 0, NULL, NULL}};
1068 static EnumPropertyItem jp2_depth_items[] = {
1069 {0, "8", 0, "8", ""},
1070 {R_JPEG2K_12BIT, "16", 0, "16", ""},
1071 {R_JPEG2K_16BIT, "32", 0, "32", ""},
1072 {0, NULL, 0, NULL, NULL}};
1076 static EnumPropertyItem ffmpeg_format_items[] = {
1077 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
1078 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
1079 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
1080 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
1081 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
1082 {FFMPEG_DV, "DV", 0, "DV", ""},
1083 {FFMPEG_H264, "H264", 0, "H.264", ""},
1084 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
1088 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
1091 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
1092 {0, NULL, 0, NULL, NULL}};
1094 static EnumPropertyItem ffmpeg_codec_items[] = {
1095 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
1096 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
1097 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
1098 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
1099 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
1100 {CODEC_ID_H264, "H264", 0, "H.264", ""},
1101 {CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
1103 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
1105 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
1106 {0, NULL, 0, NULL, NULL}};
1108 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
1109 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
1110 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
1111 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
1112 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
1113 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
1114 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
1115 {0, NULL, 0, NULL, NULL}};
1118 static EnumPropertyItem engine_items[] = {
1119 {0, "BLENDER", 0, "Blender", ""},
1120 {0, NULL, 0, NULL, NULL}};
1122 srna= RNA_def_struct(brna, "SceneRenderData", NULL);
1123 RNA_def_struct_sdna(srna, "RenderData");
1124 RNA_def_struct_nested(brna, srna, "Scene");
1125 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock.");
1127 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
1128 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
1129 RNA_def_property_enum_items(prop, color_mode_items);
1130 RNA_def_property_ui_text(prop, "Color Mode", "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, AND RGBA for saving red, green, blue + alpha channels");
1132 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1133 RNA_def_property_int_sdna(prop, NULL, "xsch");
1134 RNA_def_property_range(prop, 4, 10000);
1135 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image.");
1136 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
1138 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1139 RNA_def_property_int_sdna(prop, NULL, "ysch");
1140 RNA_def_property_range(prop, 4, 10000);
1141 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image.");
1142 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
1144 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
1145 RNA_def_property_int_sdna(prop, NULL, "size");
1146 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
1147 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
1149 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
1150 RNA_def_property_int_sdna(prop, NULL, "xparts");
1151 RNA_def_property_range(prop, 1, 512);
1152 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering.");
1153 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1155 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
1156 RNA_def_property_int_sdna(prop, NULL, "yparts");
1157 RNA_def_property_range(prop, 1, 512);
1158 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering.");
1159 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1161 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
1162 RNA_def_property_float_sdna(prop, NULL, "xasp");
1163 RNA_def_property_range(prop, 1.0f, 200.0f);
1164 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
1165 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
1167 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
1168 RNA_def_property_float_sdna(prop, NULL, "yasp");
1169 RNA_def_property_range(prop, 1.0f, 200.0f);
1170 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
1171 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
1173 /* JPEG and AVI JPEG */
1175 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
1176 RNA_def_property_int_sdna(prop, NULL, "quality");
1177 RNA_def_property_range(prop, 1, 100);
1178 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies.");
1179 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1183 prop= RNA_def_property(srna, "tiff_bit", PROP_BOOLEAN, PROP_NONE);
1184 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
1185 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
1186 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1188 /* Cineon and DPX */
1190 prop= RNA_def_property(srna, "cineon_log", PROP_BOOLEAN, PROP_NONE);
1191 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
1192 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
1193 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1195 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
1196 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
1197 RNA_def_property_range(prop, 0, 1024);
1198 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
1199 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1201 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
1202 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
1203 RNA_def_property_range(prop, 0, 1024);
1204 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
1205 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1207 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
1208 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
1209 RNA_def_property_range(prop, 0.0f, 10.0f);
1210 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
1211 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1216 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
1217 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
1218 RNA_def_property_enum_items(prop, exr_codec_items);
1219 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
1220 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1222 prop= RNA_def_property(srna, "exr_half", PROP_BOOLEAN, PROP_NONE);
1223 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
1224 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
1225 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1227 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
1228 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
1229 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int zbuffer)");
1230 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1232 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
1233 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
1234 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
1235 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1238 #ifdef WITH_OPENJPEG
1241 prop= RNA_def_property(srna, "jpeg_preset", PROP_ENUM, PROP_NONE);
1242 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_preset");
1243 RNA_def_property_enum_items(prop, jp2_preset_items);
1244 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
1245 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1247 prop= RNA_def_property(srna, "jpeg_depth", PROP_ENUM, PROP_NONE);
1248 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
1249 RNA_def_property_enum_items(prop, jp2_depth_items);
1250 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
1251 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1253 prop= RNA_def_property(srna, "jpeg_ycc", PROP_BOOLEAN, PROP_NONE);
1254 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
1255 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
1256 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1262 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
1263 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
1264 RNA_def_property_enum_items(prop, ffmpeg_format_items);
1265 RNA_def_property_ui_text(prop, "Format", "Output file format");
1266 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1268 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
1269 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
1270 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
1271 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
1272 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1274 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
1275 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
1276 RNA_def_property_range(prop, 1, 14000);
1277 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
1278 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1280 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
1281 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
1282 RNA_def_property_range(prop, 0, 9000);
1283 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
1284 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1286 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
1287 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
1288 RNA_def_property_range(prop, 1, 14000);
1289 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
1290 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1292 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
1293 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
1294 RNA_def_property_range(prop, 0, 100000000);
1295 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
1296 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1298 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
1299 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
1300 RNA_def_property_range(prop, 0, 100);
1301 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
1302 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1304 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
1305 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
1306 RNA_def_property_range(prop, 0, 2000);
1307 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
1308 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1310 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
1311 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
1312 RNA_def_property_range(prop, 0, 16384);
1313 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
1314 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1316 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
1317 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
1318 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary.");
1319 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1323 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
1324 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
1325 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
1326 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
1327 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1329 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
1330 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
1331 RNA_def_property_range(prop, 32, 384);
1332 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
1333 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1335 prop= RNA_def_property(srna, "ffmpeg_multiplex_audio", PROP_BOOLEAN, PROP_NONE);
1336 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_MULTIPLEX_AUDIO);
1337 RNA_def_property_ui_text(prop, "Multiplex Audio", "Interleave audio with the output video");
1338 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1341 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1342 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
1343 RNA_def_property_range(prop, 1, 120);
1344 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second.");
1345 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1347 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
1348 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
1349 RNA_def_property_range(prop, 0.1f, 120.0f);
1350 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
1351 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1353 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
1354 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
1355 RNA_def_property_range(prop, 0.0f, 2.0f);
1356 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding.");
1357 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1359 prop= RNA_def_property(srna, "pixel_filter", PROP_ENUM, PROP_NONE);
1360 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
1361 RNA_def_property_enum_items(prop, pixel_filter_items);
1362 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples.");
1363 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1365 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
1366 RNA_def_property_float_sdna(prop, NULL, "gauss");
1367 RNA_def_property_range(prop, 0.5f, 1.5f);
1368 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples.");
1369 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1371 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
1372 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
1373 RNA_def_property_enum_items(prop, alpha_mode_items);
1374 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels.");
1375 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1377 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
1378 RNA_def_property_enum_sdna(prop, NULL, "ocres");
1379 RNA_def_property_enum_items(prop, octree_resolution_items);
1380 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes.");
1381 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1383 prop= RNA_def_property(srna, "antialiasing", PROP_BOOLEAN, PROP_NONE);
1384 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
1385 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges.");
1386 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1388 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
1389 RNA_def_property_enum_sdna(prop, NULL, "osa");
1390 RNA_def_property_enum_items(prop, fixed_oversample_items);
1391 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel.");
1392 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1394 prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
1395 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
1396 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output.");
1397 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1399 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
1400 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
1401 RNA_def_property_enum_items(prop, field_order_items);
1402 RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines get rendered first, to create smooth motion for TV output");
1404 prop= RNA_def_property(srna, "fields_still", PROP_BOOLEAN, PROP_NONE);
1405 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
1406 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields.");
1407 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1409 prop= RNA_def_property(srna, "render_shadows", PROP_BOOLEAN, PROP_NONE);
1410 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
1411 RNA_def_property_ui_text(prop, "Render Shadows", "Calculate shadows while rendering.");
1412 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1414 prop= RNA_def_property(srna, "render_envmaps", PROP_BOOLEAN, PROP_NONE);
1415 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
1416 RNA_def_property_ui_text(prop, "Render Environment Maps", "Calculate environment maps while rendering.");
1417 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1419 prop= RNA_def_property(srna, "render_radiosity", PROP_BOOLEAN, PROP_NONE);
1420 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
1421 RNA_def_property_ui_text(prop, "Render Radiosity", "Calculate radiosity in a pre-process before rendering.");
1422 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1424 prop= RNA_def_property(srna, "render_sss", PROP_BOOLEAN, PROP_NONE);
1425 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
1426 RNA_def_property_ui_text(prop, "Render SSS", "Calculate sub-surface scattering in materials rendering.");
1427 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1429 prop= RNA_def_property(srna, "render_raytracing", PROP_BOOLEAN, PROP_NONE);
1430 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
1431 RNA_def_property_ui_text(prop, "Render Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects.");
1432 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1434 prop= RNA_def_property(srna, "render_textures", PROP_BOOLEAN, PROP_NONE);
1435 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
1436 RNA_def_property_ui_text(prop, "Render Textures", "Use textures to affect material properties.");
1437 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1439 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
1440 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
1441 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
1442 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1444 prop= RNA_def_property(srna, "edge_intensity", PROP_INT, PROP_NONE);
1445 RNA_def_property_int_sdna(prop, NULL, "edgeint");
1446 RNA_def_property_range(prop, 0, 255);
1447 RNA_def_property_ui_text(prop, "Edge Intensity", "Threshold for drawing outlines on geometry edges");
1448 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1450 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
1451 RNA_def_property_float_sdna(prop, NULL, "edgeR");
1452 RNA_def_property_array(prop, 3);
1453 RNA_def_property_ui_text(prop, "Edge Color", "");
1454 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1456 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
1457 RNA_def_property_int_sdna(prop, NULL, "threads");
1458 RNA_def_property_range(prop, 1, 8);
1459 RNA_def_property_int_funcs(prop, "rna_SceneRenderData_threads_get", NULL, NULL);
1460 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
1461 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1463 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
1464 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
1465 RNA_def_property_enum_items(prop, threads_mode_items);
1466 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
1468 prop= RNA_def_property(srna, "motion_blur", PROP_BOOLEAN, PROP_NONE);
1469 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
1470 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur (uses number of anti-aliasing samples).");
1471 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1473 prop= RNA_def_property(srna, "border", PROP_BOOLEAN, PROP_NONE);
1474 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
1475 RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size.");
1476 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1478 prop= RNA_def_property(srna, "crop_to_border", PROP_BOOLEAN, PROP_NONE);
1479 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
1480 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size.");
1481 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1483 prop= RNA_def_property(srna, "placeholders", PROP_BOOLEAN, PROP_NONE);
1484 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
1485 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch').");
1486 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1488 prop= RNA_def_property(srna, "no_overwrite", PROP_BOOLEAN, PROP_NONE);
1489 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
1490 RNA_def_property_ui_text(prop, "No Overwrite", "Skip and don't overwrite existing files while rendering");
1491 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1493 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
1494 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
1495 RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled.");
1496 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1498 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
1499 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
1500 RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist.");
1501 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1503 prop= RNA_def_property(srna, "color_management", PROP_BOOLEAN, PROP_NONE);
1504 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
1505 RNA_def_property_ui_text(prop, "Color Management", "Use color profiles and gamma corrected imaging pipeline");
1506 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_MATERIAL|ND_SHADING, NULL);
1508 prop= RNA_def_property(srna, "file_extensions", PROP_BOOLEAN, PROP_NONE);
1509 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
1510 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
1511 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1513 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
1514 RNA_def_property_enum_sdna(prop, NULL, "imtype");
1515 RNA_def_property_enum_items(prop, image_type_items);
1516 RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_file_format_set", NULL);
1517 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as.");
1518 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1520 prop= RNA_def_property(srna, "free_image_textures", PROP_BOOLEAN, PROP_NONE);
1521 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
1522 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing.");
1523 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1525 prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE);
1526 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
1527 RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_save_buffers_get", NULL);
1528 RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, required for Full Sample).");
1529 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1531 prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE);
1532 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
1533 RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing.");
1534 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1536 prop= RNA_def_property(srna, "backbuf", PROP_BOOLEAN, PROP_NONE);
1537 RNA_def_property_boolean_sdna(prop, NULL, "bufflag", R_BACKBUF);
1538 RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image");
1539 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1541 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
1542 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
1543 RNA_def_property_enum_items(prop, display_mode_items);
1544 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
1546 prop= RNA_def_property(srna, "output_path", PROP_STRING, PROP_DIRPATH);
1547 RNA_def_property_string_sdna(prop, NULL, "pic");
1548 RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers.");
1549 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1553 prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE);
1554 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
1555 RNA_def_property_ui_text(prop, "Stamp Time", "Include the current time in image metadata");
1556 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1558 prop= RNA_def_property(srna, "stamp_date", PROP_BOOLEAN, PROP_NONE);
1559 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
1560 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
1561 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1563 prop= RNA_def_property(srna, "stamp_frame", PROP_BOOLEAN, PROP_NONE);
1564 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
1565 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
1566 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1568 prop= RNA_def_property(srna, "stamp_camera", PROP_BOOLEAN, PROP_NONE);
1569 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
1570 RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
1571 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1573 prop= RNA_def_property(srna, "stamp_scene", PROP_BOOLEAN, PROP_NONE);
1574 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
1575 RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
1576 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1578 prop= RNA_def_property(srna, "stamp_note", PROP_BOOLEAN, PROP_NONE);
1579 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
1580 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
1581 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1583 prop= RNA_def_property(srna, "stamp_marker", PROP_BOOLEAN, PROP_NONE);
1584 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
1585 RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
1586 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1588 prop= RNA_def_property(srna, "stamp_filename", PROP_BOOLEAN, PROP_NONE);
1589 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
1590 RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
1591 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1593 prop= RNA_def_property(srna, "stamp_sequence_strip", PROP_BOOLEAN, PROP_NONE);
1594 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
1595 RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
1596 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1598 prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
1599 RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
1600 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
1601 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1603 prop= RNA_def_property(srna, "render_stamp", PROP_BOOLEAN, PROP_NONE);
1604 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
1605 RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
1606 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1608 prop= RNA_def_property(srna, "stamp_font_size", PROP_ENUM, PROP_NONE);
1609 RNA_def_property_enum_sdna(prop, NULL, "stamp_font_id");
1610 RNA_def_property_enum_items(prop, stamp_font_size_items);
1611 RNA_def_property_ui_text(prop, "Stamp Font Size", "Size of the font used when rendering stamp text");
1612 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1614 prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
1615 RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
1616 RNA_def_property_array(prop, 4);
1617 RNA_def_property_range(prop,0.0,1.0);
1618 RNA_def_property_ui_text(prop, "Stamp Foreground", "Stamp text color");
1619 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1621 prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
1622 RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
1623 RNA_def_property_array(prop, 4);
1624 RNA_def_property_range(prop,0.0,1.0);
1625 RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
1626 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1630 prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
1631 RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
1632 RNA_def_property_struct_type(prop, "SceneRenderLayer");
1633 RNA_def_property_ui_text(prop, "Render Layers", "");
1635 prop= RNA_def_property(srna, "single_layer", PROP_BOOLEAN, PROP_NONE);
1636 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
1637 RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer.");
1638 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1640 prop= RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE);
1641 RNA_def_property_int_sdna(prop, NULL, "actlay");
1642 RNA_def_property_int_funcs(prop, "rna_SceneRenderData_active_layer_index_get", "rna_SceneRenderData_active_layer_index_set", "rna_SceneRenderData_active_layer_index_range");
1643 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array.");
1644 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1647 prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
1648 RNA_def_property_enum_items(prop, engine_items);
1649 RNA_def_property_enum_funcs(prop, "rna_SceneRenderData_engine_get", "rna_SceneRenderData_engine_set", "rna_SceneRenderData_engine_itemf");
1650 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering.");
1651 RNA_def_property_update(prop, NC_WINDOW, NULL);
1653 prop= RNA_def_property(srna, "multiple_engines", PROP_BOOLEAN, PROP_NONE);
1654 RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_multiple_engines_get", NULL);
1655 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1656 RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available.");
1658 prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
1659 RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_use_game_engine_get", NULL);
1660 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1661 RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine.");
1664 void RNA_def_scene(BlenderRNA *brna)
1669 /* Struct definition */
1670 srna= RNA_def_struct(brna, "Scene", "ID");
1671 RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings.");
1672 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
1673 RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
1675 /* Global Settings */
1676 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
1677 RNA_def_property_flag(prop, PROP_EDITABLE);
1678 RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene.");
1680 prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
1681 RNA_def_property_flag(prop, PROP_EDITABLE);
1682 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene.");
1684 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_VECTOR);
1685 RNA_def_property_float_sdna(prop, NULL, "cursor");
1686 RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location.");
1687 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
1690 prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
1691 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
1692 RNA_def_property_struct_type(prop, "Object");
1693 RNA_def_property_ui_text(prop, "Objects", "");
1694 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0, 0, 0);
1697 prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE);
1698 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1699 RNA_def_property_array(prop, 20);
1700 RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene.");
1701 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
1704 /* Frame Range Stuff */
1705 prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_NONE);
1706 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1707 RNA_def_property_int_sdna(prop, NULL, "r.cfra");
1708 RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
1709 RNA_def_property_ui_text(prop, "Current Frame", "");
1710 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
1712 prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
1713 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1714 RNA_def_property_int_sdna(prop, NULL, "r.sfra");
1715 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
1716 RNA_def_property_ui_text(prop, "Start Frame", "");
1717 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1719 prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
1720 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1721 RNA_def_property_int_sdna(prop, NULL, "r.efra");
1722 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
1723 RNA_def_property_ui_text(prop, "End Frame", "");
1724 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1726 prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
1727 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1728 RNA_def_property_int_sdna(prop, NULL, "frame_step");
1729 RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
1730 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1732 /* Preview Range (frame-range for UI playback) */
1733 prop=RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE); /* use_preview_range is not really a separate setting in SDNA */
1734 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1735 RNA_def_property_boolean_funcs(prop, "rna_Scene_use_preview_range_get", "rna_Scene_use_preview_range_set");
1736 RNA_def_property_ui_text(prop, "Use Preview Range", "");
1737 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1739 prop= RNA_def_property(srna, "preview_range_start_frame", PROP_INT, PROP_NONE);
1740 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1741 RNA_def_property_int_sdna(prop, NULL, "r.psfra");
1742 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
1743 RNA_def_property_ui_text(prop, "Preview Range Start Frame", "");
1744 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1746 prop= RNA_def_property(srna, "preview_range_end_frame", PROP_INT, PROP_NONE);
1747 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1748 RNA_def_property_int_sdna(prop, NULL, "r.pefra");
1749 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
1750 RNA_def_property_ui_text(prop, "Preview Range End Frame", "");
1751 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1754 prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
1755 RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
1756 RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping.");
1757 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1759 /* Nodes (Compositing) */
1760 prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
1761 RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree.");
1764 prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
1765 RNA_def_property_pointer_sdna(prop, NULL, "ed");
1766 RNA_def_property_struct_type(prop, "SequenceEditor");
1767 RNA_def_property_ui_text(prop, "Sequence Editor", "");
1770 // TODO: hide the fact that active keyingset is an int?
1771 prop= RNA_def_property(srna, "keyingsets", PROP_COLLECTION, PROP_NONE);
1772 RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
1773 RNA_def_property_struct_type(prop, "KeyingSet");
1774 RNA_def_property_ui_text(prop, "Keying Sets", "Keying Sets for this Scene.");
1776 prop= RNA_def_property(srna, "active_keyingset", PROP_INT, PROP_NONE);
1777 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1778 RNA_def_property_ui_text(prop, "Active Keying Set", "Current Keying Set index.");
1781 prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
1782 RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
1783 RNA_def_property_struct_type(prop, "ToolSettings");
1784 RNA_def_property_ui_text(prop, "Tool Settings", "");
1787 prop= RNA_def_property(srna, "render_data", PROP_POINTER, PROP_NONE);
1788 RNA_def_property_pointer_sdna(prop, NULL, "r");
1789 RNA_def_property_struct_type(prop, "SceneRenderData");
1790 RNA_def_property_ui_text(prop, "Render Data", "");
1793 prop= RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
1794 RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
1795 RNA_def_property_struct_type(prop, "TimelineMarker");
1796 RNA_def_property_ui_text(prop, "Timeline Markers", "Markers used in all timelines for the current scene.");
1799 prop= RNA_def_property(srna, "game_data", PROP_POINTER, PROP_NONE);
1800 RNA_def_property_pointer_sdna(prop, NULL, "gm");
1801 RNA_def_property_struct_type(prop, "SceneGameData");
1802 RNA_def_property_ui_text(prop, "Game Data", "");
1804 rna_def_tool_settings(brna);
1805 rna_def_scene_render_data(brna);
1806 rna_def_scene_game_data(brna);
1807 rna_def_scene_render_layer(brna);