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"
33 #include "DNA_userdef_types.h"
35 /* Include for Bake Options */
36 #include "RE_pipeline.h"
39 #include "BKE_writeffmpeg.h"
40 #include <libavcodec/avcodec.h>
41 #include <libavformat/avformat.h>
47 EnumPropertyItem snap_mode_items[] = {
48 {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target."},
49 {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target."},
50 {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target."},
51 {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target."},
52 {0, NULL, 0, NULL, NULL}};
54 EnumPropertyItem proportional_falloff_items[] ={
55 {PROP_SMOOTH, "SMOOTH", 0, "Smooth", ""},
56 {PROP_SPHERE, "SPHERE", 0, "Sphere", ""},
57 {PROP_ROOT, "ROOT", 0, "Root", ""},
58 {PROP_SHARP, "SHARP", 0, "Sharp", ""},
59 {PROP_LIN, "LINEAR", 0, "Linear", ""},
60 {PROP_CONST, "CONSTANT", 0, "Constant", ""},
61 {PROP_RANDOM, "RANDOM", 0, "Random", ""},
62 {0, NULL, 0, NULL, NULL}};
65 EnumPropertyItem proportional_editing_items[] = {
66 {PROP_EDIT_OFF, "DISABLED", 0, "Disable", ""},
67 {PROP_EDIT_ON, "ENABLED", 0, "Enable", ""},
68 {PROP_EDIT_CONNECTED, "CONNECTED", 0, "Connected", ""},
69 {0, NULL, 0, NULL, NULL}};
73 #include "DNA_anim_types.h"
74 #include "DNA_node_types.h"
75 #include "DNA_object_types.h"
77 #include "BKE_context.h"
78 #include "BKE_global.h"
79 #include "BKE_scene.h"
81 #include "BKE_pointcache.h"
83 #include "BLI_threads.h"
88 #include "RE_pipeline.h"
90 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
92 ListBaseIterator *internal= iter->internal;
94 /* we are actually iterating a Base list, so override get */
95 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
98 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
100 ToolSettings *ts = (ToolSettings*)ptr->data;
101 if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
102 ts->skgen_template = value.data;
104 ts->skgen_template = NULL;
107 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
109 Scene *scene= (Scene*)ptr->data;
110 return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
113 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
115 Scene *scene= (Scene*)ptr->data;
117 scene->basact= object_in_scene((Object*)value.data, scene);
122 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
124 Scene *scene= (Scene*)ptr->data;
125 Scene *set= (Scene*)value.data;
128 for(nested_set= set; nested_set; nested_set= nested_set->set) {
129 if(nested_set==scene)
136 static int layer_set(int lay, const int *values)
140 /* ensure we always have some layer selected */
148 for(i=0; i<20; i++) {
149 if(values[i]) lay |= (1<<i);
156 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
158 Scene *scene= (Scene*)ptr->data;
160 scene->lay= layer_set(scene->lay, values);
163 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
165 Scene *data= (Scene*)ptr->data;
166 CLAMP(value, 1, data->r.efra);
170 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
172 Scene *data= (Scene*)ptr->data;
173 CLAMP(value, data->r.sfra, MAXFRAME);
177 static int rna_Scene_use_preview_range_get(PointerRNA *ptr)
179 Scene *data= (Scene*)ptr->data;
181 /* this is simply overloaded to assume that preview-range
182 * start frame cannot be less than 1 when on,
183 * so psfra=0 means 'off'
185 return (data->r.psfra != 0);
188 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
190 Scene *data= (Scene*)ptr->data;
192 /* if enable, copy range from render-range, otherwise just clear */
194 data->r.psfra= data->r.sfra;
195 data->r.pefra= data->r.efra;
202 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
204 Scene *data= (Scene*)ptr->data;
206 /* check if enabled already */
207 if (data->r.psfra == 0) {
208 /* set end of preview range to end frame, then clamp as per normal */
209 // TODO: or just refuse to set instead?
210 data->r.pefra= data->r.efra;
213 /* now set normally */
214 CLAMP(value, 1, data->r.pefra);
215 data->r.psfra= value;
218 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
220 Scene *data= (Scene*)ptr->data;
222 /* check if enabled already */
223 if (data->r.psfra == 0) {
224 /* set start of preview range to start frame, then clamp as per normal */
225 // TODO: or just refuse to set instead?
226 data->r.psfra= data->r.sfra;
229 /* now set normally */
230 CLAMP(value, data->r.psfra, MAXFRAME);
231 data->r.pefra= value;
234 static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
236 //Scene *scene= ptr->id.data;
237 //ED_update_for_newframe(C);
240 static int rna_Scene_active_keying_set_editable(PointerRNA *ptr)
242 Scene *scene= (Scene *)ptr->data;
244 /* only editable if there are some Keying Sets to change to */
245 return (scene->keyingsets.first != NULL);
248 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
250 Scene *scene= (Scene *)ptr->data;
251 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, BLI_findlink(&scene->keyingsets, scene->active_keyingset-1));
254 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
256 Scene *scene= (Scene *)ptr->data;
257 KeyingSet *ks= (KeyingSet*)value.data;
258 scene->active_keyingset= BLI_findindex(&scene->keyingsets, ks) + 1;
261 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
263 Scene *scene= (Scene *)ptr->data;
264 return MAX2(scene->active_keyingset-1, 0);
267 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
269 Scene *scene= (Scene *)ptr->data;
270 scene->active_keyingset= value+1;
273 static void rna_Scene_active_keying_set_index_range(PointerRNA *ptr, int *min, int *max)
275 Scene *scene= (Scene *)ptr->data;
278 *max= BLI_countlist(&scene->keyingsets)-1;
283 static char *rna_SceneRenderData_path(PointerRNA *ptr)
285 return BLI_sprintfN("render_data");
288 static int rna_SceneRenderData_threads_get(PointerRNA *ptr)
290 RenderData *rd= (RenderData*)ptr->data;
292 if(rd->mode & R_FIXED_THREADS)
295 return BLI_system_thread_count();
298 static int rna_SceneRenderData_save_buffers_get(PointerRNA *ptr)
300 RenderData *rd= (RenderData*)ptr->data;
302 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
305 static void rna_SceneRenderData_file_format_set(PointerRNA *ptr, int value)
307 RenderData *rd= (RenderData*)ptr->data;
311 ffmpeg_verify_image_type(rd);
315 void rna_SceneRenderData_jpeg2k_preset_update(RenderData *rd)
317 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
319 switch(rd->jp2_depth) {
321 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
322 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
325 switch(rd->jp2_preset) {
326 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
327 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
328 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
329 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
330 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
331 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
332 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
337 static void rna_SceneRenderData_jpeg2k_preset_set(PointerRNA *ptr, int value)
339 RenderData *rd= (RenderData*)ptr->data;
340 rd->jp2_preset= value;
341 rna_SceneRenderData_jpeg2k_preset_update(rd);
344 static void rna_SceneRenderData_jpeg2k_depth_set(PointerRNA *ptr, int value)
346 RenderData *rd= (RenderData*)ptr->data;
347 rd->jp2_depth= value;
348 rna_SceneRenderData_jpeg2k_preset_update(rd);
352 static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr)
354 RenderData *rd= (RenderData*)ptr->data;
358 static void rna_SceneRenderData_active_layer_index_set(PointerRNA *ptr, int value)
360 RenderData *rd= (RenderData*)ptr->data;
364 static void rna_SceneRenderData_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
366 RenderData *rd= (RenderData*)ptr->data;
369 *max= BLI_countlist(&rd->layers)-1;
373 static void rna_SceneRenderData_engine_set(PointerRNA *ptr, int value)
375 RenderData *rd= (RenderData*)ptr->data;
376 RenderEngineType *type= BLI_findlink(&R_engines, value);
379 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
382 static EnumPropertyItem *rna_SceneRenderData_engine_itemf(bContext *C, PointerRNA *ptr, int *free)
384 RenderEngineType *type;
385 EnumPropertyItem *item= NULL;
386 EnumPropertyItem tmp = {0, "", 0, "", ""};
389 for(type=R_engines.first; type; type=type->next, a++) {
391 tmp.identifier= type->idname;
392 tmp.name= type->name;
393 RNA_enum_item_add(&item, &totitem, &tmp);
396 RNA_enum_item_end(&item, &totitem);
402 static int rna_SceneRenderData_engine_get(PointerRNA *ptr)
404 RenderData *rd= (RenderData*)ptr->data;
405 RenderEngineType *type;
408 for(type=R_engines.first; type; type=type->next, a++)
409 if(strcmp(type->idname, rd->engine) == 0)
415 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
417 Scene *scene= (Scene*)ptr->id.data;
418 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
420 BLI_strncpy(rl->name, value, sizeof(rl->name));
422 if(scene->nodetree) {
424 int index= BLI_findindex(&scene->r.layers, rl);
426 for(node= scene->nodetree->nodes.first; node; node= node->next) {
427 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
428 if(node->custom1==index)
429 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
435 static int rna_SceneRenderData_multiple_engines_get(PointerRNA *ptr)
437 return (BLI_countlist(&R_engines) > 1);
440 static int rna_SceneRenderData_use_game_engine_get(PointerRNA *ptr)
442 RenderData *rd= (RenderData*)ptr->data;
443 RenderEngineType *type;
445 for(type=R_engines.first; type; type=type->next)
446 if(strcmp(type->idname, rd->engine) == 0)
447 return (type->flag & RE_GAME);
452 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
454 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
455 rl->lay= layer_set(rl->lay, values);
458 static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr)
460 Scene *scene= (Scene*)ptr->id.data;
463 ntreeCompositForceHidden(scene->nodetree, scene);
466 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
468 Scene *scene= (Scene*)ptr->data;
470 scene->use_nodes= value;
471 if(scene->use_nodes && scene->nodetree==NULL)
472 ED_node_composit_default(scene);
475 static void rna_Physics_update(bContext *C, PointerRNA *ptr)
477 Scene *scene= (Scene*)ptr->id.data;
480 for(base = scene->base.first; base; base=base->next)
481 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
485 static void rna_def_transform_orientation(BlenderRNA *brna)
490 int matrix_dimsize[]= {3, 3};
492 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
494 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
495 RNA_def_property_float_sdna(prop, NULL, "mat");
496 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
497 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
499 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
500 RNA_def_property_string_sdna(prop, NULL, "name");
501 RNA_def_struct_name_property(srna, prop);
502 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
505 static void rna_def_tool_settings(BlenderRNA *brna)
510 static EnumPropertyItem uv_select_mode_items[] = {
511 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode."},
512 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode."},
513 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode."},
514 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode."},
515 {0, NULL, 0, NULL, NULL}};
517 static EnumPropertyItem mesh_select_mode_items[] = {
518 {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."},
519 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."},
520 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."},
521 {0, NULL, 0, NULL, NULL}};
523 static EnumPropertyItem snap_element_items[] = {
524 {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices."},
525 {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges."},
526 {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces."},
527 {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume."},
528 {0, NULL, 0, NULL, NULL}};
530 static EnumPropertyItem auto_key_items[] = {
531 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
532 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
533 {0, NULL, 0, NULL, NULL}};
535 static EnumPropertyItem retarget_roll_items[] = {
536 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll."},
537 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view."},
538 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset."},
539 {0, NULL, 0, NULL, NULL}};
541 static EnumPropertyItem sketch_convert_items[] = {
542 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones."},
543 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length."},
544 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts."},
545 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke."},
546 {0, NULL, 0, NULL, NULL}};
548 srna= RNA_def_struct(brna, "ToolSettings", NULL);
549 RNA_def_struct_ui_text(srna, "Tool Settings", "");
551 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
552 RNA_def_property_struct_type(prop, "Sculpt");
553 RNA_def_property_ui_text(prop, "Sculpt", "");
555 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
556 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
557 RNA_def_property_ui_text(prop, "Vertex Paint", "");
559 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
560 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
561 RNA_def_property_ui_text(prop, "Weight Paint", "");
563 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
564 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
565 RNA_def_property_ui_text(prop, "Image Paint", "");
567 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
568 RNA_def_property_pointer_sdna(prop, NULL, "particle");
569 RNA_def_property_ui_text(prop, "Particle Edit", "");
572 prop= RNA_def_property(srna, "proportional_editing", PROP_ENUM, PROP_NONE);
573 RNA_def_property_enum_sdna(prop, NULL, "proportional");
574 RNA_def_property_enum_items(prop, proportional_editing_items);
575 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode.");
576 RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */
578 prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE);
579 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
580 RNA_def_property_enum_items(prop, proportional_falloff_items);
581 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode.");
582 RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */
584 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
585 RNA_def_property_float_sdna(prop, NULL, "normalsize");
586 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view.");
587 RNA_def_property_range(prop, 0.00001, 1000.0);
588 RNA_def_property_ui_range(prop, 0.01, 10.0, 0.1, 2);
589 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
591 prop= RNA_def_property(srna, "automerge_editing", PROP_BOOLEAN, PROP_NONE);
592 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
593 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location.");
595 prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE);
596 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
597 RNA_def_property_ui_text(prop, "Snap", "Snap while Ctrl is held during transform.");
598 RNA_def_property_ui_icon(prop, ICON_SNAP_GEAR, 1);
600 prop= RNA_def_property(srna, "snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
601 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
602 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target.");
603 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
605 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
606 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
607 RNA_def_property_enum_items(prop, snap_element_items);
608 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to.");
610 prop= RNA_def_property(srna, "snap_mode", PROP_ENUM, PROP_NONE);
611 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
612 RNA_def_property_enum_items(prop, snap_mode_items);
613 RNA_def_property_ui_text(prop, "Snap Mode", "Which part to snap onto the target.");
615 prop= RNA_def_property(srna, "snap_peel_object", PROP_BOOLEAN, PROP_NONE);
616 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
617 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center.");
618 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
620 prop= RNA_def_property(srna, "snap_project", PROP_BOOLEAN, PROP_NONE);
621 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
622 RNA_def_property_ui_text(prop, "Project Individual Elements", "DOC_BROKEN");
623 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
626 prop= RNA_def_property(srna, "enable_auto_key", PROP_BOOLEAN, PROP_NONE);
627 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
628 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
630 prop= RNA_def_property(srna, "autokey_mode", PROP_ENUM, PROP_NONE);
631 RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
632 RNA_def_property_enum_items(prop, auto_key_items);
633 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
635 prop= RNA_def_property(srna, "record_with_nla", PROP_BOOLEAN, PROP_NONE);
636 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
637 RNA_def_property_ui_text(prop, "Layered", "Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking.");
640 prop= RNA_def_property(srna, "uv_selection_mode", PROP_ENUM, PROP_NONE);
641 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
642 RNA_def_property_enum_items(prop, uv_select_mode_items);
643 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode.");
645 prop= RNA_def_property(srna, "uv_sync_selection", PROP_BOOLEAN, PROP_NONE);
646 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
647 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync.");
648 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
650 prop= RNA_def_property(srna, "uv_local_view", PROP_BOOLEAN, PROP_NONE);
651 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
652 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned.");
655 prop= RNA_def_property(srna, "mesh_selection_mode", PROP_ENUM, PROP_NONE);
656 RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
657 RNA_def_property_enum_items(prop, mesh_select_mode_items);
658 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Mesh selection and display mode.");
660 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
661 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
662 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups.");
665 prop= RNA_def_property(srna, "bone_sketching", PROP_BOOLEAN, PROP_NONE);
666 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
667 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
668 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
670 prop= RNA_def_property(srna, "etch_quick", PROP_BOOLEAN, PROP_NONE);
671 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
672 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
674 prop= RNA_def_property(srna, "etch_overdraw", PROP_BOOLEAN, PROP_NONE);
675 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
676 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
678 prop= RNA_def_property(srna, "etch_autoname", PROP_BOOLEAN, PROP_NONE);
679 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
680 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
682 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
683 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
684 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
686 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
687 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
688 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
690 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
691 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
692 RNA_def_property_flag(prop, PROP_EDITABLE);
693 RNA_def_property_struct_type(prop, "Object");
694 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL);
695 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke.");
697 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
698 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
699 RNA_def_property_range(prop, 1, 10000);
700 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke.");
701 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
703 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
704 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
705 RNA_def_property_range(prop, 0.00001, 1.0);
706 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
707 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke.");
708 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
710 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
711 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
712 RNA_def_property_range(prop, 0.00001, 100000.0);
713 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
714 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke.");
715 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
717 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
718 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
719 RNA_def_property_enum_items(prop, retarget_roll_items);
720 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting.");
722 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
723 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
724 RNA_def_property_enum_items(prop, sketch_convert_items);
725 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones.");
726 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
730 static void rna_def_unit_settings(BlenderRNA *brna)
735 static EnumPropertyItem unit_systems[] = {
736 {USER_UNIT_NONE, "NONE", 0, "None", ""},
737 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
738 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
739 {0, NULL, 0, NULL, NULL}};
741 srna= RNA_def_struct(brna, "UnitSettings", NULL);
742 RNA_def_struct_ui_text(srna, "Unit Settings", "");
745 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
746 RNA_def_property_enum_items(prop, unit_systems);
747 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display.");
748 RNA_def_property_update(prop, NC_WINDOW, NULL);
750 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
751 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions.");
752 RNA_def_property_range(prop, 0.00001, 100000.0);
753 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
754 RNA_def_property_update(prop, NC_WINDOW, NULL);
756 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
757 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
758 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs.");
759 RNA_def_property_update(prop, NC_WINDOW, NULL);
762 void rna_def_render_layer_common(StructRNA *srna, int scene)
766 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
767 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
768 else RNA_def_property_string_sdna(prop, NULL, "name");
769 RNA_def_property_ui_text(prop, "Name", "Render layer name.");
770 RNA_def_struct_name_property(srna, prop);
771 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
772 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
774 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
775 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
776 RNA_def_property_struct_type(prop, "Material");
777 RNA_def_property_flag(prop, PROP_EDITABLE);
778 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer.");
779 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
780 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
782 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
783 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
784 RNA_def_property_struct_type(prop, "Group");
785 RNA_def_property_flag(prop, PROP_EDITABLE);
786 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer.");
787 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
788 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
791 prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
792 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
793 RNA_def_property_array(prop, 20);
794 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer.");
795 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
796 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
797 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
798 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
800 prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_LAYER);
801 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
802 RNA_def_property_array(prop, 20);
803 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers.");
804 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
805 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
808 prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
809 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
810 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer.");
811 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
812 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
814 prop= RNA_def_property(srna, "zmask", PROP_BOOLEAN, PROP_NONE);
815 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
816 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values.");
817 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
818 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
820 prop= RNA_def_property(srna, "zmask_negate", PROP_BOOLEAN, PROP_NONE);
821 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
822 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front.");
823 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
824 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
826 prop= RNA_def_property(srna, "all_z", PROP_BOOLEAN, PROP_NONE);
827 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
828 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking.");
829 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
830 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
832 prop= RNA_def_property(srna, "solid", PROP_BOOLEAN, PROP_NONE);
833 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
834 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer.");
835 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
836 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
838 prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
839 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
840 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid).");
841 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
842 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
844 prop= RNA_def_property(srna, "ztransp", PROP_BOOLEAN, PROP_NONE);
845 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
846 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos).");
847 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
848 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
850 prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
851 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
852 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer.");
853 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
854 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
856 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
857 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
858 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces).");
859 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
860 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
862 prop= RNA_def_property(srna, "strand", PROP_BOOLEAN, PROP_NONE);
863 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
864 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer.");
865 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
866 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
868 prop= RNA_def_property(srna, "freestyle", PROP_BOOLEAN, PROP_NONE);
869 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_FRS);
870 RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer.");
871 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
872 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
875 prop= RNA_def_property(srna, "pass_combined", PROP_BOOLEAN, PROP_NONE);
876 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
877 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer.");
878 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
879 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
881 prop= RNA_def_property(srna, "pass_z", PROP_BOOLEAN, PROP_NONE);
882 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
883 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass.");
884 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
885 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
887 prop= RNA_def_property(srna, "pass_vector", PROP_BOOLEAN, PROP_NONE);
888 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
889 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass.");
890 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
891 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
893 prop= RNA_def_property(srna, "pass_normal", PROP_BOOLEAN, PROP_NONE);
894 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
895 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass.");
896 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
897 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
899 prop= RNA_def_property(srna, "pass_uv", PROP_BOOLEAN, PROP_NONE);
900 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
901 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass.");
902 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
903 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
905 prop= RNA_def_property(srna, "pass_mist", PROP_BOOLEAN, PROP_NONE);
906 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
907 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0).");
908 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
909 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
911 prop= RNA_def_property(srna, "pass_object_index", PROP_BOOLEAN, PROP_NONE);
912 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
913 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass.");
914 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
915 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
917 prop= RNA_def_property(srna, "pass_color", PROP_BOOLEAN, PROP_NONE);
918 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
919 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass.");
920 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
921 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
923 prop= RNA_def_property(srna, "pass_diffuse", PROP_BOOLEAN, PROP_NONE);
924 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
925 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass.");
926 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
927 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
929 prop= RNA_def_property(srna, "pass_specular", PROP_BOOLEAN, PROP_NONE);
930 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
931 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass.");
932 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
933 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
935 prop= RNA_def_property(srna, "pass_shadow", PROP_BOOLEAN, PROP_NONE);
936 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
937 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass.");
938 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
939 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
941 prop= RNA_def_property(srna, "pass_ao", PROP_BOOLEAN, PROP_NONE);
942 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
943 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass.");
944 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
945 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
947 prop= RNA_def_property(srna, "pass_reflection", PROP_BOOLEAN, PROP_NONE);
948 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
949 RNA_def_property_ui_text(prop, "Reflection", "Deliver ratraced reflection pass.");
950 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
951 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
953 prop= RNA_def_property(srna, "pass_refraction", PROP_BOOLEAN, PROP_NONE);
954 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
955 RNA_def_property_ui_text(prop, "Refraction", "Deliver ratraced refraction pass.");
956 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
957 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
959 prop= RNA_def_property(srna, "pass_specular_exclude", PROP_BOOLEAN, PROP_NONE);
960 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
961 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined.");
962 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
963 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
965 prop= RNA_def_property(srna, "pass_shadow_exclude", PROP_BOOLEAN, PROP_NONE);
966 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
967 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined.");
968 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
969 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
971 prop= RNA_def_property(srna, "pass_ao_exclude", PROP_BOOLEAN, PROP_NONE);
972 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
973 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined.");
974 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
975 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
977 prop= RNA_def_property(srna, "pass_reflection_exclude", PROP_BOOLEAN, PROP_NONE);
978 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
979 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude ratraced reflection pass from combined.");
980 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
981 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
983 prop= RNA_def_property(srna, "pass_refraction_exclude", PROP_BOOLEAN, PROP_NONE);
984 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
985 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude ratraced refraction pass from combined.");
986 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
987 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
990 static void rna_def_freestyle_settings(BlenderRNA *brna)
995 /* FreestyleModuleSettings */
997 srna= RNA_def_struct(brna, "FreestyleModuleSettings", NULL);
998 RNA_def_struct_sdna(srna, "FreestyleModuleConfig");
999 RNA_def_struct_ui_text(srna, "Freestyle Module", "Style module configuration for specifying a style module.");
1001 prop= RNA_def_property(srna, "module_path", PROP_STRING, PROP_FILEPATH);
1002 RNA_def_property_string_sdna(prop, NULL, "module_path");
1003 RNA_def_property_ui_text(prop, "Module Path", "Path to a style module file.");
1004 RNA_def_property_update(prop, NC_SCENE, NULL);
1006 prop= RNA_def_property(srna, "is_displayed", PROP_BOOLEAN, PROP_NONE);
1007 RNA_def_property_boolean_sdna(prop, NULL, "is_displayed", 1);
1008 RNA_def_property_ui_text(prop, "Is Displayed", "Enable this style module during the rendering.");
1009 RNA_def_property_update(prop, NC_SCENE, NULL);
1011 /* FreestyleSettings */
1013 srna= RNA_def_struct(brna, "FreestyleSettings", NULL);
1014 RNA_def_struct_sdna(srna, "FreestyleConfig");
1015 RNA_def_struct_nested(brna, srna, "SceneRenderLayer");
1016 RNA_def_struct_ui_text(srna, "Frestyle Settings", "Freestyle settings for a SceneRenderLayer datablock.");
1018 prop= RNA_def_property(srna, "modules", PROP_COLLECTION, PROP_NONE);
1019 RNA_def_property_collection_sdna(prop, NULL, "modules", NULL);
1020 RNA_def_property_struct_type(prop, "FreestyleModuleSettings");
1021 RNA_def_property_ui_text(prop, "Style modules", "A list of style modules (to be applied from top to bottom).");
1023 prop= RNA_def_property(srna, "suggestive_contours", PROP_BOOLEAN, PROP_NONE);
1024 RNA_def_property_boolean_sdna(prop, NULL, "flags", FREESTYLE_SUGGESTIVE_CONTOURS_FLAG);
1025 RNA_def_property_ui_text(prop, "Suggestive Contours", "Enable suggestive contours.");
1026 RNA_def_property_update(prop, NC_SCENE, NULL);
1028 prop= RNA_def_property(srna, "ridges_and_valleys", PROP_BOOLEAN, PROP_NONE);
1029 RNA_def_property_boolean_sdna(prop, NULL, "flags", FREESTYLE_RIDGES_AND_VALLEYS_FLAG);
1030 RNA_def_property_ui_text(prop, "Ridges and Valleys", "Enable ridges and valleys.");
1031 RNA_def_property_update(prop, NC_SCENE, NULL);
1033 prop= RNA_def_property(srna, "sphere_radius", PROP_FLOAT, PROP_NONE);
1034 RNA_def_property_float_sdna(prop, NULL, "sphere_radius");
1035 RNA_def_property_range(prop, 0.0, 1000.0);
1036 RNA_def_property_ui_text(prop, "Sphere Radius", "*TBD*");
1037 RNA_def_property_update(prop, NC_SCENE, NULL);
1039 prop= RNA_def_property(srna, "dkr_epsilon", PROP_FLOAT, PROP_NONE);
1040 RNA_def_property_float_sdna(prop, NULL, "dkr_epsilon");
1041 RNA_def_property_range(prop, 0.0, 1000.0);
1042 RNA_def_property_ui_text(prop, "Dkr Epsilon", "*TBD*");
1043 RNA_def_property_update(prop, NC_SCENE, NULL);
1046 static void rna_def_scene_game_data(BlenderRNA *brna)
1051 static EnumPropertyItem framing_types_items[] ={
1052 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
1053 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1054 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1055 {0, NULL, 0, NULL, NULL}};
1057 static EnumPropertyItem dome_modes_items[] ={
1058 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1059 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1060 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1061 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1062 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1063 {0, NULL, 0, NULL, NULL}};
1065 static EnumPropertyItem stereo_modes_items[] ={
1066 // {STEREO_NOSTEREO, "NO_STEREO", 0, "No Stereo", ""},
1067 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1068 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1069 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1070 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1071 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1072 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1073 // {STEREO_DOME, "DOME", 0, "Dome", ""},
1074 {0, NULL, 0, NULL, NULL}};
1076 static EnumPropertyItem stereo_items[] ={
1077 {STEREO_NOSTEREO, "NONE", 0, "None", ""},
1078 {STEREO_ENABLED, "STEREO", 0, "Stereo", ""},
1079 {STEREO_DOME, "DOME", 0, "Dome", ""},
1080 {0, NULL, 0, NULL, NULL}};
1082 static EnumPropertyItem physics_engine_items[] = {
1083 {WOPHY_NONE, "NONE", 0, "None", ""},
1084 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1085 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1086 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1087 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1088 {WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
1089 {0, NULL, 0, NULL, NULL}};
1091 static EnumPropertyItem material_items[] ={
1092 {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials."},
1093 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials."},
1094 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders."},
1095 {0, NULL, 0, NULL, NULL}};
1097 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1098 RNA_def_struct_sdna(srna, "GameData");
1099 RNA_def_struct_nested(brna, srna, "Scene");
1100 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock.");
1102 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1103 RNA_def_property_int_sdna(prop, NULL, "xplay");
1104 RNA_def_property_range(prop, 4, 10000);
1105 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen.");
1106 RNA_def_property_update(prop, NC_SCENE, NULL);
1108 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1109 RNA_def_property_int_sdna(prop, NULL, "yplay");
1110 RNA_def_property_range(prop, 4, 10000);
1111 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen.");
1112 RNA_def_property_update(prop, NC_SCENE, NULL);
1114 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
1115 RNA_def_property_int_sdna(prop, NULL, "depth");
1116 RNA_def_property_range(prop, 8, 32);
1117 RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display.");
1118 RNA_def_property_update(prop, NC_SCENE, NULL);
1120 // Do we need it here ? (since we already have it in World
1121 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1122 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1123 RNA_def_property_range(prop, 4, 2000);
1124 RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display.");
1125 RNA_def_property_update(prop, NC_SCENE, NULL);
1127 prop= RNA_def_property(srna, "fullscreen", PROP_BOOLEAN, PROP_NONE);
1128 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1129 RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
1130 RNA_def_property_update(prop, NC_SCENE, NULL);
1133 prop= RNA_def_property(srna, "framing_type", PROP_ENUM, PROP_NONE);
1134 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1135 RNA_def_property_enum_items(prop, framing_types_items);
1136 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want.");
1137 RNA_def_property_update(prop, NC_SCENE, NULL);
1139 prop= RNA_def_property(srna, "framing_color", PROP_FLOAT, PROP_COLOR);
1140 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1141 RNA_def_property_array(prop, 3);
1142 RNA_def_property_ui_text(prop, "", "");
1143 RNA_def_property_update(prop, NC_SCENE, NULL);
1146 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1147 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1148 RNA_def_property_enum_items(prop, stereo_items);
1149 RNA_def_property_ui_text(prop, "Stereo Options", "");
1150 RNA_def_property_update(prop, NC_SCENE, NULL);
1152 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1153 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1154 RNA_def_property_enum_items(prop, stereo_modes_items);
1155 RNA_def_property_ui_text(prop, "Stereo Mode", "");
1156 RNA_def_property_update(prop, NC_SCENE, NULL);
1159 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1160 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1161 RNA_def_property_enum_items(prop, dome_modes_items);
1162 RNA_def_property_ui_text(prop, "Dome Mode", "");
1163 RNA_def_property_update(prop, NC_SCENE, NULL);
1165 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1166 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1167 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1168 RNA_def_property_ui_text(prop, "Tesselation", "Tesselation level - check the generated mesh in wireframe mode");
1169 RNA_def_property_update(prop, NC_SCENE, NULL);
1171 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1172 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1173 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1174 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1175 RNA_def_property_update(prop, NC_SCENE, NULL);
1177 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1178 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1179 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1180 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1181 RNA_def_property_update(prop, NC_SCENE, NULL);
1183 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1184 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1185 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1186 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1187 RNA_def_property_update(prop, NC_SCENE, NULL);
1189 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
1190 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
1191 RNA_def_property_struct_type(prop, "Text");
1192 RNA_def_property_flag(prop, PROP_EDITABLE);
1193 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
1194 RNA_def_property_update(prop, NC_SCENE, NULL);
1197 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
1198 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
1199 RNA_def_property_enum_items(prop, physics_engine_items);
1200 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine.");
1201 RNA_def_property_update(prop, NC_SCENE, NULL);
1203 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
1204 RNA_def_property_float_sdna(prop, NULL, "gravity");
1205 RNA_def_property_range(prop, 0.0, 25.0);
1206 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine.");
1207 RNA_def_property_update(prop, NC_SCENE, NULL);
1209 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_FLOAT, PROP_NONE);
1210 RNA_def_property_float_sdna(prop, NULL, "occlusionRes");
1211 RNA_def_property_range(prop, 128.0, 1024.0);
1212 RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precsion (slower)");
1213 RNA_def_property_update(prop, NC_SCENE, NULL);
1215 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1216 RNA_def_property_int_sdna(prop, NULL, "ticrate");
1217 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
1218 RNA_def_property_range(prop, 1, 250);
1219 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.");
1220 RNA_def_property_update(prop, NC_SCENE, NULL);
1222 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
1223 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
1224 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1225 RNA_def_property_range(prop, 1, 5);
1226 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");
1227 RNA_def_property_update(prop, NC_SCENE, NULL);
1229 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
1230 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
1231 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1232 RNA_def_property_range(prop, 1, 5);
1233 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");
1234 RNA_def_property_update(prop, NC_SCENE, NULL);
1236 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
1237 RNA_def_property_int_sdna(prop, NULL, "physubstep");
1238 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1239 RNA_def_property_range(prop, 1, 5);
1240 RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
1241 RNA_def_property_update(prop, NC_SCENE, NULL);
1244 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
1245 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
1246 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustrum and occlusion culling");
1247 RNA_def_property_update(prop, NC_SCENE, NULL);
1249 // not used // deprecated !!!!!!!!!!!!!
1250 prop= RNA_def_property(srna, "activity_culling", PROP_BOOLEAN, PROP_NONE);
1251 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
1252 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
1253 RNA_def_property_update(prop, NC_SCENE, NULL);
1255 // not used // deprecated !!!!!!!!!!!!!
1256 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
1257 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
1258 RNA_def_property_range(prop, 0.0, 1000.0);
1259 RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
1260 RNA_def_property_update(prop, NC_SCENE, NULL);
1263 prop= RNA_def_property(srna, "all_frames", PROP_BOOLEAN, PROP_NONE);
1264 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
1265 RNA_def_property_ui_text(prop, "All Frames", "Render as many frames as possible, rather than respecting framerate.");
1266 RNA_def_property_update(prop, NC_SCENE, NULL);
1268 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
1269 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
1270 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs.");
1271 RNA_def_property_update(prop, NC_SCENE, NULL);
1273 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
1274 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
1275 RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs.");
1276 RNA_def_property_update(prop, NC_SCENE, NULL);
1278 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
1279 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
1280 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions.");
1281 RNA_def_property_update(prop, NC_SCENE, NULL);
1283 prop= RNA_def_property(srna, "display_lists", PROP_BOOLEAN, PROP_NONE);
1284 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
1285 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU.");
1286 RNA_def_property_update(prop, NC_SCENE, NULL);
1288 prop= RNA_def_property(srna, "deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
1289 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
1290 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API.");
1291 RNA_def_property_update(prop, NC_SCENE, NULL);
1294 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
1295 RNA_def_property_enum_sdna(prop, NULL, "matmode");
1296 RNA_def_property_enum_items(prop, material_items);
1297 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering.");
1298 RNA_def_property_update(prop, NC_SCENE, NULL);
1300 prop= RNA_def_property(srna, "glsl_lights", PROP_BOOLEAN, PROP_NONE);
1301 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
1302 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering.");
1303 RNA_def_property_update(prop, NC_SCENE, NULL);
1305 prop= RNA_def_property(srna, "glsl_shaders", PROP_BOOLEAN, PROP_NONE);
1306 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
1307 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering.");
1308 RNA_def_property_update(prop, NC_SCENE, NULL);
1310 prop= RNA_def_property(srna, "glsl_shadows", PROP_BOOLEAN, PROP_NONE);
1311 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
1312 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering.");
1313 RNA_def_property_update(prop, NC_SCENE, NULL);
1315 prop= RNA_def_property(srna, "glsl_ramps", PROP_BOOLEAN, PROP_NONE);
1316 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
1317 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering.");
1318 RNA_def_property_update(prop, NC_SCENE, NULL);
1320 prop= RNA_def_property(srna, "glsl_nodes", PROP_BOOLEAN, PROP_NONE);
1321 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
1322 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering.");
1323 RNA_def_property_update(prop, NC_SCENE, NULL);
1325 prop= RNA_def_property(srna, "glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
1326 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
1327 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering.");
1328 RNA_def_property_update(prop, NC_SCENE, NULL);
1331 static void rna_def_scene_render_layer(BlenderRNA *brna)
1336 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
1337 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer.");
1339 rna_def_render_layer_common(srna, 1);
1343 rna_def_freestyle_settings(brna);
1345 prop= RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE);
1346 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1347 RNA_def_property_pointer_sdna(prop, NULL, "freestyleConfig");
1348 RNA_def_property_struct_type(prop, "FreestyleSettings");
1349 RNA_def_property_ui_text(prop, "Freestyle Settings", "");
1352 static void rna_def_scene_render_data(BlenderRNA *brna)
1357 static EnumPropertyItem pixel_filter_items[] ={
1358 {R_FILTER_BOX, "BOX", 0, "Box", ""},
1359 {R_FILTER_TENT, "TENT", 0, "Tent", ""},
1360 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""},
1361 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""},
1362 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""},
1363 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""},
1364 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""},
1365 {0, NULL, 0, NULL, NULL}};
1367 static EnumPropertyItem alpha_mode_items[] ={
1368 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
1369 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
1370 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
1371 {0, NULL, 0, NULL, NULL}};
1373 static EnumPropertyItem color_mode_items[] ={
1374 {R_PLANESBW, "BW", 0, "BW", "Images are saved with BW (grayscale) data"},
1375 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
1376 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
1377 {0, NULL, 0, NULL, NULL}};
1379 static EnumPropertyItem display_mode_items[] ={
1380 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
1381 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
1382 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
1383 {0, NULL, 0, NULL, NULL}};
1386 static EnumPropertyItem bake_mode_items[] ={
1387 {RE_BAKE_ALL, "FULL", 0, "Full Render", ""},
1388 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""},
1389 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""},
1390 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""},
1391 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""},
1392 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""},
1393 {0, NULL, 0, NULL, NULL}};
1395 static EnumPropertyItem bake_normal_space_items[] ={
1396 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""},
1397 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""},
1398 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""},
1399 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
1400 {0, NULL, 0, NULL, NULL}};
1402 static EnumPropertyItem bake_aa_items[] ={
1403 {5, "AA_5", 0, "5", ""},
1404 {8, "AA_8", 0, "8", ""},
1405 {11, "AA_11", 0, "11", ""},
1406 {16, "AA_16", 0, "16", ""},
1407 {0, NULL, 0, NULL, NULL}};
1409 static EnumPropertyItem octree_resolution_items[] = {
1410 {64, "OCTREE_RES_64", 0, "64", ""},
1411 {128, "OCTREE_RES_128", 0, "128", ""},
1412 {256, "OCTREE_RES_256", 0, "256", ""},
1413 {512, "OCTREE_RES_512", 0, "512", ""},
1414 {0, NULL, 0, NULL, NULL}};
1416 static EnumPropertyItem raytrace_structure_items[] = {
1417 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""},
1418 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure."},
1419 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
1420 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""},
1421 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""},
1422 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""},
1423 {0, NULL, 0, NULL, NULL}
1426 static EnumPropertyItem fixed_oversample_items[] = {
1427 {5, "OVERSAMPLE_5", 0, "5", ""},
1428 {8, "OVERSAMPLE_8", 0, "8", ""},
1429 {11, "OVERSAMPLE_11", 0, "11", ""},
1430 {16, "OVERSAMPLE_16", 0, "16", ""},
1431 {0, NULL, 0, NULL, NULL}};
1433 static EnumPropertyItem field_order_items[] = {
1434 {0, "FIELDS_EVENFIRST", 0, "Even", "Even Fields First"},
1435 {R_ODDFIELD, "FIELDS_ODDFIRST", 0, "Odd", "Odd Fields First"},
1436 {0, NULL, 0, NULL, NULL}};
1438 static EnumPropertyItem threads_mode_items[] = {
1439 {0, "THREADS_AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
1440 {R_FIXED_THREADS, "THREADS_FIXED", 0, "Fixed", "Manually determine the number of threads"},
1441 {0, NULL, 0, NULL, NULL}};
1443 static EnumPropertyItem image_type_items[] = {
1444 {0, "", 0, "Image", NULL},
1445 {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""},
1446 {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""},
1447 #ifdef WITH_OPENJPEG
1448 {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""},
1450 {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""},
1451 {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""},
1452 {R_RAWTGA, "RAWTARGA", ICON_FILE_IMAGE, "Targa Raw", ""},
1453 //{R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, // XXX not yet implemented
1454 {R_HAMX, "HAMX", ICON_FILE_IMAGE, "HamX", ""},
1455 {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""},
1456 {0, "", 0, " ", NULL},
1458 {R_OPENEXR, "OPENEXR", ICON_FILE_IMAGE, "OpenEXR", ""},
1459 {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""},
1461 {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""}, // XXX only with G.have_libtiff
1462 {R_RADHDR, "RADHDR", ICON_FILE_IMAGE, "Radiance HDR", ""},
1463 {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""},
1464 {R_DPX, "DPX", ICON_FILE_IMAGE, "DPX", ""},
1465 {0, "", 0, "Movie", NULL},
1466 {R_AVIRAW, "AVIRAW", ICON_FILE_MOVIE, "AVI Raw", ""},
1467 {R_AVIJPEG, "AVIJPEG", ICON_FILE_MOVIE, "AVI JPEG", ""},
1469 {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""},
1471 #ifdef WITH_QUICKTIME
1472 {R_QUICKTIME, "QUICKTIME", ICON_FILE_MOVIE, "QuickTime", ""},
1475 {R_MOVIE, "MOVIE", ICON_FILE_MOVIE, "Movie", ""},
1478 {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
1479 {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""},
1483 {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
1486 {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "FFMpeg", ""},
1488 {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
1489 {0, NULL, 0, NULL, NULL}};
1492 static EnumPropertyItem exr_codec_items[] = {
1493 {0, "NONE", 0, "None", ""},
1494 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
1495 {2, "ZIP", 0, "ZIP (lossless)", ""},
1496 {3, "PIZ", 0, "PIZ (lossless)", ""},
1497 {4, "RLE", 0, "RLE (lossless)", ""},
1498 {0, NULL, 0, NULL, NULL}};
1501 #ifdef WITH_OPENJPEG
1502 static EnumPropertyItem jp2_preset_items[] = {
1503 {0, "NO_PRESET", 0, "No Preset", ""},
1504 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
1505 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
1506 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
1507 {4, "CINE_SCOPE_48FPS", 0, "Cine-Scope 24fps 2048x858", ""},
1508 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
1509 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
1510 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
1511 {0, NULL, 0, NULL, NULL}};
1513 static EnumPropertyItem jp2_depth_items[] = {
1514 {8, "8", 0, "8", "8 bit color channels"},
1515 {12, "12", 0, "12", "12 bit color channels"},
1516 {16, "16", 0, "16", "16 bit color channels"},
1517 {0, NULL, 0, NULL, NULL}};
1521 static EnumPropertyItem ffmpeg_format_items[] = {
1522 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
1523 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
1524 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
1525 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
1526 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
1527 {FFMPEG_DV, "DV", 0, "DV", ""},
1528 {FFMPEG_H264, "H264", 0, "H.264", ""},
1529 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
1533 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
1536 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
1537 {0, NULL, 0, NULL, NULL}};
1539 static EnumPropertyItem ffmpeg_codec_items[] = {
1540 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
1541 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
1542 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
1543 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
1544 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
1545 {CODEC_ID_H264, "H264", 0, "H.264", ""},
1546 {CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
1548 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
1550 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
1551 {0, NULL, 0, NULL, NULL}};
1553 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
1554 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
1555 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
1556 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
1557 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
1558 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
1559 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
1560 {0, NULL, 0, NULL, NULL}};
1563 static EnumPropertyItem engine_items[] = {
1564 {0, "BLENDER_RENDER", 0, "Blender Render", ""},
1565 {0, NULL, 0, NULL, NULL}};
1567 srna= RNA_def_struct(brna, "SceneRenderData", NULL);
1568 RNA_def_struct_sdna(srna, "RenderData");
1569 RNA_def_struct_nested(brna, srna, "Scene");
1570 RNA_def_struct_path_func(srna, "rna_SceneRenderData_path");
1571 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock.");
1573 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
1574 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
1575 RNA_def_property_enum_items(prop, color_mode_items);
1576 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");
1577 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1579 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1580 RNA_def_property_int_sdna(prop, NULL, "xsch");
1581 RNA_def_property_range(prop, 4, 10000);
1582 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image.");
1583 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
1585 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1586 RNA_def_property_int_sdna(prop, NULL, "ysch");
1587 RNA_def_property_range(prop, 4, 10000);
1588 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image.");
1589 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
1591 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
1592 RNA_def_property_int_sdna(prop, NULL, "size");
1593 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
1594 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
1595 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1597 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
1598 RNA_def_property_int_sdna(prop, NULL, "xparts");
1599 RNA_def_property_range(prop, 1, 512);
1600 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering.");
1601 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1603 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
1604 RNA_def_property_int_sdna(prop, NULL, "yparts");
1605 RNA_def_property_range(prop, 1, 512);
1606 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering.");
1607 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1609 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
1610 RNA_def_property_float_sdna(prop, NULL, "xasp");
1611 RNA_def_property_range(prop, 1.0f, 200.0f);
1612 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
1613 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
1615 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
1616 RNA_def_property_float_sdna(prop, NULL, "yasp");
1617 RNA_def_property_range(prop, 1.0f, 200.0f);
1618 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
1619 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
1621 /* JPEG and AVI JPEG */
1623 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
1624 RNA_def_property_int_sdna(prop, NULL, "quality");
1625 RNA_def_property_range(prop, 1, 100);
1626 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies.");
1627 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1631 prop= RNA_def_property(srna, "tiff_bit", PROP_BOOLEAN, PROP_NONE);
1632 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
1633 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
1634 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1636 /* Cineon and DPX */
1638 prop= RNA_def_property(srna, "cineon_log", PROP_BOOLEAN, PROP_NONE);
1639 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
1640 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
1641 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1643 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
1644 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
1645 RNA_def_property_range(prop, 0, 1024);
1646 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
1647 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1649 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
1650 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
1651 RNA_def_property_range(prop, 0, 1024);
1652 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
1653 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1655 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
1656 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
1657 RNA_def_property_range(prop, 0.0f, 10.0f);
1658 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
1659 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1664 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
1665 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
1666 RNA_def_property_enum_items(prop, exr_codec_items);
1667 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
1668 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1670 prop= RNA_def_property(srna, "exr_half", PROP_BOOLEAN, PROP_NONE);
1671 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
1672 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
1673 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1675 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
1676 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
1677 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int zbuffer)");
1678 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1680 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
1681 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
1682 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
1683 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1686 #ifdef WITH_OPENJPEG
1689 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
1690 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
1691 RNA_def_property_enum_items(prop, jp2_preset_items);
1692 RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_jpeg2k_preset_set", NULL);
1693 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
1694 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1696 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
1697 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
1698 RNA_def_property_enum_items(prop, jp2_depth_items);
1699 RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_jpeg2k_depth_set", NULL);
1700 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
1701 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1703 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
1704 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
1705 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
1706 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1712 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
1713 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
1714 RNA_def_property_enum_items(prop, ffmpeg_format_items);
1715 RNA_def_property_ui_text(prop, "Format", "Output file format");
1716 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1718 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
1719 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
1720 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
1721 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
1722 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1724 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
1725 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
1726 RNA_def_property_range(prop, 1, 14000);
1727 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
1728 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1730 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
1731 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
1732 RNA_def_property_range(prop, 0, 9000);
1733 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
1734 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1736 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
1737 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
1738 RNA_def_property_range(prop, 1, 14000);
1739 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
1740 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1742 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
1743 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
1744 RNA_def_property_range(prop, 0, 100000000);
1745 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
1746 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1748 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
1749 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
1750 RNA_def_property_range(prop, 0, 100);
1751 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
1752 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1754 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
1755 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
1756 RNA_def_property_range(prop, 0, 2000);
1757 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
1758 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1760 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
1761 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
1762 RNA_def_property_range(prop, 0, 16384);
1763 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
1764 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1766 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
1767 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
1768 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary.");
1769 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1773 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
1774 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
1775 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
1776 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
1777 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1779 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
1780 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
1781 RNA_def_property_range(prop, 32, 384);
1782 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
1783 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1785 prop= RNA_def_property(srna, "ffmpeg_multiplex_audio", PROP_BOOLEAN, PROP_NONE);
1786 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_MULTIPLEX_AUDIO);
1787 RNA_def_property_ui_text(prop, "Multiplex Audio", "Interleave audio with the output video");
1788 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1790 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
1791 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
1792 RNA_def_property_range(prop, 8000, 192000);
1793 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
1794 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1796 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
1797 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
1798 RNA_def_property_range(prop, 0.0f, 1.0f);
1799 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
1800 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1804 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1805 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
1806 RNA_def_property_range(prop, 1, 120);
1807 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second.");
1808 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1810 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
1811 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
1812 RNA_def_property_range(prop, 0.1f, 120.0f);
1813 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
1814 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1816 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
1817 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
1818 RNA_def_property_range(prop, 0.0f, 2.0f);
1819 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding.");
1820 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1822 prop= RNA_def_property(srna, "pixel_filter", PROP_ENUM, PROP_NONE);
1823 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
1824 RNA_def_property_enum_items(prop, pixel_filter_items);
1825 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples.");
1826 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1828 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
1829 RNA_def_property_float_sdna(prop, NULL, "gauss");
1830 RNA_def_property_range(prop, 0.5f, 1.5f);
1831 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples.");
1832 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1834 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
1835 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
1836 RNA_def_property_enum_items(prop, alpha_mode_items);
1837 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels.");
1838 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1840 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
1841 RNA_def_property_enum_sdna(prop, NULL, "ocres");
1842 RNA_def_property_enum_items(prop, octree_resolution_items);
1843 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes.");
1844 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1846 prop= RNA_def_property(srna, "raytrace_structure", PROP_ENUM, PROP_NONE);
1847 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
1848 RNA_def_property_enum_items(prop, raytrace_structure_items);
1849 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure.");
1850 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1852 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
1853 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
1854 RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates.");
1855 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1857 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
1858 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
1859 RNA_def_property_ui_text(prop, "Use Local Coords", "Vertex coordinates are stored localy on each primitive. Increases memory usage, but may have impact on speed.");
1860 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1862 prop= RNA_def_property(srna, "antialiasing", PROP_BOOLEAN, PROP_NONE);
1863 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
1864 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges.");
1865 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1867 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
1868 RNA_def_property_enum_sdna(prop, NULL, "osa");
1869 RNA_def_property_enum_items(prop, fixed_oversample_items);
1870 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel.");
1871 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1873 prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
1874 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
1875 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output.");
1876 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1878 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
1879 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
1880 RNA_def_property_enum_items(prop, field_order_items);
1881 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");
1882 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1884 prop= RNA_def_property(srna, "fields_still", PROP_BOOLEAN, PROP_NONE);
1885 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
1886 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields.");
1887 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1889 prop= RNA_def_property(srna, "render_shadows", PROP_BOOLEAN, PROP_NONE);
1890 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
1891 RNA_def_property_ui_text(prop, "Render Shadows", "Calculate shadows while rendering.");
1892 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1894 prop= RNA_def_property(srna, "render_envmaps", PROP_BOOLEAN, PROP_NONE);
1895 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
1896 RNA_def_property_ui_text(prop, "Render Environment Maps", "Calculate environment maps while rendering.");
1897 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1899 prop= RNA_def_property(srna, "render_radiosity", PROP_BOOLEAN, PROP_NONE);
1900 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
1901 RNA_def_property_ui_text(prop, "Render Radiosity", "Calculate radiosity in a pre-process before rendering.");
1902 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1904 prop= RNA_def_property(srna, "render_sss", PROP_BOOLEAN, PROP_NONE);
1905 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
1906 RNA_def_property_ui_text(prop, "Render SSS", "Calculate sub-surface scattering in materials rendering.");
1907 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1909 prop= RNA_def_property(srna, "render_raytracing", PROP_BOOLEAN, PROP_NONE);
1910 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
1911 RNA_def_property_ui_text(prop, "Render Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects.");
1912 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1914 prop= RNA_def_property(srna, "render_textures", PROP_BOOLEAN, PROP_NONE);
1915 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
1916 RNA_def_property_ui_text(prop, "Render Textures", "Use textures to affect material properties.");
1917 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1919 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
1920 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
1921 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
1922 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1924 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
1925 RNA_def_property_int_sdna(prop, NULL, "edgeint");
1926 RNA_def_property_range(prop, 0, 255);
1927 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
1928 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1930 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
1931 RNA_def_property_float_sdna(prop, NULL, "edgeR");
1932 RNA_def_property_array(prop, 3);
1933 RNA_def_property_ui_text(prop, "Edge Color", "");
1934 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1936 prop= RNA_def_property(srna, "freestyle", PROP_BOOLEAN, PROP_NONE);
1937 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE_FRS);
1938 RNA_def_property_ui_text(prop, "Edge", "Draw stylized strokes using Freestyle.");
1939 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1941 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
1942 RNA_def_property_int_sdna(prop, NULL, "threads");
1943 RNA_def_property_range(prop, 1, 8);
1944 RNA_def_property_int_funcs(prop, "rna_SceneRenderData_threads_get", NULL, NULL);
1945 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
1946 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1948 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
1949 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
1950 RNA_def_property_enum_items(prop, threads_mode_items);
1951 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
1952 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1954 prop= RNA_def_property(srna, "motion_blur", PROP_BOOLEAN, PROP_NONE);
1955 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
1956 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur (uses number of anti-aliasing samples).");
1957 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1959 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
1960 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
1961 RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size.");
1962 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1964 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
1965 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
1966 RNA_def_property_range(prop, 0.0f, 1.0f);
1967 RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border.");
1968 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1970 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
1971 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
1972 RNA_def_property_range(prop, 0.0f, 1.0f);
1973 RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
1974 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1976 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
1977 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
1978 RNA_def_property_range(prop, 0.0f, 1.0f);
1979 RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
1980 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1982 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
1983 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
1984 RNA_def_property_range(prop, 0.0f, 1.0f);
1985 RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
1986 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1988 prop= RNA_def_property(srna, "crop_to_border", PROP_BOOLEAN, PROP_NONE);
1989 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
1990 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size.");
1991 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1993 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
1994 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
1995 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch').");
1996 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1998 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
1999 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2000 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering.");
2001 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2003 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
2004 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
2005 RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled.");
2006 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2008 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
2009 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
2010 RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist.");
2011 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2013 prop= RNA_def_property(srna, "color_management", PROP_BOOLEAN, PROP_NONE);
2014 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
2015 RNA_def_property_ui_text(prop, "Color Management", "Use color profiles and gamma corrected imaging pipeline");
2016 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_MATERIAL|ND_SHADING, NULL);
2018 prop= RNA_def_property(srna, "file_extensions", PROP_BOOLEAN, PROP_NONE);
2019 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
2020 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
2021 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2023 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
2024 RNA_def_property_enum_sdna(prop, NULL, "imtype");
2025 RNA_def_property_enum_items(prop, image_type_items);
2026 RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_file_format_set", NULL);
2027 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as.");
2028 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2030 prop= RNA_def_property(srna, "free_image_textures", PROP_BOOLEAN, PROP_NONE);
2031 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2032 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing.");
2033 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2035 prop= RNA_def_property(srna, "free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
2036 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2037 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory.");
2038 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2040 prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE);
2041 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
2042 RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_save_buffers_get", NULL);
2043 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).");
2044 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2046 prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE);
2047 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
2048 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.");
2049 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2051 prop= RNA_def_property(srna, "backbuf", PROP_BOOLEAN, PROP_NONE);
2052 RNA_def_property_boolean_sdna(prop, NULL, "bufflag", R_BACKBUF);
2053 RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image");
2054 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2056 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2057 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
2058 RNA_def_property_enum_items(prop, display_mode_items);
2059 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
2060 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2062 prop= RNA_def_property(srna, "output_path", PROP_STRING, PROP_DIRPATH);
2063 RNA_def_property_string_sdna(prop, NULL, "pic");
2064 RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers.");
2065 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2069 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
2070 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
2071 RNA_def_property_enum_items(prop, bake_mode_items);
2072 RNA_def_property_ui_text(prop, "Bake Mode", "");
2074 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
2075 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
2076 RNA_def_property_enum_items(prop, bake_normal_space_items);
2077 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
2079 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
2080 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
2081 RNA_def_property_enum_items(prop, bake_aa_items);
2082 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
2084 prop= RNA_def_property(srna, "bake_active", PROP_BOOLEAN, PROP_NONE);
2085 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
2086 RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
2088 prop= RNA_def_property(srna, "bake_normalized", PROP_BOOLEAN, PROP_NONE);
2089 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
2090 RNA_def_property_ui_text(prop, "Normalized", "");
2091 //"Bake ambient occlusion normalized, without taking into acount material settings"
2092 //"Normalized displacement value to fit the 'Dist' range"
2093 // XXX: Need 1 tooltip here...
2095 prop= RNA_def_property(srna, "bake_clear", PROP_BOOLEAN, PROP_NONE);
2096 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
2097 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
2099 prop= RNA_def_property(srna, "bake_enable_aa", PROP_BOOLEAN, PROP_NONE);
2100 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
2101 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
2103 prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
2104 RNA_def_property_int_sdna(prop, NULL, "bake_filter");
2105 RNA_def_property_range(prop, 0, 32);
2106 RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
2108 prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
2109 RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
2110 RNA_def_property_range(prop, 0.0, 1000.0);
2111 RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
2113 prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
2114 RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
2115 RNA_def_property_range(prop, 0.0, 1000.0);
2116 RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
2120 prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE);
2121 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
2122 RNA_def_property_ui_text(prop, "Stamp Time", "Include the current time in image metadata");
2123 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2125 prop= RNA_def_property(srna, "stamp_date", PROP_BOOLEAN, PROP_NONE);
2126 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
2127 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
2128 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2130 prop= RNA_def_property(srna, "stamp_frame", PROP_BOOLEAN, PROP_NONE);
2131 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
2132 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
2133 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2135 prop= RNA_def_property(srna, "stamp_camera", PROP_BOOLEAN, PROP_NONE);
2136 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
2137 RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
2138 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2140 prop= RNA_def_property(srna, "stamp_scene", PROP_BOOLEAN, PROP_NONE);
2141 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
2142 RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
2143 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2145 prop= RNA_def_property(srna, "stamp_note", PROP_BOOLEAN, PROP_NONE);
2146 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
2147 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
2148 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2150 prop= RNA_def_property(srna, "stamp_marker", PROP_BOOLEAN, PROP_NONE);
2151 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
2152 RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
2153 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2155 prop= RNA_def_property(srna, "stamp_filename", PROP_BOOLEAN, PROP_NONE);
2156 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
2157 RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
2158 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2160 prop= RNA_def_property(srna, "stamp_sequence_strip", PROP_BOOLEAN, PROP_NONE);
2161 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
2162 RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
2163 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2165 prop= RNA_def_property(srna, "stamp_render_time", PROP_BOOLEAN, PROP_NONE);
2166 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
2167 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
2168 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2170 prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
2171 RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
2172 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
2173 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2175 prop= RNA_def_property(srna, "render_stamp", PROP_BOOLEAN, PROP_NONE);
2176 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
2177 RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
2178 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2180 prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
2181 RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
2182 RNA_def_property_range(prop, 8, 64);
2183 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
2184 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2186 prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
2187 RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
2188 RNA_def_property_array(prop, 4);
2189 RNA_def_property_range(prop,0.0,1.0);
2190 RNA_def_property_ui_text(prop, "Stamp Foreground", "Stamp text color");
2191 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2193 prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
2194 RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
2195 RNA_def_property_array(prop, 4);
2196 RNA_def_property_range(prop,0.0,1.0);
2197 RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
2198 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2202 prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
2203 RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
2204 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2205 RNA_def_property_ui_text(prop, "Render Layers", "");
2207 prop= RNA_def_property(srna, "single_layer", PROP_BOOLEAN, PROP_NONE);
2208 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
2209 RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer.");
2210 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2212 prop= RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE);
2213 RNA_def_property_int_sdna(prop, NULL, "actlay");
2214 RNA_def_property_int_funcs(prop, "rna_SceneRenderData_active_layer_index_get", "rna_SceneRenderData_active_layer_index_set", "rna_SceneRenderData_active_layer_index_range");
2215 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array.");
2216 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2219 prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
2220 RNA_def_property_enum_items(prop, engine_items);
2221 RNA_def_property_enum_funcs(prop, "rna_SceneRenderData_engine_get", "rna_SceneRenderData_engine_set", "rna_SceneRenderData_engine_itemf");
2222 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering.");
2223 RNA_def_property_update(prop, NC_WINDOW, NULL);
2225 prop= RNA_def_property(srna, "multiple_engines", PROP_BOOLEAN, PROP_NONE);
2226 RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_multiple_engines_get", NULL);
2227 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2228 RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available.");
2230 prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
2231 RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_use_game_engine_get", NULL);
2232 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2233 RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine.");
2236 void RNA_def_scene(BlenderRNA *brna)
2242 static EnumPropertyItem audio_distance_model_items[] = {
2243 {0, "NONE", 0, "None", "No distance attenuation."},
2244 {1, "INVERSE", 0, "Inverse", "Inverse distance model."},
2245 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping."},
2246 {3, "LINEAR", 0, "Linear", "Linear distance model."},
2247 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping."},
2248 {5, "EXPONENT", 0, "Exponent", "Exponent distance model."},
2249 {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping."},
2250 {0, NULL, 0, NULL, NULL}};
2252 /* Struct definition */
2253 srna= RNA_def_struct(brna, "Scene", "ID");
2254 RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings.");
2255 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
2256 RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
2258 /* Global Settings */
2259 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
2260 RNA_def_property_flag(prop, PROP_EDITABLE);
2261 RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene.");
2263 prop= RNA_def_property(srna, "set", PROP_POINTER, PROP_NONE);
2264 RNA_def_property_pointer_sdna(prop, NULL, "set");
2265 RNA_def_property_struct_type(prop, "Scene");
2266 //RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2267 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2268 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL);
2269 RNA_def_property_ui_text(prop, "Set Scene", "Background set scene.");
2271 prop= RNA_def_property(srna, "active_object", PROP_POINTER, PROP_NONE);
2272 RNA_def_property_struct_type(prop, "Object");
2273 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL);
2274 RNA_def_property_flag(prop, PROP_EDITABLE);
2275 RNA_def_property_ui_text(prop, "Object", "Object to use as projector transform.");
2278 prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
2279 RNA_def_property_flag(prop, PROP_EDITABLE);
2280 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene.");
2281 RNA_def_property_update(prop, NC_WORLD, NULL);
2283 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ|PROP_UNIT_LENGTH);
2284 RNA_def_property_float_sdna(prop, NULL, "cursor");
2285 RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location.");
2286 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
2287 RNA_def_property_update(prop, NC_WINDOW, NULL);
2290 prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
2291 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
2292 RNA_def_property_struct_type(prop, "Object");
2293 RNA_def_property_ui_text(prop, "Objects", "");
2294 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0, 0, 0);
2297 prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
2298 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
2299 RNA_def_property_array(prop, 20);
2300 RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene.");
2301 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
2304 /* Frame Range Stuff */
2305 prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_TIME);
2306 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
2307 RNA_def_property_int_sdna(prop, NULL, "r.cfra");
2308 RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
2309 RNA_def_property_ui_text(prop, "Current Frame", "");
2310 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
2312 prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
2313 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
2314 RNA_def_property_int_sdna(prop, NULL, "r.sfra");
2315 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
2316 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
2317 RNA_def_property_ui_text(prop, "Start Frame", "");
2318 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2320 prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_TIME);
2321 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
2322 RNA_def_property_int_sdna(prop, NULL, "r.efra");
2323 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
2324 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
2325 RNA_def_property_ui_text(prop, "End Frame", "");
2326 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2328 prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
2329 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
2330 RNA_def_property_int_sdna(prop, NULL, "frame_step");
2331 RNA_def_property_range(prop, 0, MAXFRAME);
2332 RNA_def_property_ui_range(prop, 0, 100, 1, 0);
2333 RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
2334 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2336 /* Preview Range (frame-range for UI playback) */
2337 prop=RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE); /* use_preview_range is not really a separate setting in SDNA */
2338 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
2339 RNA_def_property_boolean_funcs(prop, "rna_Scene_use_preview_range_get", "rna_Scene_use_preview_range_set");
2340 RNA_def_property_ui_text(prop, "Use Preview Range", "");
2341 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2343 prop= RNA_def_property(srna, "preview_range_start_frame", PROP_INT, PROP_TIME);
2344 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
2345 RNA_def_property_int_sdna(prop, NULL, "r.psfra");
2346 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
2347 RNA_def_property_ui_text(prop, "Preview Range Start Frame", "");
2348 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2350 prop= RNA_def_property(srna, "preview_range_end_frame", PROP_INT, PROP_TIME);
2351 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
2352 RNA_def_property_int_sdna(prop, NULL, "r.pefra");
2353 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
2354 RNA_def_property_ui_text(prop, "Preview Range End Frame", "");
2355 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2358 prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
2359 RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
2360 RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping.");
2361 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2363 /* Animation Data (for Scene) */
2364 rna_def_animdata_common(srna);
2366 /* Nodes (Compositing) */
2367 prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
2368 RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree.");
2370 prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
2371 RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
2372 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_nodes_set");
2373 RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree.");
2374 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2377 prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
2378 RNA_def_property_pointer_sdna(prop, NULL, "ed");
2379 RNA_def_property_struct_type(prop, "SequenceEditor");
2380 RNA_def_property_ui_text(prop, "Sequence Editor", "");
2383 prop= RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
2384 RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
2385 RNA_def_property_struct_type(prop, "KeyingSet");
2386 RNA_def_property_ui_text(prop, "Keying Sets", "Keying Sets for this Scene.");
2387 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2389 prop= RNA_def_property(srna, "active_keying_set", PROP_POINTER, PROP_NONE);
2390 RNA_def_property_struct_type(prop, "KeyingSet");
2391 RNA_def_property_flag(prop, PROP_EDITABLE);
2392 RNA_def_property_editable_func(prop, "rna_Scene_active_keying_set_editable");
2393 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL);
2394 RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes.");
2395 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2397 prop= RNA_def_property(srna, "active_keying_set_index", PROP_INT, PROP_NONE);
2398 RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
2399 RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", "rna_Scene_active_keying_set_index_range");
2400 RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index.");
2401 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2404 prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
2405 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2406 RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
2407 RNA_def_property_struct_type(prop, "ToolSettings");
2408 RNA_def_property_ui_text(prop, "Tool Settings", "");
2411 prop= RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
2412 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2413 RNA_def_property_pointer_sdna(prop, NULL, "unit");
2414 RNA_def_property_struct_type(prop, "UnitSettings");
2415 RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
2417 /* Physics Settings */
2418 prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
2419 RNA_def_property_float_sdna(prop, NULL, "physics_settings.gravity");
2420 RNA_def_property_array(prop, 3);
2421 RNA_def_property_range(prop, -200.0f, 200.0f);
2422 RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
2423 RNA_def_property_update(prop, 0, "rna_Physics_update");
2425 prop= RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
2426 RNA_def_property_boolean_sdna(prop, NULL, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
2427 RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics.");
2428 RNA_def_property_update(prop, 0, "rna_Physics_update");
2431 prop= RNA_def_property(srna, "render_data", PROP_POINTER, PROP_NONE);
2432 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2433 RNA_def_property_pointer_sdna(prop, NULL, "r");
2434 RNA_def_property_struct_type(prop, "SceneRenderData");
2435 RNA_def_property_ui_text(prop, "Render Data", "");
2438 prop= RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
2439 RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
2440 RNA_def_property_struct_type(prop, "TimelineMarker");
2441 RNA_def_property_ui_text(prop, "Timeline Markers", "Markers used in all timelines for the current scene.");
2443 /* Audio Settings */
2444 prop= RNA_def_property(srna, "mute_audio", PROP_BOOLEAN, PROP_NONE);
2445 RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_MUTE);
2446 RNA_def_property_ui_text(prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted.");
2447 RNA_def_property_update(prop, NC_SCENE, NULL);
2449 prop= RNA_def_property(srna, "sync_audio", PROP_BOOLEAN, PROP_NONE);
2450 RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
2451 RNA_def_property_ui_text(prop, "Audio Sync", "Play back and sync with audio from Sequence Editor.");
2452 RNA_def_property_update(prop, NC_SCENE, NULL);
2454 prop= RNA_def_property(srna, "scrub_audio", PROP_BOOLEAN, PROP_NONE);
2455 RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SCRUB);
2456 RNA_def_property_ui_text(prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing.");
2457 RNA_def_property_update(prop, NC_SCENE, NULL);
2459 prop= RNA_def_property(srna, "speed_of_sound", PROP_FLOAT, PROP_NONE);
2460 RNA_def_property_float_sdna(prop, NULL, "audio.speed_of_sound");
2461 RNA_def_property_range(prop, 0.01f, FLT_MAX);
2462 RNA_def_property_ui_text(prop, "Speed of Sound", "Speed of sound for doppler effect calculation.");
2463 RNA_def_property_update(prop, NC_SCENE, NULL);
2465 prop= RNA_def_property(srna, "doppler_factor", PROP_FLOAT, PROP_NONE);
2466 RNA_def_property_float_sdna(prop, NULL, "audio.doppler_factor");
2467 RNA_def_property_range(prop, 0.0, FLT_MAX);
2468 RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for doppler effect calculation.");
2469 RNA_def_property_update(prop, NC_SCENE, NULL);
2471 prop= RNA_def_property(srna, "distance_model", PROP_ENUM, PROP_NONE);
2472 RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio.distance_model");
2473 RNA_def_property_enum_items(prop, audio_distance_model_items);
2474 RNA_def_property_ui_text(prop, "Distance Model", "Distance model for distance attenuation calculation.");
2475 RNA_def_property_update(prop, NC_SCENE, NULL);
2478 prop= RNA_def_property(srna, "game_data", PROP_POINTER, PROP_NONE);
2479 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2480 RNA_def_property_pointer_sdna(prop, NULL, "gm");
2481 RNA_def_property_struct_type(prop, "SceneGameData");
2482 RNA_def_property_ui_text(prop, "Game Data", "");
2485 func= RNA_def_function(srna, "statistics", "ED_info_stats_string");
2486 prop= RNA_def_string(func, "statistics", "", 0, "Statistics", "");
2487 RNA_def_function_return(func, prop);
2490 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
2491 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
2492 RNA_def_property_flag(prop, PROP_EDITABLE);
2493 RNA_def_property_struct_type(prop, "GreasePencil");
2494 RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock");
2497 prop= RNA_def_property(srna, "freestyle_current_layer_number", PROP_INT, PROP_NONE);
2498 RNA_def_property_int_sdna(prop, NULL, "freestyle_current_layer_number");
2499 RNA_def_property_ui_text(prop, "Freestyle Current Layer Number", "Number of current layers in Freestyle.");
2500 RNA_def_property_update(prop, NC_SCENE, NULL);
2502 /* Transform Orientations */
2503 prop= RNA_def_property(srna, "orientations", PROP_COLLECTION, PROP_NONE);
2504 RNA_def_property_collection_sdna(prop, NULL, "transform_spaces", NULL);
2505 RNA_def_property_struct_type(prop, "TransformOrientation");
2506 RNA_def_property_ui_text(prop, "Transform Orientations", "");
2509 rna_def_tool_settings(brna);
2510 rna_def_unit_settings(brna);
2511 rna_def_scene_render_data(brna);
2512 rna_def_scene_game_data(brna);
2513 rna_def_scene_render_layer(brna);
2514 rna_def_transform_orientation(brna);
2517 RNA_api_scene(srna);