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_group_types.h"
33 #include "DNA_modifier_types.h"
34 #include "DNA_scene_types.h"
35 #include "DNA_userdef_types.h"
37 /* Include for Bake Options */
38 #include "RE_pipeline.h"
41 #include "quicktime_export.h"
45 #include "BKE_writeffmpeg.h"
46 #include <libavcodec/avcodec.h>
47 #include <libavformat/avformat.h>
52 #include "BLI_threads.h"
54 EnumPropertyItem snap_target_items[] = {
55 {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target."},
56 {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target."},
57 {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target."},
58 {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target."},
59 {0, NULL, 0, NULL, NULL}};
61 EnumPropertyItem proportional_falloff_items[] ={
62 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
63 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
64 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
65 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
66 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", ""},
67 {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", ""},
68 {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
69 {0, NULL, 0, NULL, NULL}};
72 EnumPropertyItem proportional_editing_items[] = {
73 {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", ""},
74 {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", ""},
75 {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", ""},
76 {0, NULL, 0, NULL, NULL}};
78 /* keep for operators, not used here */
79 EnumPropertyItem mesh_select_mode_items[] = {
80 {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."},
81 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."},
82 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."},
83 {0, NULL, 0, NULL, NULL}};
85 EnumPropertyItem snap_element_items[] = {
86 {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid."},
87 {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices."},
88 {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges."},
89 {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces."},
90 {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume."},
91 {0, NULL, 0, NULL, NULL}};
95 #include "DNA_anim_types.h"
96 #include "DNA_node_types.h"
97 #include "DNA_object_types.h"
98 #include "DNA_mesh_types.h"
100 #include "BKE_context.h"
101 #include "BKE_global.h"
102 #include "BKE_image.h"
103 #include "BKE_main.h"
104 #include "BKE_node.h"
105 #include "BKE_pointcache.h"
106 #include "BKE_scene.h"
107 #include "BKE_depsgraph.h"
108 #include "BKE_image.h"
109 #include "BKE_mesh.h"
110 #include "BKE_sound.h"
112 #include "BLI_threads.h"
113 #include "BLI_editVert.h"
119 #include "ED_view3d.h"
120 #include "ED_object.h"
123 #include "RE_pipeline.h"
125 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
127 ListBaseIterator *internal= iter->internal;
129 /* we are actually iterating a Base list, so override get */
130 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
133 static void rna_Scene_link_object(Scene *scene, ReportList *reports, Object *ob)
137 if (ob->type != OB_EMPTY && ob->data==NULL) {
138 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is not an Empty type and has no Object Data set.");
142 if (object_in_scene(ob, scene)) {
143 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
147 base= scene_add_base(scene, ob);
150 /* this is similar to what object_add_type and add_object do */
151 ob->lay= base->lay= scene->lay;
152 ob->recalc |= OB_RECALC;
154 DAG_scene_sort(scene);
157 static void rna_Scene_unlink_object(Scene *scene, bContext *C, ReportList *reports, Object *ob)
159 Base *base= object_in_scene(ob, scene);
161 BKE_report(reports, RPT_ERROR, "Object is not in this scene.");
164 if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
165 BKE_report(reports, RPT_ERROR, "Object must be in 'Object Mode' to unlink.");
169 /* as long as ED_base_object_free_and_unlink calls free_libblock_us, we don't have to decrement ob->id.us */
170 ED_base_object_free_and_unlink(scene, base);
172 WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
175 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
177 ToolSettings *ts = (ToolSettings*)ptr->data;
178 if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
179 ts->skgen_template = value.data;
181 ts->skgen_template = NULL;
184 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
186 Scene *scene= (Scene*)ptr->data;
187 return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
190 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
192 Scene *scene= (Scene*)ptr->data;
194 scene->basact= object_in_scene((Object*)value.data, scene);
199 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
201 Scene *scene= (Scene*)ptr->data;
202 Scene *set= (Scene*)value.data;
205 for(nested_set= set; nested_set; nested_set= nested_set->set) {
206 if(nested_set==scene)
213 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
215 Scene *scene= (Scene*)ptr->data;
217 scene->lay= ED_view3d_scene_layer_set(scene->lay, values);
220 static void rna_Scene_layer_update(Main *bmain, Scene *unused, PointerRNA *ptr)
222 Scene *scene= (Scene*)ptr->data;
224 ED_view3d_scene_layers_update(bmain, scene);
227 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
229 Scene *data= (Scene*)ptr->data;
230 CLAMP(value, 1, data->r.efra);
234 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
236 Scene *data= (Scene*)ptr->data;
237 CLAMP(value, data->r.sfra, MAXFRAME);
241 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
243 Scene *data= (Scene*)ptr->data;
246 /* copy range from scene if not set before */
247 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
248 data->r.psfra= data->r.sfra;
249 data->r.pefra= data->r.efra;
252 data->r.flag |= SCER_PRV_RANGE;
255 data->r.flag &= ~SCER_PRV_RANGE;
259 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
261 Scene *data= (Scene*)ptr->data;
263 /* check if enabled already */
264 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
265 /* set end of preview range to end frame, then clamp as per normal */
266 // TODO: or just refuse to set instead?
267 data->r.pefra= data->r.efra;
270 /* now set normally */
271 CLAMP(value, MINAFRAME, data->r.pefra);
272 data->r.psfra= value;
275 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
277 Scene *data= (Scene*)ptr->data;
279 /* check if enabled already */
280 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
281 /* set start of preview range to start frame, then clamp as per normal */
282 // TODO: or just refuse to set instead?
283 data->r.psfra= data->r.sfra;
286 /* now set normally */
287 CLAMP(value, data->r.psfra, MAXFRAME);
288 data->r.pefra= value;
291 static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
293 //Scene *scene= ptr->id.data;
294 //ED_update_for_newframe(C);
298 static int rna_Scene_active_keying_set_editable(PointerRNA *ptr)
300 Scene *scene= (Scene *)ptr->data;
302 /* only editable if there are some Keying Sets to change to */
303 return (scene->keyingsets.first != NULL);
306 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
308 Scene *scene= (Scene *)ptr->data;
309 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, BLI_findlink(&scene->keyingsets, scene->active_keyingset-1));
312 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
314 Scene *scene= (Scene *)ptr->data;
315 KeyingSet *ks= (KeyingSet*)value.data;
316 scene->active_keyingset= BLI_findindex(&scene->keyingsets, ks) + 1;
319 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
321 Scene *scene= (Scene *)ptr->data;
322 return MAX2(scene->active_keyingset-1, 0);
325 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
327 Scene *scene= (Scene *)ptr->data;
328 scene->active_keyingset= value+1;
331 static void rna_Scene_active_keying_set_index_range(PointerRNA *ptr, int *min, int *max)
333 Scene *scene= (Scene *)ptr->data;
336 *max= BLI_countlist(&scene->keyingsets)-1;
341 static char *rna_SceneRenderData_path(PointerRNA *ptr)
343 return BLI_sprintfN("render_data");
346 static int rna_SceneRenderData_threads_get(PointerRNA *ptr)
348 RenderData *rd= (RenderData*)ptr->data;
350 if(rd->mode & R_FIXED_THREADS)
353 return BLI_system_thread_count();
356 static int rna_SceneRenderData_save_buffers_get(PointerRNA *ptr)
358 RenderData *rd= (RenderData*)ptr->data;
359 if(rd->mode & R_BORDER)
362 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
365 static int rna_SceneRenderData_full_sample_get(PointerRNA *ptr)
367 RenderData *rd= (RenderData*)ptr->data;
369 return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
372 static void rna_SceneRenderData_file_format_set(PointerRNA *ptr, int value)
374 RenderData *rd= (RenderData*)ptr->data;
378 ffmpeg_verify_image_type(rd);
380 #ifdef WITH_QUICKTIME
381 quicktime_verify_image_type(rd);
385 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
387 RenderData *rd= (RenderData*)ptr->data;
390 BKE_add_image_extension(ext, rd->imtype);
394 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
396 RenderData *rd= (RenderData*)ptr->data;
397 BKE_add_image_extension(str, rd->imtype);
400 void rna_SceneRenderData_jpeg2k_preset_update(RenderData *rd)
402 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
404 switch(rd->jp2_depth) {
406 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
407 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
410 switch(rd->jp2_preset) {
411 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
412 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
413 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
414 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
415 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
416 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
417 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
422 static void rna_SceneRenderData_jpeg2k_preset_set(PointerRNA *ptr, int value)
424 RenderData *rd= (RenderData*)ptr->data;
425 rd->jp2_preset= value;
426 rna_SceneRenderData_jpeg2k_preset_update(rd);
429 static void rna_SceneRenderData_jpeg2k_depth_set(PointerRNA *ptr, int value)
431 RenderData *rd= (RenderData*)ptr->data;
432 rd->jp2_depth= value;
433 rna_SceneRenderData_jpeg2k_preset_update(rd);
437 #ifdef WITH_QUICKTIME
438 static int rna_SceneRenderData_qtcodecsettings_codecType_get(PointerRNA *ptr)
440 RenderData *rd= (RenderData*)ptr->data;
442 return quicktime_rnatmpvalue_from_codectype(rd->qtcodecsettings.codecType);
445 static void rna_SceneRenderData_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
447 RenderData *rd= (RenderData*)ptr->data;
449 rd->qtcodecsettings.codecType = quicktime_codecType_from_rnatmpvalue(value);
452 static EnumPropertyItem *rna_SceneRenderData_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, int *free)
454 EnumPropertyItem *item= NULL;
455 EnumPropertyItem tmp = {0, "", 0, "", ""};
456 QuicktimeCodecTypeDesc *codecTypeDesc;
460 for(i=0;i<quicktime_get_num_codecs();i++) {
461 codecTypeDesc = quicktime_get_codecType_desc(i);
462 if (!codecTypeDesc) break;
464 tmp.value= codecTypeDesc->rnatmpvalue;
465 *((int*)id) = codecTypeDesc->codecType;
468 tmp.name= codecTypeDesc->codecName;
469 RNA_enum_item_add(&item, &totitem, &tmp);
472 RNA_enum_item_end(&item, &totitem);
479 static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr)
481 RenderData *rd= (RenderData*)ptr->data;
485 static void rna_SceneRenderData_active_layer_index_set(PointerRNA *ptr, int value)
487 RenderData *rd= (RenderData*)ptr->data;
491 static void rna_SceneRenderData_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
493 RenderData *rd= (RenderData*)ptr->data;
496 *max= BLI_countlist(&rd->layers)-1;
500 static void rna_SceneRenderData_engine_set(PointerRNA *ptr, int value)
502 RenderData *rd= (RenderData*)ptr->data;
503 RenderEngineType *type= BLI_findlink(&R_engines, value);
506 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
509 static EnumPropertyItem *rna_SceneRenderData_engine_itemf(bContext *C, PointerRNA *ptr, int *free)
511 RenderEngineType *type;
512 EnumPropertyItem *item= NULL;
513 EnumPropertyItem tmp = {0, "", 0, "", ""};
516 for(type=R_engines.first; type; type=type->next, a++) {
518 tmp.identifier= type->idname;
519 tmp.name= type->name;
520 RNA_enum_item_add(&item, &totitem, &tmp);
523 RNA_enum_item_end(&item, &totitem);
529 static int rna_SceneRenderData_engine_get(PointerRNA *ptr)
531 RenderData *rd= (RenderData*)ptr->data;
532 RenderEngineType *type;
535 for(type=R_engines.first; type; type=type->next, a++)
536 if(strcmp(type->idname, rd->engine) == 0)
542 static void rna_SceneRenderData_color_management_update(Main *bmain, Scene *unused, PointerRNA *ptr)
544 /* reset image nodes */
545 Scene *scene= (Scene*)ptr->id.data;
546 bNodeTree *ntree=scene->nodetree;
549 if(ntree && scene->use_nodes) {
550 for (node=ntree->nodes.first; node; node=node->next) {
551 if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
552 ED_node_changed_update(&scene->id, node);
553 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
555 if (node->type == CMP_NODE_IMAGE)
556 BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
562 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
564 Scene *scene= (Scene*)ptr->id.data;
565 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
567 BLI_strncpy(rl->name, value, sizeof(rl->name));
569 if(scene->nodetree) {
571 int index= BLI_findindex(&scene->r.layers, rl);
573 for(node= scene->nodetree->nodes.first; node; node= node->next) {
574 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
575 if(node->custom1==index)
576 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
582 static int rna_SceneRenderData_multiple_engines_get(PointerRNA *ptr)
584 return (BLI_countlist(&R_engines) > 1);
587 static int rna_SceneRenderData_use_game_engine_get(PointerRNA *ptr)
589 RenderData *rd= (RenderData*)ptr->data;
590 RenderEngineType *type;
592 for(type=R_engines.first; type; type=type->next)
593 if(strcmp(type->idname, rd->engine) == 0)
594 return (type->flag & RE_GAME);
599 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
601 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
602 rl->lay= ED_view3d_scene_layer_set(rl->lay, values);
605 static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *unused, PointerRNA *ptr)
607 Scene *scene= (Scene*)ptr->id.data;
610 ntreeCompositForceHidden(scene->nodetree, scene);
613 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
615 Scene *scene= (Scene*)ptr->data;
617 scene->use_nodes= value;
618 if(scene->use_nodes && scene->nodetree==NULL)
619 ED_node_composit_default(scene);
622 static void rna_Physics_update(Main *bmain, Scene *unused, PointerRNA *ptr)
624 Scene *scene= (Scene*)ptr->id.data;
627 for(base = scene->base.first; base; base=base->next)
628 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
631 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
633 Scene *scene= (Scene*)ptr->id.data;
634 ToolSettings *ts = (ToolSettings*)ptr->data;
635 int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
638 ts->selectmode = flag;
641 Mesh *me= get_mesh(scene->basact->object);
642 if(me && me->edit_mesh && me->edit_mesh->selectmode != flag) {
643 me->edit_mesh->selectmode= flag;
644 EM_selectmode_set(me->edit_mesh);
650 static void rna_Scene_editmesh_select_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
655 me= get_mesh(scene->basact->object);
656 if(me && me->edit_mesh==NULL)
660 WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
661 WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
664 static void object_simplify_update(Object *ob)
668 for(md=ob->modifiers.first; md; md=md->next)
669 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
670 ob->recalc |= OB_RECALC_DATA;
675 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
676 object_simplify_update(gob->ob);
680 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
684 for(base= scene->base.first; base; base= base->next)
685 object_simplify_update(base->object);
687 DAG_ids_flush_update(0);
688 WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
693 static void rna_def_transform_orientation(BlenderRNA *brna)
698 int matrix_dimsize[]= {3, 3};
700 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
702 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
703 RNA_def_property_float_sdna(prop, NULL, "mat");
704 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
705 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
707 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
708 RNA_def_property_string_sdna(prop, NULL, "name");
709 RNA_def_struct_name_property(srna, prop);
710 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
713 static void rna_def_tool_settings(BlenderRNA *brna)
718 static EnumPropertyItem uv_select_mode_items[] = {
719 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode."},
720 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode."},
721 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode."},
722 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode."},
723 {0, NULL, 0, NULL, NULL}};
725 static EnumPropertyItem auto_key_items[] = {
726 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
727 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
728 {0, NULL, 0, NULL, NULL}};
730 static EnumPropertyItem retarget_roll_items[] = {
731 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll."},
732 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view."},
733 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset."},
734 {0, NULL, 0, NULL, NULL}};
736 static EnumPropertyItem sketch_convert_items[] = {
737 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones."},
738 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length."},
739 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts."},
740 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke."},
741 {0, NULL, 0, NULL, NULL}};
743 srna= RNA_def_struct(brna, "ToolSettings", NULL);
744 RNA_def_struct_ui_text(srna, "Tool Settings", "");
746 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
747 RNA_def_property_struct_type(prop, "Sculpt");
748 RNA_def_property_ui_text(prop, "Sculpt", "");
750 prop = RNA_def_property(srna, "auto_normalize", PROP_BOOLEAN, PROP_NONE);
751 RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
752 RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
753 "Ensure all bone-deforming vertex groups add up to 1.0 while "
756 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
757 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
758 RNA_def_property_ui_text(prop, "Vertex Paint", "");
760 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
761 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
762 RNA_def_property_ui_text(prop, "Weight Paint", "");
764 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
765 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
766 RNA_def_property_ui_text(prop, "Image Paint", "");
768 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
769 RNA_def_property_pointer_sdna(prop, NULL, "particle");
770 RNA_def_property_ui_text(prop, "Particle Edit", "");
773 prop= RNA_def_property(srna, "proportional_editing", PROP_ENUM, PROP_NONE);
774 RNA_def_property_enum_sdna(prop, NULL, "proportional");
775 RNA_def_property_enum_items(prop, proportional_editing_items);
776 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode.");
777 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
779 prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE);
780 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
781 RNA_def_property_enum_items(prop, proportional_falloff_items);
782 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode.");
783 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
785 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
786 RNA_def_property_float_sdna(prop, NULL, "normalsize");
787 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view.");
788 RNA_def_property_range(prop, 0.00001, 1000.0);
789 RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
790 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
792 prop= RNA_def_property(srna, "automerge_editing", PROP_BOOLEAN, PROP_NONE);
793 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
794 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location.");
796 prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE);
797 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
798 RNA_def_property_ui_text(prop, "Snap", "Snap during transform.");
799 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
800 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
802 prop= RNA_def_property(srna, "snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
803 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
804 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target.");
805 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
806 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
808 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
809 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
810 RNA_def_property_enum_items(prop, snap_element_items);
811 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to.");
812 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
814 prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
815 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
816 RNA_def_property_enum_items(prop, snap_target_items);
817 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target.");
818 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
820 prop= RNA_def_property(srna, "snap_peel_object", PROP_BOOLEAN, PROP_NONE);
821 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
822 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center.");
823 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
824 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
826 prop= RNA_def_property(srna, "snap_project", PROP_BOOLEAN, PROP_NONE);
827 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
828 RNA_def_property_ui_text(prop, "Project Individual Elements", "DOC_BROKEN");
829 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
830 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
833 prop= RNA_def_property(srna, "enable_auto_key", PROP_BOOLEAN, PROP_NONE);
834 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
835 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
837 prop= RNA_def_property(srna, "autokey_mode", PROP_ENUM, PROP_NONE);
838 RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
839 RNA_def_property_enum_items(prop, auto_key_items);
840 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
842 prop= RNA_def_property(srna, "record_with_nla", PROP_BOOLEAN, PROP_NONE);
843 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
844 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.");
847 prop= RNA_def_property(srna, "uv_selection_mode", PROP_ENUM, PROP_NONE);
848 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
849 RNA_def_property_enum_items(prop, uv_select_mode_items);
850 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode.");
851 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
853 prop= RNA_def_property(srna, "uv_sync_selection", PROP_BOOLEAN, PROP_NONE);
854 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
855 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync.");
856 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
857 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
859 prop= RNA_def_property(srna, "uv_local_view", PROP_BOOLEAN, PROP_NONE);
860 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
861 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned.");
862 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
865 prop= RNA_def_property(srna, "mesh_selection_mode", PROP_BOOLEAN, PROP_NONE);
866 RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
867 RNA_def_property_array(prop, 3);
868 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
869 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on.");
870 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
872 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
873 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
874 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups.");
877 prop= RNA_def_property(srna, "bone_sketching", PROP_BOOLEAN, PROP_NONE);
878 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
879 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
880 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
882 prop= RNA_def_property(srna, "etch_quick", PROP_BOOLEAN, PROP_NONE);
883 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
884 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
886 prop= RNA_def_property(srna, "etch_overdraw", PROP_BOOLEAN, PROP_NONE);
887 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
888 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
890 prop= RNA_def_property(srna, "etch_autoname", PROP_BOOLEAN, PROP_NONE);
891 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
892 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
894 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
895 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
896 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
898 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
899 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
900 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
902 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
903 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
904 RNA_def_property_flag(prop, PROP_EDITABLE);
905 RNA_def_property_struct_type(prop, "Object");
906 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL);
907 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke.");
909 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
910 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
911 RNA_def_property_range(prop, 1, 10000);
912 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke.");
913 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
915 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
916 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
917 RNA_def_property_range(prop, 0.00001, 1.0);
918 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
919 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke.");
920 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
922 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
923 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
924 RNA_def_property_range(prop, 0.00001, 100000.0);
925 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
926 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke.");
927 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
929 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
930 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
931 RNA_def_property_enum_items(prop, retarget_roll_items);
932 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting.");
934 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
935 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
936 RNA_def_property_enum_items(prop, sketch_convert_items);
937 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones.");
938 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
942 static void rna_def_unit_settings(BlenderRNA *brna)
947 static EnumPropertyItem unit_systems[] = {
948 {USER_UNIT_NONE, "NONE", 0, "None", ""},
949 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
950 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
951 {0, NULL, 0, NULL, NULL}};
953 static EnumPropertyItem rotation_units[] = {
954 {0, "DEGREES", 0, "Degrees", ""},
955 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
956 {0, NULL, 0, NULL, NULL}};
958 srna= RNA_def_struct(brna, "UnitSettings", NULL);
959 RNA_def_struct_ui_text(srna, "Unit Settings", "");
962 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
963 RNA_def_property_enum_items(prop, unit_systems);
964 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display.");
965 RNA_def_property_update(prop, NC_WINDOW, NULL);
967 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
968 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions.");
969 RNA_def_property_range(prop, 0.00001, 100000.0);
970 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
971 RNA_def_property_update(prop, NC_WINDOW, NULL);
973 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
974 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
975 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs.");
976 RNA_def_property_update(prop, NC_WINDOW, NULL);
978 prop= RNA_def_property(srna, "rotation_units", PROP_ENUM, PROP_NONE);
979 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
980 RNA_def_property_enum_items(prop, rotation_units);
981 RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
982 RNA_def_property_update(prop, NC_WINDOW, NULL);
985 void rna_def_render_layer_common(StructRNA *srna, int scene)
989 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
990 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
991 else RNA_def_property_string_sdna(prop, NULL, "name");
992 RNA_def_property_ui_text(prop, "Name", "Render layer name.");
993 RNA_def_struct_name_property(srna, prop);
994 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
995 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
997 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
998 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
999 RNA_def_property_struct_type(prop, "Material");
1000 RNA_def_property_flag(prop, PROP_EDITABLE);
1001 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer.");
1002 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1003 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1005 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
1006 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
1007 RNA_def_property_struct_type(prop, "Group");
1008 RNA_def_property_flag(prop, PROP_EDITABLE);
1009 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer.");
1010 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1011 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1014 prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1015 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1016 RNA_def_property_array(prop, 20);
1017 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer.");
1018 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
1019 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
1020 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1021 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1023 prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_LAYER);
1024 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
1025 RNA_def_property_array(prop, 20);
1026 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers.");
1027 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1028 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1031 prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
1032 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
1033 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer.");
1034 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1035 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1037 prop= RNA_def_property(srna, "zmask", PROP_BOOLEAN, PROP_NONE);
1038 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
1039 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values.");
1040 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1041 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1043 prop= RNA_def_property(srna, "zmask_negate", PROP_BOOLEAN, PROP_NONE);
1044 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
1045 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front.");
1046 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1047 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1049 prop= RNA_def_property(srna, "all_z", PROP_BOOLEAN, PROP_NONE);
1050 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
1051 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking.");
1052 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1053 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1055 prop= RNA_def_property(srna, "solid", PROP_BOOLEAN, PROP_NONE);
1056 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
1057 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer.");
1058 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1059 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1061 prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
1062 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
1063 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid).");
1064 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1065 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1067 prop= RNA_def_property(srna, "ztransp", PROP_BOOLEAN, PROP_NONE);
1068 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
1069 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos).");
1070 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1071 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1073 prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
1074 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
1075 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer.");
1076 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1077 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1079 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
1080 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
1081 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces).");
1082 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1083 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1085 prop= RNA_def_property(srna, "strand", PROP_BOOLEAN, PROP_NONE);
1086 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
1087 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer.");
1088 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1089 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1091 prop= RNA_def_property(srna, "freestyle", PROP_BOOLEAN, PROP_NONE);
1092 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_FRS);
1093 RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer.");
1094 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1095 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1098 prop= RNA_def_property(srna, "pass_combined", PROP_BOOLEAN, PROP_NONE);
1099 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
1100 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer.");
1101 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1102 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1104 prop= RNA_def_property(srna, "pass_z", PROP_BOOLEAN, PROP_NONE);
1105 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
1106 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass.");
1107 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1108 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1110 prop= RNA_def_property(srna, "pass_vector", PROP_BOOLEAN, PROP_NONE);
1111 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
1112 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass.");
1113 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1114 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1116 prop= RNA_def_property(srna, "pass_normal", PROP_BOOLEAN, PROP_NONE);
1117 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
1118 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass.");
1119 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1120 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1122 prop= RNA_def_property(srna, "pass_uv", PROP_BOOLEAN, PROP_NONE);
1123 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
1124 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass.");
1125 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1126 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1128 prop= RNA_def_property(srna, "pass_mist", PROP_BOOLEAN, PROP_NONE);
1129 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
1130 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0).");
1131 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1132 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1134 prop= RNA_def_property(srna, "pass_object_index", PROP_BOOLEAN, PROP_NONE);
1135 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
1136 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass.");
1137 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1138 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1140 prop= RNA_def_property(srna, "pass_color", PROP_BOOLEAN, PROP_NONE);
1141 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
1142 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass.");
1143 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1144 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1146 prop= RNA_def_property(srna, "pass_diffuse", PROP_BOOLEAN, PROP_NONE);
1147 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
1148 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass.");
1149 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1150 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1152 prop= RNA_def_property(srna, "pass_specular", PROP_BOOLEAN, PROP_NONE);
1153 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
1154 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass.");
1155 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1156 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1158 prop= RNA_def_property(srna, "pass_shadow", PROP_BOOLEAN, PROP_NONE);
1159 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
1160 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass.");
1161 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1162 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1164 prop= RNA_def_property(srna, "pass_ao", PROP_BOOLEAN, PROP_NONE);
1165 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
1166 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass.");
1167 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1168 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1170 prop= RNA_def_property(srna, "pass_reflection", PROP_BOOLEAN, PROP_NONE);
1171 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
1172 RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass.");
1173 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1174 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1176 prop= RNA_def_property(srna, "pass_refraction", PROP_BOOLEAN, PROP_NONE);
1177 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
1178 RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass.");
1179 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1180 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1182 prop= RNA_def_property(srna, "pass_emit", PROP_BOOLEAN, PROP_NONE);
1183 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
1184 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass.");
1185 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1186 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1188 prop= RNA_def_property(srna, "pass_environment", PROP_BOOLEAN, PROP_NONE);
1189 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
1190 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass.");
1191 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1192 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1194 prop= RNA_def_property(srna, "pass_indirect", PROP_BOOLEAN, PROP_NONE);
1195 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
1196 RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass.");
1197 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1198 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1200 prop= RNA_def_property(srna, "pass_specular_exclude", PROP_BOOLEAN, PROP_NONE);
1201 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
1202 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined.");
1203 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1204 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1206 prop= RNA_def_property(srna, "pass_shadow_exclude", PROP_BOOLEAN, PROP_NONE);
1207 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
1208 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined.");
1209 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1210 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1212 prop= RNA_def_property(srna, "pass_ao_exclude", PROP_BOOLEAN, PROP_NONE);
1213 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
1214 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined.");
1215 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1216 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1218 prop= RNA_def_property(srna, "pass_reflection_exclude", PROP_BOOLEAN, PROP_NONE);
1219 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
1220 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined.");
1221 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1222 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1224 prop= RNA_def_property(srna, "pass_refraction_exclude", PROP_BOOLEAN, PROP_NONE);
1225 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
1226 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined.");
1227 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1228 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1230 prop= RNA_def_property(srna, "pass_emit_exclude", PROP_BOOLEAN, PROP_NONE);
1231 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
1232 RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined.");
1233 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1234 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1236 prop= RNA_def_property(srna, "pass_environment_exclude", PROP_BOOLEAN, PROP_NONE);
1237 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
1238 RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined.");
1239 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1240 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1242 prop= RNA_def_property(srna, "pass_indirect_exclude", PROP_BOOLEAN, PROP_NONE);
1243 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
1244 RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined.");
1245 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1246 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1249 static void rna_def_freestyle_settings(BlenderRNA *brna)
1254 /* FreestyleModuleSettings */
1256 srna= RNA_def_struct(brna, "FreestyleModuleSettings", NULL);
1257 RNA_def_struct_sdna(srna, "FreestyleModuleConfig");
1258 RNA_def_struct_ui_text(srna, "Freestyle Module", "Style module configuration for specifying a style module.");
1260 prop= RNA_def_property(srna, "module_path", PROP_STRING, PROP_FILEPATH);
1261 RNA_def_property_string_sdna(prop, NULL, "module_path");
1262 RNA_def_property_ui_text(prop, "Module Path", "Path to a style module file.");
1263 RNA_def_property_update(prop, NC_SCENE, NULL);
1265 prop= RNA_def_property(srna, "is_displayed", PROP_BOOLEAN, PROP_NONE);
1266 RNA_def_property_boolean_sdna(prop, NULL, "is_displayed", 1);
1267 RNA_def_property_ui_text(prop, "Is Displayed", "Enable this style module during the rendering.");
1268 RNA_def_property_update(prop, NC_SCENE, NULL);
1270 /* FreestyleSettings */
1272 srna= RNA_def_struct(brna, "FreestyleSettings", NULL);
1273 RNA_def_struct_sdna(srna, "FreestyleConfig");
1274 RNA_def_struct_nested(brna, srna, "SceneRenderLayer");
1275 RNA_def_struct_ui_text(srna, "Frestyle Settings", "Freestyle settings for a SceneRenderLayer datablock.");
1277 prop= RNA_def_property(srna, "modules", PROP_COLLECTION, PROP_NONE);
1278 RNA_def_property_collection_sdna(prop, NULL, "modules", NULL);
1279 RNA_def_property_struct_type(prop, "FreestyleModuleSettings");
1280 RNA_def_property_ui_text(prop, "Style modules", "A list of style modules (to be applied from top to bottom).");
1282 prop= RNA_def_property(srna, "suggestive_contours", PROP_BOOLEAN, PROP_NONE);
1283 RNA_def_property_boolean_sdna(prop, NULL, "flags", FREESTYLE_SUGGESTIVE_CONTOURS_FLAG);
1284 RNA_def_property_ui_text(prop, "Suggestive Contours", "Enable suggestive contours.");
1285 RNA_def_property_update(prop, NC_SCENE, NULL);
1287 prop= RNA_def_property(srna, "ridges_and_valleys", PROP_BOOLEAN, PROP_NONE);
1288 RNA_def_property_boolean_sdna(prop, NULL, "flags", FREESTYLE_RIDGES_AND_VALLEYS_FLAG);
1289 RNA_def_property_ui_text(prop, "Ridges and Valleys", "Enable ridges and valleys.");
1290 RNA_def_property_update(prop, NC_SCENE, NULL);
1292 prop= RNA_def_property(srna, "sphere_radius", PROP_FLOAT, PROP_NONE);
1293 RNA_def_property_float_sdna(prop, NULL, "sphere_radius");
1294 RNA_def_property_range(prop, 0.0, 1000.0);
1295 RNA_def_property_ui_text(prop, "Sphere Radius", "*TBD*");
1296 RNA_def_property_update(prop, NC_SCENE, NULL);
1298 prop= RNA_def_property(srna, "dkr_epsilon", PROP_FLOAT, PROP_NONE);
1299 RNA_def_property_float_sdna(prop, NULL, "dkr_epsilon");
1300 RNA_def_property_range(prop, 0.0, 1000.0);
1301 RNA_def_property_ui_text(prop, "Dkr Epsilon", "*TBD*");
1302 RNA_def_property_update(prop, NC_SCENE, NULL);
1305 static void rna_def_scene_game_data(BlenderRNA *brna)
1310 static EnumPropertyItem framing_types_items[] ={
1311 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
1312 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1313 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1314 {0, NULL, 0, NULL, NULL}};
1316 static EnumPropertyItem dome_modes_items[] ={
1317 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1318 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1319 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1320 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1321 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1322 {0, NULL, 0, NULL, NULL}};
1324 static EnumPropertyItem stereo_modes_items[] ={
1325 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1326 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1327 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1328 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1329 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1330 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1331 {0, NULL, 0, NULL, NULL}};
1333 static EnumPropertyItem stereo_items[] ={
1334 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
1335 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
1336 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
1337 {0, NULL, 0, NULL, NULL}};
1339 static EnumPropertyItem physics_engine_items[] = {
1340 {WOPHY_NONE, "NONE", 0, "None", ""},
1341 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1342 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1343 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1344 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1345 {WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
1346 {0, NULL, 0, NULL, NULL}};
1348 static EnumPropertyItem material_items[] ={
1349 {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials."},
1350 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials."},
1351 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders."},
1352 {0, NULL, 0, NULL, NULL}};
1354 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1355 RNA_def_struct_sdna(srna, "GameData");
1356 RNA_def_struct_nested(brna, srna, "Scene");
1357 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock.");
1359 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1360 RNA_def_property_int_sdna(prop, NULL, "xplay");
1361 RNA_def_property_range(prop, 4, 10000);
1362 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen.");
1363 RNA_def_property_update(prop, NC_SCENE, NULL);
1365 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1366 RNA_def_property_int_sdna(prop, NULL, "yplay");
1367 RNA_def_property_range(prop, 4, 10000);
1368 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen.");
1369 RNA_def_property_update(prop, NC_SCENE, NULL);
1371 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
1372 RNA_def_property_int_sdna(prop, NULL, "depth");
1373 RNA_def_property_range(prop, 8, 32);
1374 RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display.");
1375 RNA_def_property_update(prop, NC_SCENE, NULL);
1377 // Do we need it here ? (since we already have it in World
1378 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1379 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1380 RNA_def_property_range(prop, 4, 2000);
1381 RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display.");
1382 RNA_def_property_update(prop, NC_SCENE, NULL);
1384 prop= RNA_def_property(srna, "fullscreen", PROP_BOOLEAN, PROP_NONE);
1385 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1386 RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
1387 RNA_def_property_update(prop, NC_SCENE, NULL);
1390 prop= RNA_def_property(srna, "framing_type", PROP_ENUM, PROP_NONE);
1391 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1392 RNA_def_property_enum_items(prop, framing_types_items);
1393 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want.");
1394 RNA_def_property_update(prop, NC_SCENE, NULL);
1396 prop= RNA_def_property(srna, "framing_color", PROP_FLOAT, PROP_COLOR);
1397 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1398 RNA_def_property_array(prop, 3);
1399 RNA_def_property_ui_text(prop, "Framing Color", "Set colour of the bars");
1400 RNA_def_property_update(prop, NC_SCENE, NULL);
1403 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1404 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1405 RNA_def_property_enum_items(prop, stereo_items);
1406 RNA_def_property_ui_text(prop, "Stereo Options", "");
1407 RNA_def_property_update(prop, NC_SCENE, NULL);
1409 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1410 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1411 RNA_def_property_enum_items(prop, stereo_modes_items);
1412 RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
1413 RNA_def_property_update(prop, NC_SCENE, NULL);
1415 prop= RNA_def_property(srna, "eye_separation", PROP_FLOAT, PROP_NONE);
1416 RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
1417 RNA_def_property_range(prop, 0.01, 5.0);
1418 RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
1419 RNA_def_property_update(prop, NC_SCENE, NULL);
1422 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1423 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1424 RNA_def_property_enum_items(prop, dome_modes_items);
1425 RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
1426 RNA_def_property_update(prop, NC_SCENE, NULL);
1428 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1429 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1430 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1431 RNA_def_property_ui_text(prop, "Tesselation", "Tesselation level - check the generated mesh in wireframe mode");
1432 RNA_def_property_update(prop, NC_SCENE, NULL);
1434 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1435 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1436 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1437 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1438 RNA_def_property_update(prop, NC_SCENE, NULL);
1440 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1441 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1442 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1443 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1444 RNA_def_property_update(prop, NC_SCENE, NULL);
1446 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1447 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1448 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1449 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1450 RNA_def_property_update(prop, NC_SCENE, NULL);
1452 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
1453 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
1454 RNA_def_property_struct_type(prop, "Text");
1455 RNA_def_property_flag(prop, PROP_EDITABLE);
1456 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
1457 RNA_def_property_update(prop, NC_SCENE, NULL);
1460 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
1461 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
1462 RNA_def_property_enum_items(prop, physics_engine_items);
1463 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine.");
1464 RNA_def_property_update(prop, NC_SCENE, NULL);
1466 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
1467 RNA_def_property_float_sdna(prop, NULL, "gravity");
1468 RNA_def_property_range(prop, 0.0, 25.0);
1469 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine.");
1470 RNA_def_property_update(prop, NC_SCENE, NULL);
1472 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_FLOAT, PROP_NONE);
1473 RNA_def_property_float_sdna(prop, NULL, "occlusionRes");
1474 RNA_def_property_range(prop, 128.0, 1024.0);
1475 RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precsion (slower)");
1476 RNA_def_property_update(prop, NC_SCENE, NULL);
1478 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1479 RNA_def_property_int_sdna(prop, NULL, "ticrate");
1480 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
1481 RNA_def_property_range(prop, 1, 250);
1482 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.");
1483 RNA_def_property_update(prop, NC_SCENE, NULL);
1485 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
1486 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
1487 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1488 RNA_def_property_range(prop, 1, 5);
1489 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");
1490 RNA_def_property_update(prop, NC_SCENE, NULL);
1492 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
1493 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
1494 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1495 RNA_def_property_range(prop, 1, 5);
1496 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");
1497 RNA_def_property_update(prop, NC_SCENE, NULL);
1499 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
1500 RNA_def_property_int_sdna(prop, NULL, "physubstep");
1501 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1502 RNA_def_property_range(prop, 1, 5);
1503 RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
1504 RNA_def_property_update(prop, NC_SCENE, NULL);
1507 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
1508 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
1509 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustrum and occlusion culling");
1510 RNA_def_property_update(prop, NC_SCENE, NULL);
1512 // not used // deprecated !!!!!!!!!!!!!
1513 prop= RNA_def_property(srna, "activity_culling", PROP_BOOLEAN, PROP_NONE);
1514 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
1515 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
1516 RNA_def_property_update(prop, NC_SCENE, NULL);
1518 // not used // deprecated !!!!!!!!!!!!!
1519 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
1520 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
1521 RNA_def_property_range(prop, 0.0, 1000.0);
1522 RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
1523 RNA_def_property_update(prop, NC_SCENE, NULL);
1526 prop= RNA_def_property(srna, "all_frames", PROP_BOOLEAN, PROP_NONE);
1527 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
1528 RNA_def_property_ui_text(prop, "All Frames", "Render as many frames as possible, rather than respecting framerate.");
1529 RNA_def_property_update(prop, NC_SCENE, NULL);
1531 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
1532 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
1533 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs.");
1534 RNA_def_property_update(prop, NC_SCENE, NULL);
1536 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
1537 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
1538 RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs.");
1539 RNA_def_property_update(prop, NC_SCENE, NULL);
1541 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
1542 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
1543 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions.");
1544 RNA_def_property_update(prop, NC_SCENE, NULL);
1546 prop= RNA_def_property(srna, "display_lists", PROP_BOOLEAN, PROP_NONE);
1547 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
1548 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU.");
1549 RNA_def_property_update(prop, NC_SCENE, NULL);
1551 prop= RNA_def_property(srna, "deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
1552 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
1553 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API.");
1554 RNA_def_property_update(prop, NC_SCENE, NULL);
1557 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
1558 RNA_def_property_enum_sdna(prop, NULL, "matmode");
1559 RNA_def_property_enum_items(prop, material_items);
1560 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering.");
1561 RNA_def_property_update(prop, NC_SCENE, NULL);
1563 prop= RNA_def_property(srna, "glsl_lights", PROP_BOOLEAN, PROP_NONE);
1564 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
1565 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering.");
1566 RNA_def_property_update(prop, NC_SCENE, NULL);
1568 prop= RNA_def_property(srna, "glsl_shaders", PROP_BOOLEAN, PROP_NONE);
1569 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
1570 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering.");
1571 RNA_def_property_update(prop, NC_SCENE, NULL);
1573 prop= RNA_def_property(srna, "glsl_shadows", PROP_BOOLEAN, PROP_NONE);
1574 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
1575 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering.");
1576 RNA_def_property_update(prop, NC_SCENE, NULL);
1578 prop= RNA_def_property(srna, "glsl_ramps", PROP_BOOLEAN, PROP_NONE);
1579 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
1580 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering.");
1581 RNA_def_property_update(prop, NC_SCENE, NULL);
1583 prop= RNA_def_property(srna, "glsl_nodes", PROP_BOOLEAN, PROP_NONE);
1584 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
1585 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering.");
1586 RNA_def_property_update(prop, NC_SCENE, NULL);
1588 prop= RNA_def_property(srna, "glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
1589 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
1590 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering.");
1591 RNA_def_property_update(prop, NC_SCENE, NULL);
1594 static void rna_def_scene_render_layer(BlenderRNA *brna)
1599 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
1600 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer.");
1602 rna_def_render_layer_common(srna, 1);
1606 rna_def_freestyle_settings(brna);
1608 prop= RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE);
1609 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1610 RNA_def_property_pointer_sdna(prop, NULL, "freestyleConfig");
1611 RNA_def_property_struct_type(prop, "FreestyleSettings");
1612 RNA_def_property_ui_text(prop, "Freestyle Settings", "");
1615 static void rna_def_scene_render_data(BlenderRNA *brna)
1620 static EnumPropertyItem pixel_filter_items[] ={
1621 {R_FILTER_BOX, "BOX", 0, "Box", ""},
1622 {R_FILTER_TENT, "TENT", 0, "Tent", ""},
1623 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""},
1624 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""},
1625 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""},
1626 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""},
1627 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""},
1628 {0, NULL, 0, NULL, NULL}};
1630 static EnumPropertyItem alpha_mode_items[] ={
1631 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
1632 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
1633 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
1634 {0, NULL, 0, NULL, NULL}};
1636 static EnumPropertyItem color_mode_items[] ={
1637 {R_PLANESBW, "BW", 0, "BW", "Images are saved with BW (grayscale) data"},
1638 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
1639 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
1640 {0, NULL, 0, NULL, NULL}};
1642 static EnumPropertyItem display_mode_items[] ={
1643 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
1644 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
1645 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
1646 {0, NULL, 0, NULL, NULL}};
1649 static EnumPropertyItem bake_mode_items[] ={
1650 {RE_BAKE_ALL, "FULL", 0, "Full Render", ""},
1651 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""},
1652 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""},
1653 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""},
1654 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""},
1655 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""},
1656 {0, NULL, 0, NULL, NULL}};
1658 static EnumPropertyItem bake_normal_space_items[] ={
1659 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""},
1660 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""},
1661 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""},
1662 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
1663 {0, NULL, 0, NULL, NULL}};
1665 static EnumPropertyItem bake_qyad_split_items[] ={
1666 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
1667 {1, "FIXED", 0, "Fixed", "Split quads pradictably (0,1,2) (0,2,3)"},
1668 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads pradictably (1,2,3) (1,3,0)"},
1669 {0, NULL, 0, NULL, NULL}};
1671 static EnumPropertyItem bake_aa_items[] ={
1672 {5, "AA_5", 0, "5", ""},
1673 {8, "AA_8", 0, "8", ""},
1674 {11, "AA_11", 0, "11", ""},
1675 {16, "AA_16", 0, "16", ""},
1676 {0, NULL, 0, NULL, NULL}};
1678 static EnumPropertyItem octree_resolution_items[] = {
1679 {64, "OCTREE_RES_64", 0, "64", ""},
1680 {128, "OCTREE_RES_128", 0, "128", ""},
1681 {256, "OCTREE_RES_256", 0, "256", ""},
1682 {512, "OCTREE_RES_512", 0, "512", ""},
1683 {0, NULL, 0, NULL, NULL}};
1685 static EnumPropertyItem raytrace_structure_items[] = {
1686 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""},
1687 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure."},
1688 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
1689 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""},
1690 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""},
1691 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""},
1692 {0, NULL, 0, NULL, NULL}
1695 static EnumPropertyItem fixed_oversample_items[] = {
1696 {5, "OVERSAMPLE_5", 0, "5", ""},
1697 {8, "OVERSAMPLE_8", 0, "8", ""},
1698 {11, "OVERSAMPLE_11", 0, "11", ""},
1699 {16, "OVERSAMPLE_16", 0, "16", ""},
1700 {0, NULL, 0, NULL, NULL}};
1702 static EnumPropertyItem field_order_items[] = {
1703 {0, "FIELDS_EVENFIRST", 0, "Even", "Even Fields First"},
1704 {R_ODDFIELD, "FIELDS_ODDFIRST", 0, "Odd", "Odd Fields First"},
1705 {0, NULL, 0, NULL, NULL}};
1707 static EnumPropertyItem threads_mode_items[] = {
1708 {0, "THREADS_AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
1709 {R_FIXED_THREADS, "THREADS_FIXED", 0, "Fixed", "Manually determine the number of threads"},
1710 {0, NULL, 0, NULL, NULL}};
1712 static EnumPropertyItem image_type_items[] = {
1713 {0, "", 0, "Image", NULL},
1714 {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""},
1715 {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""},
1716 #ifdef WITH_OPENJPEG
1717 {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""},
1719 {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""},
1720 {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""},
1721 {R_RAWTGA, "RAWTARGA", ICON_FILE_IMAGE, "Targa Raw", ""},
1722 //{R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, // XXX not yet implemented
1723 {R_HAMX, "HAMX", ICON_FILE_IMAGE, "HamX", ""},
1724 {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""},
1725 {0, "", 0, " ", NULL},
1727 {R_OPENEXR, "OPENEXR", ICON_FILE_IMAGE, "OpenEXR", ""},
1728 {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""},
1730 {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""}, // XXX only with G.have_libtiff
1731 {R_RADHDR, "RADHDR", ICON_FILE_IMAGE, "Radiance HDR", ""},
1732 {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""},
1733 {R_DPX, "DPX", ICON_FILE_IMAGE, "DPX", ""},
1734 {0, "", 0, "Movie", NULL},
1735 {R_AVIRAW, "AVIRAW", ICON_FILE_MOVIE, "AVI Raw", ""},
1736 {R_AVIJPEG, "AVIJPEG", ICON_FILE_MOVIE, "AVI JPEG", ""},
1738 {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""},
1740 #ifdef WITH_QUICKTIME
1742 {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", ""},
1744 {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", ""},
1748 {R_MOVIE, "MOVIE", ICON_FILE_MOVIE, "Movie", ""},
1751 {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
1752 {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""},
1753 {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
1754 {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "FFMpeg", ""},
1756 {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
1757 {0, NULL, 0, NULL, NULL}};
1760 static EnumPropertyItem exr_codec_items[] = {
1761 {0, "NONE", 0, "None", ""},
1762 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
1763 {2, "ZIP", 0, "ZIP (lossless)", ""},
1764 {3, "PIZ", 0, "PIZ (lossless)", ""},
1765 {4, "RLE", 0, "RLE (lossless)", ""},
1766 {0, NULL, 0, NULL, NULL}};
1769 #ifdef WITH_OPENJPEG
1770 static EnumPropertyItem jp2_preset_items[] = {
1771 {0, "NO_PRESET", 0, "No Preset", ""},
1772 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
1773 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
1774 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
1775 {4, "CINE_SCOPE_48FPS", 0, "Cine-Scope 24fps 2048x858", ""},
1776 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
1777 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
1778 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
1779 {0, NULL, 0, NULL, NULL}};
1781 static EnumPropertyItem jp2_depth_items[] = {
1782 {8, "8", 0, "8", "8 bit color channels"},
1783 {12, "12", 0, "12", "12 bit color channels"},
1784 {16, "16", 0, "16", "16 bit color channels"},
1785 {0, NULL, 0, NULL, NULL}};
1788 #ifdef WITH_QUICKTIME
1789 static EnumPropertyItem quicktime_codec_type_items[] = {
1790 {0, "codec", 0, "codec", ""},
1791 {0, NULL, 0, NULL, NULL}};
1795 static EnumPropertyItem ffmpeg_format_items[] = {
1796 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
1797 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
1798 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
1799 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
1800 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
1801 {FFMPEG_DV, "DV", 0, "DV", ""},
1802 {FFMPEG_H264, "H264", 0, "H.264", ""},
1803 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
1804 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
1805 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
1806 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
1807 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
1808 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
1809 {0, NULL, 0, NULL, NULL}};
1811 static EnumPropertyItem ffmpeg_codec_items[] = {
1812 {CODEC_ID_NONE, "NONE", 0, "None", ""},
1813 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
1814 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
1815 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
1816 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
1817 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
1818 {CODEC_ID_H264, "H264", 0, "H.264", ""},
1819 {CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
1820 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
1821 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
1822 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
1823 {0, NULL, 0, NULL, NULL}};
1825 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
1826 {CODEC_ID_NONE, "NONE", 0, "None", ""},
1827 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
1828 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
1829 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
1830 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
1831 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
1832 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
1833 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
1834 {0, NULL, 0, NULL, NULL}};
1837 static EnumPropertyItem engine_items[] = {
1838 {0, "BLENDER_RENDER", 0, "Blender Render", ""},
1839 {0, NULL, 0, NULL, NULL}};
1841 srna= RNA_def_struct(brna, "SceneRenderData", NULL);
1842 RNA_def_struct_sdna(srna, "RenderData");
1843 RNA_def_struct_nested(brna, srna, "Scene");
1844 RNA_def_struct_path_func(srna, "rna_SceneRenderData_path");
1845 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock.");
1847 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
1848 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
1849 RNA_def_property_enum_items(prop, color_mode_items);
1850 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");
1851 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1853 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1854 RNA_def_property_int_sdna(prop, NULL, "xsch");
1855 RNA_def_property_range(prop, 4, 10000);
1856 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image.");
1857 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1859 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1860 RNA_def_property_int_sdna(prop, NULL, "ysch");
1861 RNA_def_property_range(prop, 4, 10000);
1862 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image.");
1863 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1865 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
1866 RNA_def_property_int_sdna(prop, NULL, "size");
1867 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
1868 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
1869 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1871 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
1872 RNA_def_property_int_sdna(prop, NULL, "xparts");
1873 RNA_def_property_range(prop, 1, 512);
1874 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering.");
1875 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1877 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
1878 RNA_def_property_int_sdna(prop, NULL, "yparts");
1879 RNA_def_property_range(prop, 1, 512);
1880 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering.");
1881 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1883 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
1884 RNA_def_property_float_sdna(prop, NULL, "xasp");
1885 RNA_def_property_range(prop, 1.0f, 200.0f);
1886 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
1887 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1889 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
1890 RNA_def_property_float_sdna(prop, NULL, "yasp");
1891 RNA_def_property_range(prop, 1.0f, 200.0f);
1892 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
1893 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1895 /* JPEG and AVI JPEG */
1897 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_PERCENTAGE);
1898 RNA_def_property_int_sdna(prop, NULL, "quality");
1899 RNA_def_property_range(prop, 1, 100);
1900 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies.");
1901 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1905 prop= RNA_def_property(srna, "tiff_bit", PROP_BOOLEAN, PROP_NONE);
1906 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
1907 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
1908 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1910 /* Cineon and DPX */
1912 prop= RNA_def_property(srna, "cineon_log", PROP_BOOLEAN, PROP_NONE);
1913 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
1914 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
1915 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1917 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
1918 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
1919 RNA_def_property_range(prop, 0, 1024);
1920 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
1921 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1923 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
1924 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
1925 RNA_def_property_range(prop, 0, 1024);
1926 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
1927 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1929 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
1930 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
1931 RNA_def_property_range(prop, 0.0f, 10.0f);
1932 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
1933 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1938 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
1939 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
1940 RNA_def_property_enum_items(prop, exr_codec_items);
1941 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
1942 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1944 prop= RNA_def_property(srna, "exr_half", PROP_BOOLEAN, PROP_NONE);
1945 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
1946 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
1947 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1949 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
1950 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
1951 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int zbuffer)");
1952 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1954 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
1955 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
1956 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
1957 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1960 #ifdef WITH_OPENJPEG
1963 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
1964 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
1965 RNA_def_property_enum_items(prop, jp2_preset_items);
1966 RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_jpeg2k_preset_set", NULL);
1967 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
1968 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1970 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
1971 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
1972 RNA_def_property_enum_items(prop, jp2_depth_items);
1973 RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_jpeg2k_depth_set", NULL);
1974 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
1975 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1977 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
1978 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
1979 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
1980 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1983 #ifdef WITH_QUICKTIME
1986 prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
1987 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
1988 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
1989 RNA_def_property_enum_funcs(prop, "rna_SceneRenderData_qtcodecsettings_codecType_get",
1990 "rna_SceneRenderData_qtcodecsettings_codecType_set",
1991 "rna_SceneRenderData_qtcodecsettings_codecType_itemf");
1992 RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
1993 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1995 prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
1996 RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
1997 RNA_def_property_range(prop, 0, 100);
1998 RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
1999 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2005 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
2006 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
2007 RNA_def_property_enum_items(prop, ffmpeg_format_items);
2008 RNA_def_property_ui_text(prop, "Format", "Output file format");
2009 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2011 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
2012 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
2013 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
2014 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
2015 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2017 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
2018 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
2019 RNA_def_property_range(prop, 1, 14000);
2020 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
2021 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2023 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
2024 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
2025 RNA_def_property_range(prop, 0, 9000);
2026 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
2027 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2029 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
2030 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
2031 RNA_def_property_range(prop, 1, 14000);
2032 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
2033 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2035 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
2036 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
2037 RNA_def_property_range(prop, 0, 100000000);
2038 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
2039 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2041 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
2042 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
2043 RNA_def_property_range(prop, 0, 100);
2044 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
2045 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2047 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
2048 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
2049 RNA_def_property_range(prop, 0, 2000);
2050 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
2051 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2053 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
2054 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
2055 RNA_def_property_range(prop, 0, 16384);
2056 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
2057 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2059 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
2060 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
2061 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary.");
2062 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2065 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
2066 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
2067 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
2068 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
2069 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2071 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
2072 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
2073 RNA_def_property_range(prop, 32, 384);
2074 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
2075 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2077 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
2078 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
2079 RNA_def_property_range(prop, 8000, 192000);
2080 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
2081 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2083 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
2084 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
2085 RNA_def_property_range(prop, 0.0f, 1.0f);
2086 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
2087 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2091 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2092 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
2093 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2094 RNA_def_property_range(prop, 1, 120);
2095 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second.");
2096 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2098 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
2099 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
2100 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2101 RNA_def_property_range(prop, 0.1f, 120.0f);
2102 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
2103 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2105 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
2106 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
2107 RNA_def_property_range(prop, 0.0f, 2.0f);
2108 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding.");
2109 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2111 prop= RNA_def_property(srna, "pixel_filter", PROP_ENUM, PROP_NONE);
2112 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
2113 RNA_def_property_enum_items(prop, pixel_filter_items);
2114 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples.");
2115 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2117 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
2118 RNA_def_property_float_sdna(prop, NULL, "gauss");
2119 RNA_def_property_range(prop, 0.5f, 1.5f);
2120 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples.");
2121 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2123 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2124 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
2125 RNA_def_property_enum_items(prop, alpha_mode_items);
2126 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels.");
2127 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2129 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
2130 RNA_def_property_enum_sdna(prop, NULL, "ocres");
2131 RNA_def_property_enum_items(prop, octree_resolution_items);
2132 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes.");
2133 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2135 prop= RNA_def_property(srna, "raytrace_structure", PROP_ENUM, PROP_NONE);
2136 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
2137 RNA_def_property_enum_items(prop, raytrace_structure_items);
2138 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure.");
2139 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2141 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
2142 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
2143 RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates.");
2144 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2146 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
2147 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
2148 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.");
2149 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2151 prop= RNA_def_property(srna, "antialiasing", PROP_BOOLEAN, PROP_NONE);
2152 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
2153 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges.");
2154 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2156 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
2157 RNA_def_property_enum_sdna(prop, NULL, "osa");
2158 RNA_def_property_enum_items(prop, fixed_oversample_items);
2159 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel.");
2160 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2162 prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
2163 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
2164 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output.");
2165 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2167 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
2168 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2169 RNA_def_property_enum_items(prop, field_order_items);
2170 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");
2171 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2173 prop= RNA_def_property(srna, "fields_still", PROP_BOOLEAN, PROP_NONE);
2174 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
2175 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields.");
2176 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2178 prop= RNA_def_property(srna, "render_shadows", PROP_BOOLEAN, PROP_NONE);
2179 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
2180 RNA_def_property_ui_text(prop, "Render Shadows", "Calculate shadows while rendering.");
2181 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2183 prop= RNA_def_property(srna, "render_envmaps", PROP_BOOLEAN, PROP_NONE);
2184 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
2185 RNA_def_property_ui_text(prop, "Render Environment Maps", "Calculate environment maps while rendering.");
2186 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2188 prop= RNA_def_property(srna, "render_radiosity", PROP_BOOLEAN, PROP_NONE);
2189 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
2190 RNA_def_property_ui_text(prop, "Render Radiosity", "Calculate radiosity in a pre-process before rendering.");
2191 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2193 prop= RNA_def_property(srna, "render_sss", PROP_BOOLEAN, PROP_NONE);
2194 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
2195 RNA_def_property_ui_text(prop, "Render SSS", "Calculate sub-surface scattering in materials rendering.");
2196 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2198 prop= RNA_def_property(srna, "render_raytracing", PROP_BOOLEAN, PROP_NONE);
2199 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
2200 RNA_def_property_ui_text(prop, "Render Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects.");
2201 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2203 prop= RNA_def_property(srna, "render_textures", PROP_BOOLEAN, PROP_NONE);
2204 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
2205 RNA_def_property_ui_text(prop, "Render Textures", "Use textures to affect material properties.");
2206 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2208 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
2209 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
2210 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
2211 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2213 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
2214 RNA_def_property_int_sdna(prop, NULL, "edgeint");
2215 RNA_def_property_range(prop, 0, 255);
2216 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
2217 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2219 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
2220 RNA_def_property_float_sdna(prop, NULL, "edgeR");
2221 RNA_def_property_array(prop, 3);
2222 RNA_def_property_ui_text(prop, "Edge Color", "");
2223 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2225 prop= RNA_def_property(srna, "freestyle", PROP_BOOLEAN, PROP_NONE);
2226 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE_FRS);
2227 RNA_def_property_ui_text(prop, "Edge", "Draw stylized strokes using Freestyle.");
2228 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2230 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
2231 RNA_def_property_int_sdna(prop, NULL, "threads");
2232 RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
2233 RNA_def_property_int_funcs(prop, "rna_SceneRenderData_threads_get", NULL, NULL);
2234 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
2235 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2237 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
2238 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2239 RNA_def_property_enum_items(prop, threads_mode_items);
2240 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
2241 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2243 prop= RNA_def_property(srna, "motion_blur", PROP_BOOLEAN, PROP_NONE);
2244 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
2245 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
2246 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2248 prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
2249 RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
2250 RNA_def_property_range(prop, 1, 32);
2251 RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
2252 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2254 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
2255 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
2256 RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size. Note, this disables save_buffers and full_sample.");
2257 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2259 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
2260 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
2261 RNA_def_property_range(prop, 0.0f, 1.0f);
2262 RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border.");
2263 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2265 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
2266 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
2267 RNA_def_property_range(prop, 0.0f, 1.0f);
2268 RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
2269 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2271 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
2272 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
2273 RNA_def_property_range(prop, 0.0f, 1.0f);
2274 RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
2275 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2277 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
2278 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
2279 RNA_def_property_range(prop, 0.0f, 1.0f);
2280 RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
2281 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2283 prop= RNA_def_property(srna, "crop_to_border", PROP_BOOLEAN, PROP_NONE);
2284 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
2285 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size.");
2286 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2288 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
2289 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
2290 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch').");
2291 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2293 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2294 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2295 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering.");
2296 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2298 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
2299 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
2300 RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled.");
2301 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2303 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
2304 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
2305 RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist.");
2306 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2308 prop= RNA_def_property(srna, "color_management", PROP_BOOLEAN, PROP_NONE);
2309 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
2310 RNA_def_property_ui_text(prop, "Color Management", "Use color profiles and gamma corrected imaging pipeline");
2311 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_MATERIAL|ND_SHADING, "rna_SceneRenderData_color_management_update");
2313 prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
2314 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
2315 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
2316 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2318 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
2319 RNA_def_property_enum_sdna(prop, NULL, "imtype");
2320 RNA_def_property_enum_items(prop, image_type_items);
2321 RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_file_format_set", NULL);
2322 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as.");
2323 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2325 prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
2326 RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
2327 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders.");
2328 RNA_def_struct_name_property(srna, prop);
2329 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2331 prop= RNA_def_property(srna, "free_image_textures", PROP_BOOLEAN, PROP_NONE);
2332 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2333 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing.");
2334 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2336 prop= RNA_def_property(srna, "free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
2337 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2338 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory.");
2339 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2341 prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE);
2342 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
2343 RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_save_buffers_get", NULL);
2344 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).");
2345 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2347 prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE);
2348 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
2349 RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_full_sample_get", NULL);
2350 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.");
2351 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2353 prop= RNA_def_property(srna, "backbuf", PROP_BOOLEAN, PROP_NONE);
2354 RNA_def_property_boolean_sdna(prop, NULL, "bufflag", R_BACKBUF);
2355 RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image");
2356 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2358 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2359 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
2360 RNA_def_property_enum_items(prop, display_mode_items);
2361 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
2362 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2364 prop= RNA_def_property(srna, "output_path", PROP_STRING, PROP_DIRPATH);
2365 RNA_def_property_string_sdna(prop, NULL, "pic");
2366 RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers.");
2367 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2371 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
2372 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
2373 RNA_def_property_enum_items(prop, bake_mode_items);
2374 RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
2376 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
2377 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
2378 RNA_def_property_enum_items(prop, bake_normal_space_items);
2379 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
2381 prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
2382 RNA_def_property_enum_items(prop, bake_qyad_split_items);
2383 RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
2385 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
2386 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
2387 RNA_def_property_enum_items(prop, bake_aa_items);
2388 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
2390 prop= RNA_def_property(srna, "bake_active", PROP_BOOLEAN, PROP_NONE);
2391 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
2392 RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
2394 prop= RNA_def_property(srna, "bake_normalized", PROP_BOOLEAN, PROP_NONE);
2395 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
2396 RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings.");
2398 prop= RNA_def_property(srna, "bake_clear", PROP_BOOLEAN, PROP_NONE);
2399 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
2400 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
2402 prop= RNA_def_property(srna, "bake_enable_aa", PROP_BOOLEAN, PROP_NONE);
2403 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
2404 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
2406 prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
2407 RNA_def_property_int_sdna(prop, NULL, "bake_filter");
2408 RNA_def_property_range(prop, 0, 32);
2409 RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
2411 prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
2412 RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
2413 RNA_def_property_range(prop, 0.0, 1000.0);
2414 RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
2416 prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
2417 RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
2418 RNA_def_property_range(prop, 0.0, 1000.0);
2419 RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
2423 prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE);
2424 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
2425 RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
2426 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2428 prop= RNA_def_property(srna, "stamp_date", PROP_BOOLEAN, PROP_NONE);
2429 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
2430 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
2431 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2433 prop= RNA_def_property(srna, "stamp_frame", PROP_BOOLEAN, PROP_NONE);
2434 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
2435 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
2436 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2438 prop= RNA_def_property(srna, "stamp_camera", PROP_BOOLEAN, PROP_NONE);
2439 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
2440 RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
2441 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2443 prop= RNA_def_property(srna, "stamp_scene", PROP_BOOLEAN, PROP_NONE);
2444 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
2445 RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
2446 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2448 prop= RNA_def_property(srna, "stamp_note", PROP_BOOLEAN, PROP_NONE);
2449 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
2450 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
2451 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2453 prop= RNA_def_property(srna, "stamp_marker", PROP_BOOLEAN, PROP_NONE);
2454 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
2455 RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
2456 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2458 prop= RNA_def_property(srna, "stamp_filename", PROP_BOOLEAN, PROP_NONE);
2459 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
2460 RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
2461 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2463 prop= RNA_def_property(srna, "stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
2464 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
2465 RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
2466 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2468 prop= RNA_def_property(srna, "stamp_render_time", PROP_BOOLEAN, PROP_NONE);
2469 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
2470 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
2471 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2473 prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
2474 RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
2475 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
2476 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2478 prop= RNA_def_property(srna, "render_stamp", PROP_BOOLEAN, PROP_NONE);
2479 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
2480 RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
2481 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2483 prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
2484 RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
2485 RNA_def_property_range(prop, 8, 64);
2486 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
2487 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2489 prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
2490 RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
2491 RNA_def_property_array(prop, 4);
2492 RNA_def_property_range(prop,0.0,1.0);
2493 RNA_def_property_ui_text(prop, "Stamp Foreground", "Stamp text color");
2494 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2496 prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
2497 RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
2498 RNA_def_property_array(prop, 4);
2499 RNA_def_property_range(prop,0.0,1.0);
2500 RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
2501 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2505 prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
2506 RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
2507 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2508 RNA_def_property_ui_text(prop, "Render Layers", "");
2510 prop= RNA_def_property(srna, "single_layer", PROP_BOOLEAN, PROP_NONE);
2511 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
2512 RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer.");
2513 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2515 prop= RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE);
2516 RNA_def_property_int_sdna(prop, NULL, "actlay");
2517 RNA_def_property_int_funcs(prop, "rna_SceneRenderData_active_layer_index_get", "rna_SceneRenderData_active_layer_index_set", "rna_SceneRenderData_active_layer_index_range");
2518 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array.");
2519 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2522 prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
2523 RNA_def_property_enum_items(prop, engine_items);
2524 RNA_def_property_enum_funcs(prop, "rna_SceneRenderData_engine_get", "rna_SceneRenderData_engine_set", "rna_SceneRenderData_engine_itemf");
2525 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering.");
2526 RNA_def_property_update(prop, NC_WINDOW, NULL);
2528 prop= RNA_def_property(srna, "multiple_engines", PROP_BOOLEAN, PROP_NONE);
2529 RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_multiple_engines_get", NULL);
2530 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2531 RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available.");
2533 prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
2534 RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_use_game_engine_get", NULL);
2535 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2536 RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine.");
2539 prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
2540 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
2541 RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders.");
2542 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2544 prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_NONE);
2545 RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
2546 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
2547 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level.");
2548 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2550 prop= RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
2551 RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
2552 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage.");
2553 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2555 prop= RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
2556 RNA_def_property_int_sdna(prop, NULL, "simplify_shadowsamples");
2557 RNA_def_property_ui_range(prop, 1, 16, 1, 0);
2558 RNA_def_property_ui_text(prop, "Simplify Shadow Samples", "Global maximum shadow samples.");
2559 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2561 prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
2562 RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
2563 RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor.");
2564 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2566 prop= RNA_def_property(srna, "simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
2567 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
2568 RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated.");
2571 RNA_api_scene_render(srna);
2575 static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
2583 RNA_def_property_srna(cprop, "SceneObjects");
2584 srna= RNA_def_struct(brna, "SceneObjects", NULL);
2585 RNA_def_struct_sdna(srna, "Scene");
2586 RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects.");
2588 func= RNA_def_function(srna, "link", "rna_Scene_link_object");
2589 RNA_def_function_ui_description(func, "Link object to scene.");
2590 RNA_def_function_flag(func, FUNC_USE_REPORTS);
2591 parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
2592 RNA_def_property_flag(parm, PROP_REQUIRED);
2594 func= RNA_def_function(srna, "unlink", "rna_Scene_unlink_object");
2595 RNA_def_function_ui_description(func, "Unlink object from scene.");
2596 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
2597 parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
2598 RNA_def_property_flag(parm, PROP_REQUIRED);
2600 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2601 RNA_def_property_struct_type(prop, "Object");
2602 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL);
2603 RNA_def_property_flag(prop, PROP_EDITABLE);
2604 RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene.");
2605 /* Could call: ED_base_object_activate(C, scene->basact);
2606 * but would be a bad level call and it seems the notifier is enough */
2607 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
2612 static void rna_def_scene_bases(BlenderRNA *brna, PropertyRNA *cprop)
2617 // FunctionRNA *func;
2618 // PropertyRNA *parm;
2620 RNA_def_property_srna(cprop, "SceneBases");
2621 srna= RNA_def_struct(brna, "SceneBases", NULL);
2622 RNA_def_struct_sdna(srna, "Scene");
2623 RNA_def_struct_ui_text(srna, "Scene Bases", "Collection of scene bases.");
2625 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2626 RNA_def_property_struct_type(prop, "ObjectBase");
2627 RNA_def_property_pointer_sdna(prop, NULL, "basact");
2628 RNA_def_property_flag(prop, PROP_EDITABLE);
2629 RNA_def_property_ui_text(prop, "Active Base", "Active object base in the scene.");
2630 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
2633 void RNA_def_scene(BlenderRNA *brna)
2639 static EnumPropertyItem audio_distance_model_items[] = {
2640 {0, "NONE", 0, "None", "No distance attenuation."},
2641 {1, "INVERSE", 0, "Inverse", "Inverse distance model."},
2642 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping."},
2643 {3, "LINEAR", 0, "Linear", "Linear distance model."},
2644 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping."},
2645 {5, "EXPONENT", 0, "Exponent", "Exponent distance model."},
2646 {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping."},
2647 {0, NULL, 0, NULL, NULL}};
2649 /* Struct definition */
2650 srna= RNA_def_struct(brna, "Scene", "ID");
2651 RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings.");
2652 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
2653 RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
2655 /* Global Settings */
2656 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
2657 RNA_def_property_flag(prop, PROP_EDITABLE);
2658 RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene.");
2659 RNA_def_property_update(prop, NC_SCENE, NULL);
2661 prop= RNA_def_property(srna, "set", PROP_POINTER, PROP_NONE);
2662 RNA_def_property_pointer_sdna(prop, NULL, "set");
2663 RNA_def_property_struct_type(prop, "Scene");
2664 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2665 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL);
2666 RNA_def_property_ui_text(prop, "Set Scene", "Background set scene.");
2667 RNA_def_property_update(prop, NC_SCENE, NULL);
2669 prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
2670 RNA_def_property_flag(prop, PROP_EDITABLE);
2671 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene.");
2672 RNA_def_property_update(prop, NC_SCENE|NC_WORLD, NULL);
2674 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ|PROP_UNIT_LENGTH);
2675 RNA_def_property_float_sdna(prop, NULL, "cursor");
2676 RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location.");
2677 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
2678 RNA_def_property_update(prop, NC_WINDOW, NULL);
2681 prop= RNA_def_property(srna, "bases", PROP_COLLECTION, PROP_NONE);
2682 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
2683 RNA_def_property_struct_type(prop, "ObjectBase");
2684 RNA_def_property_ui_text(prop, "Bases", "");
2685 rna_def_scene_bases(brna, prop);
2687 prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
2688 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
2689 RNA_def_property_struct_type(prop, "Object");
2690 RNA_def_property_ui_text(prop, "Objects", "");
2691 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0);
2692 rna_def_scene_objects(brna, prop);
2695 prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
2696 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
2697 RNA_def_property_array(prop, 20);
2698 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
2699 RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene.");
2700 RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_layer_update");
2702 /* Frame Range Stuff */
2703 prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_TIME);
2704 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2705 RNA_def_property_int_sdna(prop, NULL, "r.cfra");
2706 RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
2707 RNA_def_property_ui_text(prop, "Current Frame", "");
2708 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
2709 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
2711 prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
2712 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2713 RNA_def_property_int_sdna(prop, NULL, "r.sfra");
2714 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
2715 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
2716 RNA_def_property_ui_text(prop, "Start Frame", "");
2717 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2719 prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_TIME);
2720 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2721 RNA_def_property_int_sdna(prop, NULL, "r.efra");
2722 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
2723 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
2724 RNA_def_property_ui_text(prop, "End Frame", "");
2725 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2727 prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
2728 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2729 RNA_def_property_int_sdna(prop, NULL, "r.frame_step");
2730 RNA_def_property_range(prop, 0, MAXFRAME);
2731 RNA_def_property_ui_range(prop, 0, 100, 1, 0);
2732 RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
2733 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2735 /* Preview Range (frame-range for UI playback) */
2736 prop=RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
2737 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2738 RNA_def_property_boolean_sdna(prop, NULL, "r.flag", SCER_PRV_RANGE);
2739 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_preview_range_set");
2740 RNA_def_property_ui_text(prop, "Use Preview Range", "");
2741 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2743 prop= RNA_def_property(srna, "preview_range_start_frame", PROP_INT, PROP_TIME);
2744 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2745 RNA_def_property_int_sdna(prop, NULL, "r.psfra");
2746 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
2747 RNA_def_property_ui_text(prop, "Preview Range Start Frame", "");
2748 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2750 prop= RNA_def_property(srna, "preview_range_end_frame", PROP_INT, PROP_TIME);
2751 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2752 RNA_def_property_int_sdna(prop, NULL, "r.pefra");
2753 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
2754 RNA_def_property_ui_text(prop, "Preview Range End Frame", "");
2755 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2758 prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
2759 RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
2760 RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping.");
2761 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2763 /* Animation Data (for Scene) */
2764 rna_def_animdata_common(srna);
2766 /* Readonly Properties */
2767 prop= RNA_def_property(srna, "nla_tweakmode_on", PROP_BOOLEAN, PROP_NONE);
2768 RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_NLA_EDIT_ON);
2769 RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
2770 RNA_def_property_ui_text(prop, "NLA TweakMode", "Indicates whether there is any action referenced by NLA being edited. Strictly read-only.");
2771 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2774 /* Nodes (Compositing) */
2775 prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
2776 RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree.");
2778 prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
2779 RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
2780 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_nodes_set");
2781 RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree.");
2782 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2785 prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
2786 RNA_def_property_pointer_sdna(prop, NULL, "ed");
2787 RNA_def_property_struct_type(prop, "SequenceEditor");
2788 RNA_def_property_ui_text(prop, "Sequence Editor", "");
2791 prop= RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
2792 RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
2793 RNA_def_property_struct_type(prop, "KeyingSet");
2794 RNA_def_property_ui_text(prop, "Keying Sets", "Keying Sets for this Scene.");
2795 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2797 prop= RNA_def_property(srna, "active_keying_set", PROP_POINTER, PROP_NONE);
2798 RNA_def_property_struct_type(prop, "KeyingSet");
2799 RNA_def_property_flag(prop, PROP_EDITABLE);
2800 RNA_def_property_editable_func(prop, "rna_Scene_active_keying_set_editable");
2801 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL);
2802 RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes.");
2803 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2805 prop= RNA_def_property(srna, "active_keying_set_index", PROP_INT, PROP_NONE);
2806 RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
2807 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");
2808 RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index.");
2809 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2812 prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
2813 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2814 RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
2815 RNA_def_property_struct_type(prop, "ToolSettings");
2816 RNA_def_property_ui_text(prop, "Tool Settings", "");
2819 prop= RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
2820 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2821 RNA_def_property_pointer_sdna(prop, NULL, "unit");
2822 RNA_def_property_struct_type(prop, "UnitSettings");
2823 RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
2825 /* Physics Settings */
2826 prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
2827 RNA_def_property_float_sdna(prop, NULL, "physics_settings.gravity");
2828 RNA_def_property_array(prop, 3);
2829 RNA_def_property_range(prop, -200.0f, 200.0f);
2830 RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
2831 RNA_def_property_update(prop, 0, "rna_Physics_update");
2833 prop= RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
2834 RNA_def_property_boolean_sdna(prop, NULL, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
2835 RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics.");
2836 RNA_def_property_update(prop, 0, "rna_Physics_update");
2839 prop= RNA_def_property(srna, "render_data", PROP_POINTER, PROP_NONE);
2840 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2841 RNA_def_property_pointer_sdna(prop, NULL, "r");
2842 RNA_def_property_struct_type(prop, "SceneRenderData");
2843 RNA_def_property_ui_text(prop, "Render Data", "");
2846 prop= RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
2847 RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
2848 RNA_def_property_struct_type(prop, "TimelineMarker");
2849 RNA_def_property_ui_text(prop, "Timeline Markers", "Markers used in all timelines for the current scene.");
2851 /* Audio Settings */
2852 prop= RNA_def_property(srna, "mute_audio", PROP_BOOLEAN, PROP_NONE);
2853 RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_MUTE);
2854 RNA_def_property_ui_text(prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted.");
2855 RNA_def_property_update(prop, NC_SCENE, NULL);
2857 prop= RNA_def_property(srna, "sync_audio", PROP_BOOLEAN, PROP_NONE);
2858 RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
2859 RNA_def_property_ui_text(prop, "Audio Sync", "Play back and sync with audio from Sequence Editor for realtime playback.");
2860 RNA_def_property_update(prop, NC_SCENE, NULL);
2862 prop= RNA_def_property(srna, "scrub_audio", PROP_BOOLEAN, PROP_NONE);
2863 RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SCRUB);
2864 RNA_def_property_ui_text(prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing.");
2865 RNA_def_property_update(prop, NC_SCENE, NULL);
2867 prop= RNA_def_property(srna, "speed_of_sound", PROP_FLOAT, PROP_NONE);
2868 RNA_def_property_float_sdna(prop, NULL, "audio.speed_of_sound");
2869 RNA_def_property_range(prop, 0.01f, FLT_MAX);
2870 RNA_def_property_ui_text(prop, "Speed of Sound", "Speed of sound for doppler effect calculation.");
2871 RNA_def_property_update(prop, NC_SCENE, NULL);
2873 prop= RNA_def_property(srna, "doppler_factor", PROP_FLOAT, PROP_NONE);
2874 RNA_def_property_float_sdna(prop, NULL, "audio.doppler_factor");
2875 RNA_def_property_range(prop, 0.0, FLT_MAX);
2876 RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for doppler effect calculation.");
2877 RNA_def_property_update(prop, NC_SCENE, NULL);
2879 prop= RNA_def_property(srna, "distance_model", PROP_ENUM, PROP_NONE);
2880 RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio.distance_model");
2881 RNA_def_property_enum_items(prop, audio_distance_model_items);
2882 RNA_def_property_ui_text(prop, "Distance Model", "Distance model for distance attenuation calculation.");
2883 RNA_def_property_update(prop, NC_SCENE, NULL);
2886 prop= RNA_def_property(srna, "game_data", PROP_POINTER, PROP_NONE);
2887 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2888 RNA_def_property_pointer_sdna(prop, NULL, "gm");
2889 RNA_def_property_struct_type(prop, "SceneGameData");
2890 RNA_def_property_ui_text(prop, "Game Data", "");
2893 func= RNA_def_function(srna, "statistics", "ED_info_stats_string");
2894 prop= RNA_def_string(func, "statistics", "", 0, "Statistics", "");
2895 RNA_def_function_return(func, prop);
2898 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
2899 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
2900 RNA_def_property_flag(prop, PROP_EDITABLE);
2901 RNA_def_property_struct_type(prop, "GreasePencil");
2902 RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock");
2905 prop= RNA_def_property(srna, "freestyle_current_layer_number", PROP_INT, PROP_NONE);
2906 RNA_def_property_int_sdna(prop, NULL, "freestyle_current_layer_number");
2907 RNA_def_property_ui_text(prop, "Freestyle Current Layer Number", "Number of current layers in Freestyle.");
2908 RNA_def_property_update(prop, NC_SCENE, NULL);
2910 /* Transform Orientations */
2911 prop= RNA_def_property(srna, "orientations", PROP_COLLECTION, PROP_NONE);
2912 RNA_def_property_collection_sdna(prop, NULL, "transform_spaces", NULL);
2913 RNA_def_property_struct_type(prop, "TransformOrientation");
2914 RNA_def_property_ui_text(prop, "Transform Orientations", "");
2917 rna_def_tool_settings(brna);
2918 rna_def_unit_settings(brna);
2919 rna_def_scene_render_data(brna);
2920 rna_def_scene_game_data(brna);
2921 rna_def_scene_render_layer(brna);
2922 rna_def_transform_orientation(brna);
2925 RNA_api_scene(srna);