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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * Contributor(s): Blender Foundation (2008).
22 * ***** END GPL LICENSE BLOCK *****
27 #include "RNA_define.h"
28 #include "RNA_enum_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"
38 /* Include for Bake Options */
39 #include "RE_pipeline.h"
42 #include "quicktime_export.h"
43 #include "AUD_C-API.h"
47 #include "BKE_writeffmpeg.h"
48 #include <libavcodec/avcodec.h>
49 #include <libavformat/avformat.h>
54 #include "BLI_threads.h"
56 EnumPropertyItem snap_target_items[] = {
57 {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
58 {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target"},
59 {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
60 {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
61 {0, NULL, 0, NULL, NULL}};
63 EnumPropertyItem proportional_falloff_items[] ={
64 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
65 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
66 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
67 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
68 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", ""},
69 {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", ""},
70 {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
71 {0, NULL, 0, NULL, NULL}};
74 EnumPropertyItem proportional_editing_items[] = {
75 {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", ""},
76 {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", ""},
77 {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", ""},
78 {0, NULL, 0, NULL, NULL}};
80 /* keep for operators, not used here */
81 EnumPropertyItem mesh_select_mode_items[] = {
82 {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
83 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
84 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
85 {0, NULL, 0, NULL, NULL}};
87 EnumPropertyItem snap_element_items[] = {
88 {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid"},
89 {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
90 {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"},
91 {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces"},
92 {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"},
93 {0, NULL, 0, NULL, NULL}};
95 EnumPropertyItem image_type_items[] = {
96 {0, "", 0, "Image", NULL},
97 {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""},
98 //{R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, // XXX not yet implemented
99 {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""},
100 {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""},
101 {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""},
103 {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""},
105 {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""},
106 {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", ""},
107 {0, "", 0, " ", NULL},
108 {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""},
109 {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", ""},
111 {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""},
112 {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""},
114 {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", ""},
116 {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""},
118 {0, "", 0, "Movie", NULL},
120 {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""}, // XXX Missing codec menu
122 {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", ""},
123 {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", ""},
124 {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
126 {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
127 {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", ""},
128 {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
130 #ifdef WITH_QUICKTIME
132 {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", ""},
134 {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", ""},
138 {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""},
140 {0, NULL, 0, NULL, NULL}};
144 #include "DNA_anim_types.h"
145 #include "DNA_node_types.h"
146 #include "DNA_object_types.h"
147 #include "DNA_mesh_types.h"
149 #include "BKE_context.h"
150 #include "BKE_global.h"
151 #include "BKE_image.h"
152 #include "BKE_main.h"
153 #include "BKE_node.h"
154 #include "BKE_pointcache.h"
155 #include "BKE_scene.h"
156 #include "BKE_depsgraph.h"
157 #include "BKE_image.h"
158 #include "BKE_mesh.h"
159 #include "BKE_sound.h"
160 #include "BKE_screen.h"
162 #include "BLI_threads.h"
163 #include "BLI_editVert.h"
169 #include "ED_view3d.h"
170 #include "ED_object.h"
172 #include "ED_keyframing.h"
174 #include "RE_pipeline.h"
176 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
178 ListBaseIterator *internal= iter->internal;
180 /* we are actually iterating a Base list, so override get */
181 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
184 static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
186 Scene *scene_act= CTX_data_scene(C);
189 if (object_in_scene(ob, scene)) {
190 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
194 base= scene_add_base(scene, ob);
197 /* this is similar to what object_add_type and add_object do */
198 base->lay= scene->lay;
200 /* when linking to an inactive scene dont touch the layer */
201 if(scene == scene_act)
204 ob->recalc |= OB_RECALC;
206 DAG_scene_sort(scene);
211 static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
213 Base *base= object_in_scene(ob, scene);
215 BKE_report(reports, RPT_ERROR, "Object is not in this scene.");
218 if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
219 BKE_report(reports, RPT_ERROR, "Object must be in 'Object Mode' to unlink.");
223 /* as long as ED_base_object_free_and_unlink calls free_libblock_us, we don't have to decrement ob->id.us */
224 ED_base_object_free_and_unlink(scene, base);
226 /* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
227 DAG_scene_sort(scene);
228 DAG_ids_flush_update(0);
230 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
233 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
235 ToolSettings *ts = (ToolSettings*)ptr->data;
236 if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
237 ts->skgen_template = value.data;
239 ts->skgen_template = NULL;
242 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
244 Scene *scene= (Scene*)ptr->data;
245 return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
248 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
250 Scene *scene= (Scene*)ptr->data;
252 scene->basact= object_in_scene((Object*)value.data, scene);
257 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
259 Scene *scene= (Scene*)ptr->data;
260 Scene *set= (Scene*)value.data;
263 for(nested_set= set; nested_set; nested_set= nested_set->set) {
264 if(nested_set==scene)
271 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
273 Scene *scene= (Scene*)ptr->data;
275 scene->lay= ED_view3d_scene_layer_set(scene->lay, values);
278 static void rna_Scene_view3d_update(Main *bmain, Scene *unused, PointerRNA *ptr)
280 Scene *scene= (Scene*)ptr->data;
282 BKE_screen_view3d_main_sync(&bmain->screen, scene);
285 static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
287 Scene *data= (Scene*)ptr->data;
289 /* if negative frames aren't allowed, then we can't use them */
290 FRAMENUMBER_MIN_CLAMP(value);
294 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
296 Scene *data= (Scene*)ptr->data;
297 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
298 CLAMP(value, MINFRAME, data->r.efra);
302 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
304 Scene *data= (Scene*)ptr->data;
305 CLAMP(value, data->r.sfra, MAXFRAME);
309 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
311 Scene *data= (Scene*)ptr->data;
314 /* copy range from scene if not set before */
315 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
316 data->r.psfra= data->r.sfra;
317 data->r.pefra= data->r.efra;
320 data->r.flag |= SCER_PRV_RANGE;
323 data->r.flag &= ~SCER_PRV_RANGE;
327 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
329 Scene *data= (Scene*)ptr->data;
331 /* check if enabled already */
332 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
333 /* set end of preview range to end frame, then clamp as per normal */
334 // TODO: or just refuse to set instead?
335 data->r.pefra= data->r.efra;
338 /* now set normally */
339 CLAMP(value, MINAFRAME, data->r.pefra);
340 data->r.psfra= value;
343 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
345 Scene *data= (Scene*)ptr->data;
347 /* check if enabled already */
348 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
349 /* set start of preview range to start frame, then clamp as per normal */
350 // TODO: or just refuse to set instead?
351 data->r.psfra= data->r.sfra;
354 /* now set normally */
355 CLAMP(value, data->r.psfra, MAXFRAME);
356 data->r.pefra= value;
359 static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
361 //Scene *scene= ptr->id.data;
362 //ED_update_for_newframe(C);
366 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
368 Scene *scene= (Scene *)ptr->data;
369 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
372 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
374 Scene *scene= (Scene *)ptr->data;
375 KeyingSet *ks= (KeyingSet*)value.data;
377 scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
380 /* get KeyingSet index stuff for list of Keying Sets editing UI
381 * - active_keyingset-1 since 0 is reserved for 'none'
382 * - don't clamp, otherwise can never set builtins types as active...
384 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
386 Scene *scene= (Scene *)ptr->data;
387 return scene->active_keyingset-1;
390 /* get KeyingSet index stuff for list of Keying Sets editing UI
391 * - value+1 since 0 is reserved for 'none'=
393 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
395 Scene *scene= (Scene *)ptr->data;
396 scene->active_keyingset= value+1;
399 // XXX: evil... builtin_keyingsets is defined in keyingsets.c!
400 // TODO: make API function to retrieve this...
401 extern ListBase builtin_keyingsets;
403 static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
405 Scene *scene= (Scene*)ptr->data;
407 /* start going over the scene KeyingSets first, while we still have pointer to it
408 * but only if we have any Keying Sets to use...
410 if (scene->keyingsets.first)
411 rna_iterator_listbase_begin(iter, &scene->keyingsets, NULL);
413 rna_iterator_listbase_begin(iter, &builtin_keyingsets, NULL);
416 static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
418 ListBaseIterator *internal= iter->internal;
419 KeyingSet *ks= (KeyingSet*)internal->link;
421 /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
422 if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
423 internal->link= (Link*)builtin_keyingsets.first;
425 internal->link= (Link*)ks->next;
427 iter->valid= (internal->link != NULL);
431 static char *rna_RenderSettings_path(PointerRNA *ptr)
433 return BLI_sprintfN("render");
436 static int rna_RenderSettings_threads_get(PointerRNA *ptr)
438 RenderData *rd= (RenderData*)ptr->data;
440 if(rd->mode & R_FIXED_THREADS)
443 return BLI_system_thread_count();
446 static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
448 RenderData *rd= (RenderData*)ptr->data;
449 return BKE_imtype_is_movie(rd->imtype);
452 static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
454 RenderData *rd= (RenderData*)ptr->data;
455 if(rd->mode & R_BORDER)
458 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
461 static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
463 RenderData *rd= (RenderData*)ptr->data;
465 return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
468 static void rna_RenderSettings_file_format_set(PointerRNA *ptr, int value)
470 RenderData *rd= (RenderData*)ptr->data;
474 ffmpeg_verify_image_type(rd);
476 #ifdef WITH_QUICKTIME
477 quicktime_verify_image_type(rd);
481 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
483 RenderData *rd= (RenderData*)ptr->data;
486 BKE_add_image_extension(ext, rd->imtype);
490 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
492 RenderData *rd= (RenderData*)ptr->data;
493 BKE_add_image_extension(str, rd->imtype);
496 void rna_RenderSettings_jpeg2k_preset_update(RenderData *rd)
498 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
500 switch(rd->jp2_depth) {
502 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
503 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
506 switch(rd->jp2_preset) {
507 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
508 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
509 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
510 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
511 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
512 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
513 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
518 static void rna_RenderSettings_jpeg2k_preset_set(PointerRNA *ptr, int value)
520 RenderData *rd= (RenderData*)ptr->data;
521 rd->jp2_preset= value;
522 rna_RenderSettings_jpeg2k_preset_update(rd);
525 static void rna_RenderSettings_jpeg2k_depth_set(PointerRNA *ptr, int value)
527 RenderData *rd= (RenderData*)ptr->data;
528 rd->jp2_depth= value;
529 rna_RenderSettings_jpeg2k_preset_update(rd);
533 #ifdef WITH_QUICKTIME
534 static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
536 RenderData *rd= (RenderData*)ptr->data;
538 return quicktime_rnatmpvalue_from_videocodectype(rd->qtcodecsettings.codecType);
541 static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
543 RenderData *rd= (RenderData*)ptr->data;
545 rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
548 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, int *free)
550 EnumPropertyItem *item= NULL;
551 EnumPropertyItem tmp = {0, "", 0, "", ""};
552 QuicktimeCodecTypeDesc *codecTypeDesc;
556 for(i=0;i<quicktime_get_num_videocodecs();i++) {
557 codecTypeDesc = quicktime_get_videocodecType_desc(i);
558 if (!codecTypeDesc) break;
560 tmp.value= codecTypeDesc->rnatmpvalue;
561 *((int*)id) = codecTypeDesc->codecType;
564 tmp.name= codecTypeDesc->codecName;
565 RNA_enum_item_add(&item, &totitem, &tmp);
568 RNA_enum_item_end(&item, &totitem);
575 static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
577 RenderData *rd= (RenderData*)ptr->data;
579 return quicktime_rnatmpvalue_from_audiocodectype(rd->qtcodecsettings.audiocodecType);
582 static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
584 RenderData *rd= (RenderData*)ptr->data;
586 rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
589 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr, int *free)
591 EnumPropertyItem *item= NULL;
592 EnumPropertyItem tmp = {0, "", 0, "", ""};
593 QuicktimeCodecTypeDesc *codecTypeDesc;
596 for(i=0;i<quicktime_get_num_audiocodecs();i++) {
597 codecTypeDesc = quicktime_get_audiocodecType_desc(i);
598 if (!codecTypeDesc) break;
600 tmp.value= codecTypeDesc->rnatmpvalue;
601 tmp.identifier= codecTypeDesc->codecName;
602 tmp.name= codecTypeDesc->codecName;
603 RNA_enum_item_add(&item, &totitem, &tmp);
606 RNA_enum_item_end(&item, &totitem);
614 static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
616 RenderData *rd= (RenderData*)ptr->data;
620 static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
622 RenderData *rd= (RenderData*)ptr->data;
626 static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
628 RenderData *rd= (RenderData*)ptr->data;
631 *max= BLI_countlist(&rd->layers)-1;
635 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
637 RenderData *rd= (RenderData*)ptr->data;
638 RenderEngineType *type= BLI_findlink(&R_engines, value);
641 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
644 static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *C, PointerRNA *ptr, int *free)
646 RenderEngineType *type;
647 EnumPropertyItem *item= NULL;
648 EnumPropertyItem tmp = {0, "", 0, "", ""};
651 for(type=R_engines.first; type; type=type->next, a++) {
653 tmp.identifier= type->idname;
654 tmp.name= type->name;
655 RNA_enum_item_add(&item, &totitem, &tmp);
658 RNA_enum_item_end(&item, &totitem);
664 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
666 RenderData *rd= (RenderData*)ptr->data;
667 RenderEngineType *type;
670 for(type=R_engines.first; type; type=type->next, a++)
671 if(strcmp(type->idname, rd->engine) == 0)
677 static void rna_RenderSettings_color_management_update(Main *bmain, Scene *unused, PointerRNA *ptr)
679 /* reset image nodes */
680 Scene *scene= (Scene*)ptr->id.data;
681 bNodeTree *ntree=scene->nodetree;
684 if(ntree && scene->use_nodes) {
685 for (node=ntree->nodes.first; node; node=node->next) {
686 if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
687 ED_node_changed_update(&scene->id, node);
688 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
690 if (node->type == CMP_NODE_IMAGE)
691 BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
697 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
699 Scene *scene= (Scene*)ptr->id.data;
700 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
702 BLI_strncpy(rl->name, value, sizeof(rl->name));
704 if(scene->nodetree) {
706 int index= BLI_findindex(&scene->r.layers, rl);
708 for(node= scene->nodetree->nodes.first; node; node= node->next) {
709 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
710 if(node->custom1==index)
711 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
717 static int rna_RenderSettings_multiple_engines_get(PointerRNA *ptr)
719 return (BLI_countlist(&R_engines) > 1);
722 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
724 RenderData *rd= (RenderData*)ptr->data;
725 RenderEngineType *type;
727 for(type=R_engines.first; type; type=type->next)
728 if(strcmp(type->idname, rd->engine) == 0)
729 return (type->flag & RE_GAME);
734 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
736 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
737 rl->lay= ED_view3d_scene_layer_set(rl->lay, values);
740 static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *unused, PointerRNA *ptr)
742 Scene *scene= (Scene*)ptr->id.data;
745 ntreeCompositForceHidden(scene->nodetree, scene);
748 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
750 Scene *scene= (Scene*)ptr->data;
752 scene->use_nodes= value;
753 if(scene->use_nodes && scene->nodetree==NULL)
754 ED_node_composit_default(scene);
757 static void rna_Physics_update(Main *bmain, Scene *unused, PointerRNA *ptr)
759 Scene *scene= (Scene*)ptr->id.data;
762 for(base = scene->base.first; base; base=base->next)
763 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
766 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
768 Scene *scene= (Scene*)ptr->id.data;
769 ToolSettings *ts = (ToolSettings*)ptr->data;
770 int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
773 ts->selectmode = flag;
776 Mesh *me= get_mesh(scene->basact->object);
777 if(me && me->edit_mesh && me->edit_mesh->selectmode != flag) {
778 me->edit_mesh->selectmode= flag;
779 EM_selectmode_set(me->edit_mesh);
785 static void rna_Scene_editmesh_select_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
790 me= get_mesh(scene->basact->object);
791 if(me && me->edit_mesh==NULL)
795 WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
796 WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
799 static void object_simplify_update(Object *ob)
803 for(md=ob->modifiers.first; md; md=md->next)
804 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
805 ob->recalc |= OB_RECALC_DATA;
810 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
811 object_simplify_update(gob->ob);
815 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
819 for(base= scene->base.first; base; base= base->next)
820 object_simplify_update(base->object);
822 DAG_ids_flush_update(0);
823 WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
826 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
828 Scene *scene= (Scene*)ptr->data;
829 if(scene->audio.flag & AUDIO_SYNC)
831 return scene->flag & SCE_FRAME_DROP;
834 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
836 Scene *scene= (Scene*)ptr->data;
838 if(value == AUDIO_SYNC)
839 scene->audio.flag |= AUDIO_SYNC;
840 else if(value == SCE_FRAME_DROP)
842 scene->audio.flag &= ~AUDIO_SYNC;
843 scene->flag |= SCE_FRAME_DROP;
847 scene->audio.flag &= ~AUDIO_SYNC;
848 scene->flag &= ~SCE_FRAME_DROP;
852 static int rna_GameSettings_auto_start_get(PointerRNA *ptr)
854 if (G.fileflags & G_FILE_AUTOPLAY)
860 static void rna_GameSettings_auto_start_set(PointerRNA *ptr, int value)
863 G.fileflags |= G_FILE_AUTOPLAY;
865 G.fileflags &= ~G_FILE_AUTOPLAY;
869 static TimeMarker *rna_TimeLine_add(Scene *scene, char name[])
871 TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
872 marker->flag= SELECT;
874 BLI_strncpy(marker->name, name, sizeof(marker->name));
875 BLI_addtail(&scene->markers, marker);
879 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker)
881 /* try to remove the F-Curve from the action */
882 if (!BLI_remlink_safe(&scene->markers, marker)) {
883 BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in action '%s'", marker->name, scene->id.name+2);
887 /* XXX, invalidates PyObject */
893 static void rna_def_transform_orientation(BlenderRNA *brna)
898 int matrix_dimsize[]= {3, 3};
900 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
902 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
903 RNA_def_property_float_sdna(prop, NULL, "mat");
904 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
905 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
907 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
908 RNA_def_property_string_sdna(prop, NULL, "name");
909 RNA_def_struct_name_property(srna, prop);
910 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
913 static void rna_def_tool_settings(BlenderRNA *brna)
918 static EnumPropertyItem uv_select_mode_items[] = {
919 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
920 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
921 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
922 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
923 {0, NULL, 0, NULL, NULL}};
925 static EnumPropertyItem auto_key_items[] = {
926 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
927 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
928 {0, NULL, 0, NULL, NULL}};
930 static EnumPropertyItem retarget_roll_items[] = {
931 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
932 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
933 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
934 {0, NULL, 0, NULL, NULL}};
936 static EnumPropertyItem sketch_convert_items[] = {
937 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
938 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
939 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts"},
940 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
941 {0, NULL, 0, NULL, NULL}};
943 static EnumPropertyItem edge_tag_items[] = {
944 {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
945 {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
946 {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
947 {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
948 {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
949 {0, NULL, 0, NULL, NULL}};
951 srna= RNA_def_struct(brna, "ToolSettings", NULL);
952 RNA_def_struct_ui_text(srna, "Tool Settings", "");
954 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
955 RNA_def_property_struct_type(prop, "Sculpt");
956 RNA_def_property_ui_text(prop, "Sculpt", "");
958 prop = RNA_def_property(srna, "auto_normalize", PROP_BOOLEAN, PROP_NONE);
959 RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
960 RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
961 "Ensure all bone-deforming vertex groups add up to 1.0 while "
964 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
965 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
966 RNA_def_property_ui_text(prop, "Vertex Paint", "");
968 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
969 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
970 RNA_def_property_ui_text(prop, "Weight Paint", "");
972 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
973 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
974 RNA_def_property_ui_text(prop, "Image Paint", "");
976 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
977 RNA_def_property_pointer_sdna(prop, NULL, "particle");
978 RNA_def_property_ui_text(prop, "Particle Edit", "");
981 prop= RNA_def_property(srna, "proportional_editing", PROP_ENUM, PROP_NONE);
982 RNA_def_property_enum_sdna(prop, NULL, "proportional");
983 RNA_def_property_enum_items(prop, proportional_editing_items);
984 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode");
985 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
987 prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE);
988 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
989 RNA_def_property_enum_items(prop, proportional_falloff_items);
990 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
991 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
993 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
994 RNA_def_property_float_sdna(prop, NULL, "normalsize");
995 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
996 RNA_def_property_range(prop, 0.00001, 1000.0);
997 RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
998 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
1000 prop= RNA_def_property(srna, "automerge_editing", PROP_BOOLEAN, PROP_NONE);
1001 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
1002 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
1004 prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE);
1005 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
1006 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
1007 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
1008 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1010 prop= RNA_def_property(srna, "snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
1011 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
1012 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
1013 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
1014 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1016 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
1017 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
1018 RNA_def_property_enum_items(prop, snap_element_items);
1019 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
1020 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1022 prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
1023 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
1024 RNA_def_property_enum_items(prop, snap_target_items);
1025 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
1026 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1028 prop= RNA_def_property(srna, "snap_peel_object", PROP_BOOLEAN, PROP_NONE);
1029 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
1030 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
1031 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
1032 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1034 prop= RNA_def_property(srna, "snap_project", PROP_BOOLEAN, PROP_NONE);
1035 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
1036 RNA_def_property_ui_text(prop, "Project Individual Elements", "Project vertices on the surface of other objects");
1037 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
1038 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1041 prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
1042 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
1043 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
1044 RNA_def_property_ui_icon(prop, ICON_REC, 0);
1046 prop= RNA_def_property(srna, "autokey_mode", PROP_ENUM, PROP_NONE);
1047 RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
1048 RNA_def_property_enum_items(prop, auto_key_items);
1049 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
1051 prop= RNA_def_property(srna, "record_with_nla", PROP_BOOLEAN, PROP_NONE);
1052 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
1053 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");
1056 prop= RNA_def_property(srna, "uv_selection_mode", PROP_ENUM, PROP_NONE);
1057 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
1058 RNA_def_property_enum_items(prop, uv_select_mode_items);
1059 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
1060 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1062 prop= RNA_def_property(srna, "uv_sync_selection", PROP_BOOLEAN, PROP_NONE);
1063 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
1064 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
1065 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1066 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1068 prop= RNA_def_property(srna, "uv_local_view", PROP_BOOLEAN, PROP_NONE);
1069 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
1070 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
1071 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1074 prop= RNA_def_property(srna, "mesh_selection_mode", PROP_BOOLEAN, PROP_NONE);
1075 RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
1076 RNA_def_property_array(prop, 3);
1077 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
1078 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
1079 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
1081 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
1082 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
1083 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
1085 /* use with MESH_OT_select_shortest_path */
1086 prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
1087 RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
1088 RNA_def_property_enum_items(prop, edge_tag_items);
1089 RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
1092 prop= RNA_def_property(srna, "bone_sketching", PROP_BOOLEAN, PROP_NONE);
1093 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
1094 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
1095 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1097 prop= RNA_def_property(srna, "etch_quick", PROP_BOOLEAN, PROP_NONE);
1098 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
1099 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
1101 prop= RNA_def_property(srna, "etch_overdraw", PROP_BOOLEAN, PROP_NONE);
1102 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
1103 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
1105 prop= RNA_def_property(srna, "etch_autoname", PROP_BOOLEAN, PROP_NONE);
1106 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
1107 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
1109 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
1110 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1111 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
1113 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
1114 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1115 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
1117 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
1118 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
1119 RNA_def_property_flag(prop, PROP_EDITABLE);
1120 RNA_def_property_struct_type(prop, "Object");
1121 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL);
1122 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
1124 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
1125 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
1126 RNA_def_property_range(prop, 1, 10000);
1127 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
1128 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1130 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
1131 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
1132 RNA_def_property_range(prop, 0.00001, 1.0);
1133 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
1134 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
1135 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1137 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
1138 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
1139 RNA_def_property_range(prop, 0.00001, 100000.0);
1140 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1141 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
1142 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1144 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
1145 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
1146 RNA_def_property_enum_items(prop, retarget_roll_items);
1147 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
1149 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
1150 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
1151 RNA_def_property_enum_items(prop, sketch_convert_items);
1152 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
1153 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1157 static void rna_def_unit_settings(BlenderRNA *brna)
1162 static EnumPropertyItem unit_systems[] = {
1163 {USER_UNIT_NONE, "NONE", 0, "None", ""},
1164 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
1165 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
1166 {0, NULL, 0, NULL, NULL}};
1168 static EnumPropertyItem rotation_units[] = {
1169 {0, "DEGREES", 0, "Degrees", ""},
1170 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
1171 {0, NULL, 0, NULL, NULL}};
1173 srna= RNA_def_struct(brna, "UnitSettings", NULL);
1174 RNA_def_struct_ui_text(srna, "Unit Settings", "");
1177 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
1178 RNA_def_property_enum_items(prop, unit_systems);
1179 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
1180 RNA_def_property_update(prop, NC_WINDOW, NULL);
1182 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
1183 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
1184 RNA_def_property_range(prop, 0.00001, 100000.0);
1185 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1186 RNA_def_property_update(prop, NC_WINDOW, NULL);
1188 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
1189 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
1190 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs");
1191 RNA_def_property_update(prop, NC_WINDOW, NULL);
1193 prop= RNA_def_property(srna, "rotation_units", PROP_ENUM, PROP_NONE);
1194 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
1195 RNA_def_property_enum_items(prop, rotation_units);
1196 RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
1197 RNA_def_property_update(prop, NC_WINDOW, NULL);
1200 void rna_def_render_layer_common(StructRNA *srna, int scene)
1204 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1205 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
1206 else RNA_def_property_string_sdna(prop, NULL, "name");
1207 RNA_def_property_ui_text(prop, "Name", "Render layer name");
1208 RNA_def_struct_name_property(srna, prop);
1209 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1210 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1212 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
1213 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
1214 RNA_def_property_struct_type(prop, "Material");
1215 RNA_def_property_flag(prop, PROP_EDITABLE);
1216 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
1217 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1218 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1220 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
1221 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
1222 RNA_def_property_struct_type(prop, "Group");
1223 RNA_def_property_flag(prop, PROP_EDITABLE);
1224 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
1225 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1226 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1229 prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1230 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1231 RNA_def_property_array(prop, 20);
1232 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
1233 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
1234 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
1235 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1236 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1238 prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_LAYER);
1239 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
1240 RNA_def_property_array(prop, 20);
1241 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers");
1242 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1243 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1246 prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
1247 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
1248 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
1249 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1250 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1252 prop= RNA_def_property(srna, "zmask", PROP_BOOLEAN, PROP_NONE);
1253 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
1254 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
1255 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1256 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1258 prop= RNA_def_property(srna, "zmask_negate", PROP_BOOLEAN, PROP_NONE);
1259 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
1260 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
1261 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1262 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1264 prop= RNA_def_property(srna, "all_z", PROP_BOOLEAN, PROP_NONE);
1265 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
1266 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
1267 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1268 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1270 prop= RNA_def_property(srna, "solid", PROP_BOOLEAN, PROP_NONE);
1271 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
1272 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
1273 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1274 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1276 prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
1277 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
1278 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
1279 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1280 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1282 prop= RNA_def_property(srna, "ztransp", PROP_BOOLEAN, PROP_NONE);
1283 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
1284 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
1285 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1286 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1288 prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
1289 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
1290 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
1291 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1292 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1294 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
1295 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
1296 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
1297 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1298 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1300 prop= RNA_def_property(srna, "strand", PROP_BOOLEAN, PROP_NONE);
1301 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
1302 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
1303 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1304 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1307 prop= RNA_def_property(srna, "pass_combined", PROP_BOOLEAN, PROP_NONE);
1308 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
1309 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
1310 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1311 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1313 prop= RNA_def_property(srna, "pass_z", PROP_BOOLEAN, PROP_NONE);
1314 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
1315 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
1316 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1317 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1319 prop= RNA_def_property(srna, "pass_vector", PROP_BOOLEAN, PROP_NONE);
1320 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
1321 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
1322 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1323 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1325 prop= RNA_def_property(srna, "pass_normal", PROP_BOOLEAN, PROP_NONE);
1326 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
1327 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
1328 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1329 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1331 prop= RNA_def_property(srna, "pass_uv", PROP_BOOLEAN, PROP_NONE);
1332 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
1333 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
1334 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1335 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1337 prop= RNA_def_property(srna, "pass_mist", PROP_BOOLEAN, PROP_NONE);
1338 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
1339 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
1340 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1341 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1343 prop= RNA_def_property(srna, "pass_object_index", PROP_BOOLEAN, PROP_NONE);
1344 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
1345 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
1346 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1347 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1349 prop= RNA_def_property(srna, "pass_color", PROP_BOOLEAN, PROP_NONE);
1350 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
1351 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
1352 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1353 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1355 prop= RNA_def_property(srna, "pass_diffuse", PROP_BOOLEAN, PROP_NONE);
1356 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
1357 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
1358 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1359 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1361 prop= RNA_def_property(srna, "pass_specular", PROP_BOOLEAN, PROP_NONE);
1362 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
1363 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
1364 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1365 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1367 prop= RNA_def_property(srna, "pass_shadow", PROP_BOOLEAN, PROP_NONE);
1368 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
1369 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
1370 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1371 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1373 prop= RNA_def_property(srna, "pass_ao", PROP_BOOLEAN, PROP_NONE);
1374 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
1375 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
1376 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1377 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1379 prop= RNA_def_property(srna, "pass_reflection", PROP_BOOLEAN, PROP_NONE);
1380 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
1381 RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
1382 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1383 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1385 prop= RNA_def_property(srna, "pass_refraction", PROP_BOOLEAN, PROP_NONE);
1386 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
1387 RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
1388 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1389 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1391 prop= RNA_def_property(srna, "pass_emit", PROP_BOOLEAN, PROP_NONE);
1392 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
1393 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
1394 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1395 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1397 prop= RNA_def_property(srna, "pass_environment", PROP_BOOLEAN, PROP_NONE);
1398 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
1399 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
1400 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1401 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1403 prop= RNA_def_property(srna, "pass_indirect", PROP_BOOLEAN, PROP_NONE);
1404 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
1405 RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
1406 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1407 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1409 prop= RNA_def_property(srna, "pass_specular_exclude", PROP_BOOLEAN, PROP_NONE);
1410 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
1411 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
1412 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1413 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1414 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1416 prop= RNA_def_property(srna, "pass_shadow_exclude", PROP_BOOLEAN, PROP_NONE);
1417 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
1418 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
1419 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1420 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1421 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1423 prop= RNA_def_property(srna, "pass_ao_exclude", PROP_BOOLEAN, PROP_NONE);
1424 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
1425 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
1426 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1427 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1428 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1430 prop= RNA_def_property(srna, "pass_reflection_exclude", PROP_BOOLEAN, PROP_NONE);
1431 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
1432 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
1433 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1434 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1435 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1437 prop= RNA_def_property(srna, "pass_refraction_exclude", PROP_BOOLEAN, PROP_NONE);
1438 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
1439 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
1440 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1441 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1442 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1444 prop= RNA_def_property(srna, "pass_emit_exclude", PROP_BOOLEAN, PROP_NONE);
1445 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
1446 RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
1447 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1448 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1449 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1451 prop= RNA_def_property(srna, "pass_environment_exclude", PROP_BOOLEAN, PROP_NONE);
1452 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
1453 RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
1454 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1455 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1456 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1458 prop= RNA_def_property(srna, "pass_indirect_exclude", PROP_BOOLEAN, PROP_NONE);
1459 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
1460 RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
1461 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1462 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1463 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1466 static void rna_def_scene_game_recast_data(BlenderRNA *brna)
1471 srna= RNA_def_struct(brna, "SceneGameRecastData", NULL);
1472 RNA_def_struct_sdna(srna, "RecastData");
1473 RNA_def_struct_nested(brna, srna, "Scene");
1474 RNA_def_struct_ui_text(srna, "Recast Data", "Recast data for a Game datablock");
1476 prop= RNA_def_property(srna, "cellsize", PROP_FLOAT, PROP_NONE);
1477 RNA_def_property_ui_range(prop, 0.1, 1, 0.01, 2);
1478 RNA_def_property_ui_text(prop, "Cell size", "Rasterized cell size");
1479 RNA_def_property_update(prop, NC_SCENE, NULL);
1481 prop= RNA_def_property(srna, "cellheight", PROP_FLOAT, PROP_NONE);
1482 RNA_def_property_ui_range(prop, 0.1, 1, 0.01, 2);
1483 RNA_def_property_ui_text(prop, "Cell height", "Rasterized cell height");
1484 RNA_def_property_update(prop, NC_SCENE, NULL);
1486 prop= RNA_def_property(srna, "agentheight", PROP_FLOAT, PROP_NONE);
1487 RNA_def_property_ui_range(prop, 0.1, 5, 0.1, 2);
1488 RNA_def_property_ui_text(prop, "Agent height", "Minimum height where the agent can still walk");
1489 RNA_def_property_update(prop, NC_SCENE, NULL);
1491 prop= RNA_def_property(srna, "agentradius", PROP_FLOAT, PROP_NONE);
1492 RNA_def_property_ui_range(prop, 0.1, 5, 0.1, 2);
1493 RNA_def_property_ui_text(prop, "Agent radius", "Radius of the agent");
1494 RNA_def_property_update(prop, NC_SCENE, NULL);
1496 prop= RNA_def_property(srna, "agentmaxclimb", PROP_FLOAT, PROP_NONE);
1497 RNA_def_property_ui_range(prop, 0.1, 5, 0.1, 2);
1498 RNA_def_property_ui_text(prop, "Max climb", "Maximum height between grid cells the agent can climb");
1499 RNA_def_property_update(prop, NC_SCENE, NULL);
1501 prop= RNA_def_property(srna, "agentmaxslope", PROP_FLOAT, PROP_ANGLE);
1502 RNA_def_property_range(prop, 0, M_PI/2);
1503 RNA_def_property_ui_text(prop, "Max slope", "Maximum walkable slope angle in degrees");
1504 RNA_def_property_update(prop, NC_SCENE, NULL);
1507 prop= RNA_def_property(srna, "regionminsize", PROP_FLOAT, PROP_NONE);
1508 RNA_def_property_ui_range(prop, 0, 150, 1, 2);
1509 RNA_def_property_ui_text(prop, "Min region size", "Minimum regions size. Smaller regions will be deleted");
1510 RNA_def_property_update(prop, NC_SCENE, NULL);
1512 prop= RNA_def_property(srna, "regionmergesize", PROP_FLOAT, PROP_NONE);
1513 RNA_def_property_ui_range(prop, 0, 150, 1, 2);
1514 RNA_def_property_ui_text(prop, "Merged region size", "Minimum regions size. Smaller regions will be merged");
1515 RNA_def_property_update(prop, NC_SCENE, NULL);
1517 prop= RNA_def_property(srna, "edgemaxlen", PROP_FLOAT, PROP_NONE);
1518 RNA_def_property_ui_range(prop, 0, 50, 1, 2);
1519 RNA_def_property_ui_text(prop, "Max edge length", "Maximum contour edge length");
1520 RNA_def_property_update(prop, NC_SCENE, NULL);
1522 prop= RNA_def_property(srna, "edgemaxerror", PROP_FLOAT, PROP_NONE);
1523 RNA_def_property_ui_range(prop, 0.1, 3.0, 0.1, 2);
1524 RNA_def_property_ui_text(prop, "Max edge error", "Maximum distance error from contour to cells");
1525 RNA_def_property_update(prop, NC_SCENE, NULL);
1527 prop= RNA_def_property(srna, "vertsperpoly", PROP_INT, PROP_NONE);
1528 RNA_def_property_ui_range(prop, 3, 12, 1, 0);
1529 RNA_def_property_ui_text(prop, "Verts per poly", "Max number of vertices per polygon");
1530 RNA_def_property_update(prop, NC_SCENE, NULL);
1532 prop= RNA_def_property(srna, "detailsampledist", PROP_FLOAT, PROP_NONE);
1533 RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2);
1534 RNA_def_property_ui_text(prop, "Sample Distance", "Detail mesh sample spacing");
1535 RNA_def_property_update(prop, NC_SCENE, NULL);
1537 prop= RNA_def_property(srna, "detailsamplemaxerror", PROP_FLOAT, PROP_NONE);
1538 RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2);
1539 RNA_def_property_ui_text(prop, "Max Sample Error", "Detail mesh simplification max sample error");
1540 RNA_def_property_update(prop, NC_SCENE, NULL);
1543 static void rna_def_scene_game_data(BlenderRNA *brna)
1548 static EnumPropertyItem framing_types_items[] ={
1549 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
1550 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1551 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1552 {0, NULL, 0, NULL, NULL}};
1554 static EnumPropertyItem dome_modes_items[] ={
1555 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1556 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1557 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1558 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1559 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1560 {0, NULL, 0, NULL, NULL}};
1562 static EnumPropertyItem stereo_modes_items[] ={
1563 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1564 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1565 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1566 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1567 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1568 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1569 {0, NULL, 0, NULL, NULL}};
1571 static EnumPropertyItem stereo_items[] ={
1572 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
1573 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
1574 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
1575 {0, NULL, 0, NULL, NULL}};
1577 static EnumPropertyItem physics_engine_items[] = {
1578 {WOPHY_NONE, "NONE", 0, "None", ""},
1579 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1580 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1581 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1582 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1583 {WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
1584 {0, NULL, 0, NULL, NULL}};
1586 static EnumPropertyItem material_items[] ={
1587 {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials"},
1588 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
1589 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
1590 {0, NULL, 0, NULL, NULL}};
1592 static EnumPropertyItem obstacle_simulation_items[] = {
1593 {OBSTSIMULATION_NONE, "NONE", 0, "None", ""},
1594 {OBSTSIMULATION_TOI, "TOI", 0, "TOI", ""},
1595 {0, NULL, 0, NULL, NULL}};
1597 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1598 RNA_def_struct_sdna(srna, "GameData");
1599 RNA_def_struct_nested(brna, srna, "Scene");
1600 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
1602 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1603 RNA_def_property_int_sdna(prop, NULL, "xplay");
1604 RNA_def_property_range(prop, 4, 10000);
1605 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
1606 RNA_def_property_update(prop, NC_SCENE, NULL);
1608 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1609 RNA_def_property_int_sdna(prop, NULL, "yplay");
1610 RNA_def_property_range(prop, 4, 10000);
1611 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
1612 RNA_def_property_update(prop, NC_SCENE, NULL);
1614 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
1615 RNA_def_property_int_sdna(prop, NULL, "depth");
1616 RNA_def_property_range(prop, 8, 32);
1617 RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
1618 RNA_def_property_update(prop, NC_SCENE, NULL);
1620 // Do we need it here ? (since we already have it in World
1621 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1622 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1623 RNA_def_property_range(prop, 4, 2000);
1624 RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display");
1625 RNA_def_property_update(prop, NC_SCENE, NULL);
1627 prop= RNA_def_property(srna, "fullscreen", PROP_BOOLEAN, PROP_NONE);
1628 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1629 RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
1630 RNA_def_property_update(prop, NC_SCENE, NULL);
1633 prop= RNA_def_property(srna, "framing_type", PROP_ENUM, PROP_NONE);
1634 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1635 RNA_def_property_enum_items(prop, framing_types_items);
1636 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
1637 RNA_def_property_update(prop, NC_SCENE, NULL);
1639 prop= RNA_def_property(srna, "framing_color", PROP_FLOAT, PROP_COLOR);
1640 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1641 RNA_def_property_array(prop, 3);
1642 RNA_def_property_ui_text(prop, "Framing Color", "Set colour of the bars");
1643 RNA_def_property_update(prop, NC_SCENE, NULL);
1646 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1647 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1648 RNA_def_property_enum_items(prop, stereo_items);
1649 RNA_def_property_ui_text(prop, "Stereo Options", "");
1650 RNA_def_property_update(prop, NC_SCENE, NULL);
1652 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1653 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1654 RNA_def_property_enum_items(prop, stereo_modes_items);
1655 RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
1656 RNA_def_property_update(prop, NC_SCENE, NULL);
1658 prop= RNA_def_property(srna, "eye_separation", PROP_FLOAT, PROP_NONE);
1659 RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
1660 RNA_def_property_range(prop, 0.01, 5.0);
1661 RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
1662 RNA_def_property_update(prop, NC_SCENE, NULL);
1665 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1666 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1667 RNA_def_property_enum_items(prop, dome_modes_items);
1668 RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
1669 RNA_def_property_update(prop, NC_SCENE, NULL);
1671 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1672 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1673 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1674 RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
1675 RNA_def_property_update(prop, NC_SCENE, NULL);
1677 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1678 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1679 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1680 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1681 RNA_def_property_update(prop, NC_SCENE, NULL);
1683 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1684 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1685 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1686 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1687 RNA_def_property_update(prop, NC_SCENE, NULL);
1689 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1690 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1691 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1692 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1693 RNA_def_property_update(prop, NC_SCENE, NULL);
1695 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
1696 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
1697 RNA_def_property_struct_type(prop, "Text");
1698 RNA_def_property_flag(prop, PROP_EDITABLE);
1699 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
1700 RNA_def_property_update(prop, NC_SCENE, NULL);
1703 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
1704 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
1705 RNA_def_property_enum_items(prop, physics_engine_items);
1706 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
1707 RNA_def_property_update(prop, NC_SCENE, NULL);
1709 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
1710 RNA_def_property_float_sdna(prop, NULL, "gravity");
1711 RNA_def_property_range(prop, 0.0, 25.0);
1712 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
1713 RNA_def_property_update(prop, NC_SCENE, NULL);
1715 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_FLOAT, PROP_NONE);
1716 RNA_def_property_float_sdna(prop, NULL, "occlusionRes");
1717 RNA_def_property_range(prop, 128.0, 1024.0);
1718 RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
1719 RNA_def_property_update(prop, NC_SCENE, NULL);
1721 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1722 RNA_def_property_int_sdna(prop, NULL, "ticrate");
1723 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
1724 RNA_def_property_range(prop, 1, 250);
1725 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");
1726 RNA_def_property_update(prop, NC_SCENE, NULL);
1728 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
1729 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
1730 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1731 RNA_def_property_range(prop, 1, 5);
1732 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");
1733 RNA_def_property_update(prop, NC_SCENE, NULL);
1735 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
1736 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
1737 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1738 RNA_def_property_range(prop, 1, 5);
1739 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");
1740 RNA_def_property_update(prop, NC_SCENE, NULL);
1742 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
1743 RNA_def_property_int_sdna(prop, NULL, "physubstep");
1744 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1745 RNA_def_property_range(prop, 1, 5);
1746 RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
1747 RNA_def_property_update(prop, NC_SCENE, NULL);
1750 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
1751 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
1752 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
1754 // not used // deprecated !!!!!!!!!!!!!
1755 prop= RNA_def_property(srna, "activity_culling", PROP_BOOLEAN, PROP_NONE);
1756 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
1757 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
1759 // not used // deprecated !!!!!!!!!!!!!
1760 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
1761 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
1762 RNA_def_property_range(prop, 0.0, 1000.0);
1763 RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
1766 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
1767 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
1768 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
1770 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
1771 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
1772 RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs");
1774 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
1775 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
1776 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
1778 prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
1779 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
1780 RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
1782 prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
1783 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
1784 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
1786 prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
1787 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
1788 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
1790 prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
1791 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
1792 RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
1794 prop= RNA_def_property(srna, "auto_start", PROP_BOOLEAN, PROP_NONE);
1795 RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
1796 RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
1799 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
1800 RNA_def_property_enum_sdna(prop, NULL, "matmode");
1801 RNA_def_property_enum_items(prop, material_items);
1802 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
1803 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1805 prop= RNA_def_property(srna, "glsl_lights", PROP_BOOLEAN, PROP_NONE);
1806 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
1807 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
1808 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1810 prop= RNA_def_property(srna, "glsl_shaders", PROP_BOOLEAN, PROP_NONE);
1811 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
1812 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
1813 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1815 prop= RNA_def_property(srna, "glsl_shadows", PROP_BOOLEAN, PROP_NONE);
1816 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
1817 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
1818 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1820 prop= RNA_def_property(srna, "glsl_ramps", PROP_BOOLEAN, PROP_NONE);
1821 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
1822 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
1823 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1825 prop= RNA_def_property(srna, "glsl_nodes", PROP_BOOLEAN, PROP_NONE);
1826 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
1827 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
1828 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1830 prop= RNA_def_property(srna, "glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
1831 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
1832 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
1833 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1835 /* obstacle simulation */
1836 prop= RNA_def_property(srna, "obstacle_simulation", PROP_ENUM, PROP_NONE);
1837 RNA_def_property_enum_sdna(prop, NULL, "obstacleSimulation");
1838 RNA_def_property_enum_items(prop, obstacle_simulation_items);
1839 RNA_def_property_ui_text(prop, "Obstacle simulation", "Simulation used for obstacle avoidance in the game engine");
1840 RNA_def_property_update(prop, NC_SCENE, NULL);
1842 prop= RNA_def_property(srna, "level_height", PROP_FLOAT, PROP_ACCELERATION);
1843 RNA_def_property_float_sdna(prop, NULL, "levelHeight");
1844 RNA_def_property_range(prop, 0.0f, 200.0f);
1845 RNA_def_property_ui_text(prop, "Level height", "Max difference in heights of obstacles to enable their interaction");
1846 RNA_def_property_update(prop, NC_SCENE, NULL);
1848 /* Recast Settings */
1849 prop= RNA_def_property(srna, "recast_data", PROP_POINTER, PROP_NONE);
1850 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1851 RNA_def_property_pointer_sdna(prop, NULL, "recastData");
1852 RNA_def_property_struct_type(prop, "SceneGameRecastData");
1853 RNA_def_property_ui_text(prop, "Recast Data", "");
1856 rna_def_scene_game_recast_data(brna);
1860 static void rna_def_scene_render_layer(BlenderRNA *brna)
1864 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
1865 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
1866 RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
1868 rna_def_render_layer_common(srna, 1);
1871 static void rna_def_scene_render_data(BlenderRNA *brna)
1876 static EnumPropertyItem pixel_filter_items[] ={
1877 {R_FILTER_BOX, "BOX", 0, "Box", ""},
1878 {R_FILTER_TENT, "TENT", 0, "Tent", ""},
1879 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""},
1880 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""},
1881 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""},
1882 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""},
1883 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""},
1884 {0, NULL, 0, NULL, NULL}};
1886 static EnumPropertyItem alpha_mode_items[] ={
1887 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
1888 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
1889 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
1890 {0, NULL, 0, NULL, NULL}};
1892 static EnumPropertyItem color_mode_items[] ={
1893 {R_PLANESBW, "BW", 0, "BW", "Images are saved with BW (grayscale) data"},
1894 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
1895 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
1896 {0, NULL, 0, NULL, NULL}};
1898 static EnumPropertyItem display_mode_items[] ={
1899 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
1900 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
1901 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
1902 {0, NULL, 0, NULL, NULL}};
1905 static EnumPropertyItem bake_mode_items[] ={
1906 {RE_BAKE_ALL, "FULL", 0, "Full Render", ""},
1907 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""},
1908 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""},
1909 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""},
1910 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""},
1911 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""},
1912 {0, NULL, 0, NULL, NULL}};
1914 static EnumPropertyItem bake_normal_space_items[] ={
1915 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""},
1916 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""},
1917 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""},
1918 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
1919 {0, NULL, 0, NULL, NULL}};
1921 static EnumPropertyItem bake_qyad_split_items[] ={
1922 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
1923 {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
1924 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
1925 {0, NULL, 0, NULL, NULL}};
1927 static EnumPropertyItem octree_resolution_items[] = {
1928 {64, "64", 0, "64", ""},
1929 {128, "128", 0, "128", ""},
1930 {256, "256", 0, "256", ""},
1931 {512, "512", 0, "512", ""},
1932 {0, NULL, 0, NULL, NULL}};
1934 static EnumPropertyItem raytrace_structure_items[] = {
1935 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""},
1936 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"},
1937 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
1938 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""},
1939 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""},
1940 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""},
1941 {0, NULL, 0, NULL, NULL}
1944 static EnumPropertyItem fixed_oversample_items[] = {
1945 {5, "5", 0, "5", ""},
1946 {8, "8", 0, "8", ""},
1947 {11, "11", 0, "11", ""},
1948 {16, "16", 0, "16", ""},
1949 {0, NULL, 0, NULL, NULL}};
1951 static EnumPropertyItem field_order_items[] = {
1952 {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"},
1953 {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"},
1954 {0, NULL, 0, NULL, NULL}};
1956 static EnumPropertyItem threads_mode_items[] = {
1957 {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
1958 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
1959 {0, NULL, 0, NULL, NULL}};
1962 static EnumPropertyItem exr_codec_items[] = {
1963 {0, "NONE", 0, "None", ""},
1964 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
1965 {2, "ZIP", 0, "ZIP (lossless)", ""},
1966 {3, "PIZ", 0, "PIZ (lossless)", ""},
1967 {4, "RLE", 0, "RLE (lossless)", ""},
1968 {0, NULL, 0, NULL, NULL}};
1971 #ifdef WITH_OPENJPEG
1972 static EnumPropertyItem jp2_preset_items[] = {
1973 {0, "NO_PRESET", 0, "No Preset", ""},
1974 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
1975 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
1976 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
1977 {4, "CINE_SCOPE_48FPS", 0, "Cine-Scope 24fps 2048x858", ""},
1978 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
1979 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
1980 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
1981 {0, NULL, 0, NULL, NULL}};
1983 static EnumPropertyItem jp2_depth_items[] = {
1984 {8, "8", 0, "8", "8 bit color channels"},
1985 {12, "12", 0, "12", "12 bit color channels"},
1986 {16, "16", 0, "16", "16 bit color channels"},
1987 {0, NULL, 0, NULL, NULL}};
1990 #ifdef WITH_QUICKTIME
1991 static EnumPropertyItem quicktime_codec_type_items[] = {
1992 {0, "codec", 0, "codec", ""},
1993 {0, NULL, 0, NULL, NULL}};
1996 static EnumPropertyItem quicktime_audio_samplerate_items[] = {
1997 {22050, "22050", 0, "22kHz", ""},
1998 {44100, "44100", 0, "44.1kHz", ""},
1999 {48000, "48000", 0, "48kHz", ""},
2000 {88200, "88200", 0, "88.2kHz", ""},
2001 {96000, "96000", 0, "96kHz", ""},
2002 {192000, "192000", 0, "192kHz", ""},
2003 {0, NULL, 0, NULL, NULL}};
2005 static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
2006 {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
2007 {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
2008 {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
2009 {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
2010 {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
2011 {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
2012 {0, NULL, 0, NULL, NULL}};
2014 static EnumPropertyItem quicktime_audio_bitrate_items[] = {
2015 {64000, "64000", 0, "64kbps", ""},
2016 {112000, "112000", 0, "112kpbs", ""},
2017 {128000, "128000", 0, "128kbps", ""},
2018 {192000, "192000", 0, "192kbps", ""},
2019 {256000, "256000", 0, "256kbps", ""},
2020 {320000, "320000", 0, "320kbps", ""},
2021 {0, NULL, 0, NULL, NULL}};
2026 static EnumPropertyItem ffmpeg_format_items[] = {
2027 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
2028 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
2029 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
2030 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
2031 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
2032 {FFMPEG_DV, "DV", 0, "DV", ""},
2033 {FFMPEG_H264, "H264", 0, "H.264", ""},
2034 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
2035 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
2036 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
2037 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
2038 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
2039 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
2040 {0, NULL, 0, NULL, NULL}};
2042 static EnumPropertyItem ffmpeg_codec_items[] = {
2043 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2044 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
2045 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
2046 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
2047 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
2048 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
2049 {CODEC_ID_H264, "H264", 0, "H.264", ""},
2050 {CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
2051 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
2052 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
2053 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
2054 {0, NULL, 0, NULL, NULL}};
2056 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
2057 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2058 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
2059 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
2060 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
2061 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
2062 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
2063 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
2064 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
2065 {0, NULL, 0, NULL, NULL}};
2068 static EnumPropertyItem engine_items[] = {
2069 {0, "BLENDER_RENDER", 0, "Blender Render", ""},
2070 {0, NULL, 0, NULL, NULL}};
2072 srna= RNA_def_struct(brna, "RenderSettings", NULL);
2073 RNA_def_struct_sdna(srna, "RenderData");
2074 RNA_def_struct_nested(brna, srna, "Scene");
2075 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
2076 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
2078 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
2079 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
2080 RNA_def_property_enum_items(prop, color_mode_items);
2081 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");
2082 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2084 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
2085 RNA_def_property_int_sdna(prop, NULL, "xsch");
2086 RNA_def_property_range(prop, 4, 10000);
2087 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
2088 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2090 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
2091 RNA_def_property_int_sdna(prop, NULL, "ysch");
2092 RNA_def_property_range(prop, 4, 10000);
2093 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
2094 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2096 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
2097 RNA_def_property_int_sdna(prop, NULL, "size");
2098 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
2099 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
2100 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2102 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
2103 RNA_def_property_int_sdna(prop, NULL, "xparts");
2104 RNA_def_property_range(prop, 1, 512);
2105 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
2106 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2108 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
2109 RNA_def_property_int_sdna(prop, NULL, "yparts");
2110 RNA_def_property_range(prop, 1, 512);
2111 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
2112 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2114 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
2115 RNA_def_property_float_sdna(prop, NULL, "xasp");
2116 RNA_def_property_range(prop, 1.0f, 200.0f);
2117 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
2118 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2120 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
2121 RNA_def_property_float_sdna(prop, NULL, "yasp");
2122 RNA_def_property_range(prop, 1.0f, 200.0f);
2123 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
2124 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2126 /* JPEG and AVI JPEG */
2128 prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
2129 RNA_def_property_int_sdna(prop, NULL, "quality");
2130 RNA_def_property_range(prop, 1, 100);
2131 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies");
2132 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2136 prop= RNA_def_property(srna, "tiff_bit", PROP_BOOLEAN, PROP_NONE);
2137 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
2138 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
2139 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2141 /* Cineon and DPX */
2143 prop= RNA_def_property(srna, "cineon_log", PROP_BOOLEAN, PROP_NONE);
2144 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
2145 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
2146 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2148 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
2149 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
2150 RNA_def_property_range(prop, 0, 1024);
2151 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
2152 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2154 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
2155 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
2156 RNA_def_property_range(prop, 0, 1024);
2157 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
2158 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2160 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
2161 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
2162 RNA_def_property_range(prop, 0.0f, 10.0f);
2163 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
2164 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2169 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
2170 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
2171 RNA_def_property_enum_items(prop, exr_codec_items);
2172 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
2173 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2175 prop= RNA_def_property(srna, "exr_half", PROP_BOOLEAN, PROP_NONE);
2176 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
2177 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
2178 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2180 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
2181 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
2182 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int zbuffer)");
2183 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2185 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
2186 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
2187 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
2188 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2191 #ifdef WITH_OPENJPEG
2194 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
2195 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
2196 RNA_def_property_enum_items(prop, jp2_preset_items);
2197 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_preset_set", NULL);
2198 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
2199 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2201 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
2202 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
2203 RNA_def_property_enum_items(prop, jp2_depth_items);
2204 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_depth_set", NULL);
2205 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
2206 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2208 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
2209 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
2210 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
2211 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2214 #ifdef WITH_QUICKTIME
2217 prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
2218 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
2219 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2220 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
2221 "rna_RenderSettings_qtcodecsettings_codecType_set",
2222 "rna_RenderSettings_qtcodecsettings_codecType_itemf");
2223 RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
2224 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2226 prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
2227 RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
2228 RNA_def_property_range(prop, 0, 100);
2229 RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
2230 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2233 prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE);
2234 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType");
2235 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2236 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
2237 "rna_RenderSettings_qtcodecsettings_audiocodecType_set",
2238 "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
2239 RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
2240 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2242 prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE);
2243 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate");
2244 RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
2245 RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
2246 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2248 prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE);
2249 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth");
2250 RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
2251 RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
2252 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2254 prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
2255 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
2256 RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
2257 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2259 prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
2260 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
2261 RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
2262 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2264 prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE);
2265 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate");
2266 RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
2267 RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
2268 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2275 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
2276 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
2277 RNA_def_property_enum_items(prop, ffmpeg_format_items);
2278 RNA_def_property_ui_text(prop, "Format", "Output file format");
2279 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2281 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
2282 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
2283 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
2284 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
2285 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2287 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
2288 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
2289 RNA_def_property_range(prop, 1, 14000);
2290 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
2291 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2293 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
2294 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
2295 RNA_def_property_range(prop, 0, 9000);
2296 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
2297 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2299 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
2300 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
2301 RNA_def_property_range(prop, 1, 14000);
2302 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
2303 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2305 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
2306 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
2307 RNA_def_property_range(prop, 0, 100000000);
2308 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
2309 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2311 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
2312 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
2313 RNA_def_property_range(prop, 0, 100);
2314 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
2315 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2317 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
2318 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
2319 RNA_def_property_range(prop, 0, 2000);
2320 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
2321 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2323 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
2324 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
2325 RNA_def_property_range(prop, 0, 16384);
2326 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
2327 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2329 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
2330 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
2331 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
2332 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2335 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
2336 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
2337 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
2338 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
2339 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2341 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
2342 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
2343 RNA_def_property_range(prop, 32, 384);
2344 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
2345 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2347 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
2348 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
2349 RNA_def_property_range(prop, 8000, 192000);
2350 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
2351 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2353 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
2354 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
2355 RNA_def_property_range(prop, 0.0f, 1.0f);
2356 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
2357 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2361 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2362 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
2363 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2364 RNA_def_property_range(prop, 1, 120);
2365 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
2366 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2368 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
2369 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
2370 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2371 RNA_def_property_range(prop, 0.1f, 120.0f);
2372 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
2373 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2375 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
2376 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
2377 RNA_def_property_range(prop, 0.0f, 2.0f);
2378 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding");
2379 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2381 prop= RNA_def_property(srna, "pixel_filter", PROP_ENUM, PROP_NONE);
2382 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
2383 RNA_def_property_enum_items(prop, pixel_filter_items);
2384 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
2385 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2387 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
2388 RNA_def_property_float_sdna(prop, NULL, "gauss");
2389 RNA_def_property_range(prop, 0.5f, 1.5f);
2390 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
2391 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2393 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2394 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
2395 RNA_def_property_enum_items(prop, alpha_mode_items);
2396 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2397 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2399 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
2400 RNA_def_property_enum_sdna(prop, NULL, "ocres");
2401 RNA_def_property_enum_items(prop, octree_resolution_items);
2402 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes");
2403 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2405 prop= RNA_def_property(srna, "raytrace_structure", PROP_ENUM, PROP_NONE);
2406 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
2407 RNA_def_property_enum_items(prop, raytrace_structure_items);
2408 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
2409 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2411 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
2412 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
2413 RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates");
2414 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2416 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
2417 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
2418 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");
2419 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2421 prop= RNA_def_property(srna, "render_antialiasing", PROP_BOOLEAN, PROP_NONE);
2422 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
2423 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
2424 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2426 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
2427 RNA_def_property_enum_sdna(prop, NULL, "osa");
2428 RNA_def_property_enum_items(prop, fixed_oversample_items);
2429 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
2430 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2432 prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
2433 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
2434 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
2435 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2437 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
2438 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2439 RNA_def_property_enum_items(prop, field_order_items);
2440 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");
2441 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2443 prop= RNA_def_property(srna, "fields_still", PROP_BOOLEAN, PROP_NONE);
2444 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
2445 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
2446 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2448 /* rendering features */
2449 prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
2450 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
2451 RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
2452 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2454 prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
2455 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
2456 RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
2457 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2459 prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
2460 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
2461 RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
2462 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2464 prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
2465 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
2466 RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
2467 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2469 prop= RNA_def_property(srna, "use_raytracing", PROP_BOOLEAN, PROP_NONE);
2470 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
2471 RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
2472 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2474 prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
2475 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
2476 RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
2477 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2479 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
2480 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
2481 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
2482 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2484 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
2485 RNA_def_property_int_sdna(prop, NULL, "edgeint");
2486 RNA_def_property_range(prop, 0, 255);
2487 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
2488 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2490 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
2491 RNA_def_property_float_sdna(prop, NULL, "edgeR");
2492 RNA_def_property_array(prop, 3);
2493 RNA_def_property_ui_text(prop, "Edge Color", "");
2494 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2497 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
2498 RNA_def_property_int_sdna(prop, NULL, "threads");
2499 RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
2500 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
2501 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
2502 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2504 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
2505 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2506 RNA_def_property_enum_items(prop, threads_mode_items);
2507 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
2508 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2511 prop= RNA_def_property(srna, "motion_blur", PROP_BOOLEAN, PROP_NONE);
2512 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
2513 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
2514 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2516 prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
2517 RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
2518 RNA_def_property_range(prop, 1, 32);
2519 RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
2520 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2523 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
2524 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
2525 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");
2526 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2528 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
2529 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
2530 RNA_def_property_range(prop, 0.0f, 1.0f);
2531 RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border");
2532 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2534 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
2535 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
2536 RNA_def_property_range(prop, 0.0f, 1.0f);
2537 RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
2538 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2540 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
2541 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
2542 RNA_def_property_range(prop, 0.0f, 1.0f);
2543 RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
2544 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2546 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
2547 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
2548 RNA_def_property_range(prop, 0.0f, 1.0f);
2549 RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
2550 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2552 prop= RNA_def_property(srna, "crop_to_border", PROP_BOOLEAN, PROP_NONE);
2553 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
2554 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
2555 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2557 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
2558 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
2559 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
2560 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2562 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2563 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2564 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
2565 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2567 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
2568 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
2569 RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled");
2570 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2572 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
2573 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
2574 RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist");
2575 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2577 prop= RNA_def_property(srna, "color_management", PROP_BOOLEAN, PROP_NONE);
2578 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
2579 RNA_def_property_ui_text(prop, "Color Management", "Use color profiles and gamma corrected imaging pipeline");
2580 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_MATERIAL|ND_SHADING, "rna_RenderSettings_color_management_update");
2582 prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
2583 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
2584 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
2585 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2587 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
2588 RNA_def_property_enum_sdna(prop, NULL, "imtype");
2589 RNA_def_property_enum_items(prop, image_type_items);
2590 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
2591 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
2592 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2594 prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
2595 RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
2596 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
2597 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2599 prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
2600 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
2601 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2602 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
2604 prop= RNA_def_property(srna, "free_image_textures", PROP_BOOLEAN, PROP_NONE);
2605 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2606 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing");
2607 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2609 prop= RNA_def_property(srna, "free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
2610 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2611 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
2612 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2614 prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE);
2615 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
2616 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
2617 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)");
2618 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2620 prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE);
2621 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
2622 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
2623 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");
2624 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2626 prop= RNA_def_property(srna, "backbuf", PROP_BOOLEAN, PROP_NONE);
2627 RNA_def_property_boolean_sdna(prop, NULL, "bufflag", R_BACKBUF);
2628 RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image");
2629 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2631 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2632 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
2633 RNA_def_property_enum_items(prop, display_mode_items);
2634 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
2635 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2637 prop= RNA_def_property(srna, "output_path", PROP_STRING, PROP_DIRPATH);
2638 RNA_def_property_string_sdna(prop, NULL, "pic");
2639 RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers");
2640 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2644 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
2645 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
2646 RNA_def_property_enum_items(prop, bake_mode_items);
2647 RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
2649 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
2650 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
2651 RNA_def_property_enum_items(prop, bake_normal_space_items);
2652 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
2654 prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
2655 RNA_def_property_enum_items(prop, bake_qyad_split_items);
2656 RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
2658 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
2659 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
2660 RNA_def_property_enum_items(prop, fixed_oversample_items);
2661 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
2663 prop= RNA_def_property(srna, "bake_active", PROP_BOOLEAN, PROP_NONE);
2664 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
2665 RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
2667 prop= RNA_def_property(srna, "bake_normalized", PROP_BOOLEAN, PROP_NONE);
2668 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
2669 RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings");
2671 prop= RNA_def_property(srna, "bake_clear", PROP_BOOLEAN, PROP_NONE);
2672 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
2673 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
2675 prop= RNA_def_property(srna, "bake_enable_aa", PROP_BOOLEAN, PROP_NONE);
2676 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
2677 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
2679 prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
2680 RNA_def_property_int_sdna(prop, NULL, "bake_filter");
2681 RNA_def_property_range(prop, 0, 32);
2682 RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
2684 prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
2685 RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
2686 RNA_def_property_range(prop, 0.0, 1000.0);
2687 RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
2689 prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
2690 RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
2691 RNA_def_property_range(prop, 0.0, 1000.0);
2692 RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
2696 prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE);
2697 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
2698 RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
2699 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2701 prop= RNA_def_property(srna, "stamp_date", PROP_BOOLEAN, PROP_NONE);
2702 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
2703 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
2704 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2706 prop= RNA_def_property(srna, "stamp_frame", PROP_BOOLEAN, PROP_NONE);
2707 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
2708 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
2709 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2711 prop= RNA_def_property(srna, "stamp_camera", PROP_BOOLEAN, PROP_NONE);
2712 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
2713 RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
2714 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2716 prop= RNA_def_property(srna, "stamp_scene", PROP_BOOLEAN, PROP_NONE);
2717 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
2718 RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
2719 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2721 prop= RNA_def_property(srna, "stamp_note", PROP_BOOLEAN, PROP_NONE);
2722 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
2723 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
2724 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2726 prop= RNA_def_property(srna, "stamp_marker", PROP_BOOLEAN, PROP_NONE);
2727 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
2728 RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
2729 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2731 prop= RNA_def_property(srna, "stamp_filename", PROP_BOOLEAN, PROP_NONE);
2732 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
2733 RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
2734 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2736 prop= RNA_def_property(srna, "stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
2737 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
2738 RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
2739 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2741 prop= RNA_def_property(srna, "stamp_render_time", PROP_BOOLEAN, PROP_NONE);
2742 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
2743 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
2744 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2746 prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
2747 RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
2748 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
2749 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2751 prop= RNA_def_property(srna, "render_stamp", PROP_BOOLEAN, PROP_NONE);
2752 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
2753 RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
2754 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2756 prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
2757 RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
2758 RNA_def_property_range(prop, 8, 64);
2759 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
2760 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2762 prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
2763 RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
2764 RNA_def_property_array(prop, 4);
2765 RNA_def_property_range(prop,0.0,1.0);
2766 RNA_def_property_ui_text(prop, "Stamp Text Color", "Color to use for stamp text");
2767 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2769 prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
2770 RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
2771 RNA_def_property_array(prop, 4);
2772 RNA_def_property_range(prop,0.0,1.0);
2773 RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
2774 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2776 /* sequencer draw options */
2778 prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
2779 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV);
2780 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2782 prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
2783 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND);
2784 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2787 prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
2788 RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
2789 RNA_def_property_enum_items(prop, viewport_shading_items);
2790 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2792 prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
2793 RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
2794 RNA_def_property_enum_items(prop, viewport_shading_items);
2795 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2799 prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
2800 RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
2801 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2802 RNA_def_property_ui_text(prop, "Render Layers", "");
2804 prop= RNA_def_property(srna, "single_layer", PROP_BOOLEAN, PROP_NONE);
2805 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
2806 RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
2807 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2809 prop= RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE);
2810 RNA_def_property_int_sdna(prop, NULL, "actlay");
2811 RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
2812 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
2813 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2816 prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
2817 RNA_def_property_enum_items(prop, engine_items);
2818 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set", "rna_RenderSettings_engine_itemf");
2819 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
2820 RNA_def_property_update(prop, NC_WINDOW, NULL);
2822 prop= RNA_def_property(srna, "multiple_engines", PROP_BOOLEAN, PROP_NONE);
2823 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
2824 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2825 RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
2827 prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
2828 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
2829 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2830 RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine");
2833 prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
2834 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
2835 RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
2836 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2838 prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
2839 RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
2840 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
2841 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
2842 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2844 prop= RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
2845 RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
2846 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
2847 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2849 prop= RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
2850 RNA_def_property_int_sdna(prop, NULL, "simplify_shadowsamples");
2851 RNA_def_property_ui_range(prop, 1, 16, 1, 0);
2852 RNA_def_property_ui_text(prop, "Simplify Shadow Samples", "Global maximum shadow samples");
2853 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2855 prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
2856 RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
2857 RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor");
2858 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2860 prop= RNA_def_property(srna, "simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
2861 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
2862 RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated");
2865 RNA_api_scene_render(srna);
2869 static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
2877 RNA_def_property_srna(cprop, "SceneObjects");
2878 srna= RNA_def_struct(brna, "SceneObjects", NULL);
2879 RNA_def_struct_sdna(srna, "Scene");
2880 RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
2882 func= RNA_def_function(srna, "link", "rna_Scene_object_link");
2883 RNA_def_function_ui_description(func, "Link object to scene.");
2884 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
2885 parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
2886 RNA_def_property_flag(parm, PROP_REQUIRED);
2887 parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
2888 RNA_def_function_return(func, parm);
2890 func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
2891 RNA_def_function_ui_description(func, "Unlink object from scene.");
2892 RNA_def_function_flag(func, FUNC_USE_REPORTS);
2893 parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
2894 RNA_def_property_flag(parm, PROP_REQUIRED);
2896 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2897 RNA_def_property_struct_type(prop, "Object");
2898 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL);
2899 RNA_def_property_flag(prop, PROP_EDITABLE);
2900 RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene");
2901 /* Could call: ED_base_object_activate(C, scene->basact);
2902 * but would be a bad level call and it seems the notifier is enough */
2903 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
2908 static void rna_def_scene_bases(BlenderRNA *brna, PropertyRNA *cprop)
2913 // FunctionRNA *func;
2914 // PropertyRNA *parm;
2916 RNA_def_property_srna(cprop, "SceneBases");
2917 srna= RNA_def_struct(brna, "SceneBases", NULL);
2918 RNA_def_struct_sdna(srna, "Scene");
2919 RNA_def_struct_ui_text(srna, "Scene Bases", "Collection of scene bases");
2921 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2922 RNA_def_property_struct_type(prop, "ObjectBase");
2923 RNA_def_property_pointer_sdna(prop, NULL, "basact");
2924 RNA_def_property_flag(prop, PROP_EDITABLE);
2925 RNA_def_property_ui_text(prop, "Active Base", "Active object base in the scene");
2926 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
2929 /* scene.timeline_markers */
2930 static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
2937 RNA_def_property_srna(cprop, "TimelineMarkers");
2938 srna= RNA_def_struct(brna, "TimelineMarkers", NULL);
2939 RNA_def_struct_sdna(srna, "Scene");
2940 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
2942 func= RNA_def_function(srna, "add", "rna_TimeLine_add");
2943 RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
2944 parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
2945 RNA_def_property_flag(parm, PROP_REQUIRED);
2947 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
2948 RNA_def_function_return(func, parm);
2951 func= RNA_def_function(srna, "remove", "rna_TimeLine_remove");
2952 RNA_def_function_ui_description(func, "Remove a timeline marker.");
2953 RNA_def_function_flag(func, FUNC_USE_REPORTS);
2954 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
2955 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
2958 void RNA_def_scene(BlenderRNA *brna)
2964 static EnumPropertyItem audio_distance_model_items[] = {
2965 {0, "NONE", 0, "None", "No distance attenuation"},
2966 {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
2967 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
2968 {3, "LINEAR", 0, "Linear", "Linear distance model"},
2969 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
2970 {5, "EXPONENT", 0, "Exponent", "Exponent distance model"},
2971 {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping"},
2972 {0, NULL, 0, NULL, NULL}};
2974 static EnumPropertyItem sync_mode_items[] = {
2975 {0, "NONE", 0, "No Sync", "Do not sync, play every frame"},
2976 {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
2977 {AUDIO_SYNC, "AUDIO_SYNC", 0, "AV-sync", "Sync to audio playback, dropping frames"},
2978 {0, NULL, 0, NULL, NULL}};
2980 /* Struct definition */
2981 srna= RNA_def_struct(brna, "Scene", "ID");
2982 RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings");
2983 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
2984 RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
2986 /* Global Settings */
2987 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
2988 RNA_def_property_flag(prop, PROP_EDITABLE);
2989 RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene");
2990 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_view3d_update");
2992 prop= RNA_def_property(srna, "set", PROP_POINTER, PROP_NONE);
2993 RNA_def_property_pointer_sdna(prop, NULL, "set");
2994 RNA_def_property_struct_type(prop, "Scene");
2995 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2996 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL);
2997 RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
2998 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
3000 prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
3001 RNA_def_property_flag(prop, PROP_EDITABLE);
3002 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
3003 RNA_def_property_update(prop, NC_SCENE|NC_WORLD, NULL);
3005 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ|PROP_UNIT_LENGTH);
3006 RNA_def_property_float_sdna(prop, NULL, "cursor");
3007 RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location");
3008 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
3009 RNA_def_property_update(prop, NC_WINDOW, NULL);
3012 prop= RNA_def_property(srna, "bases", PROP_COLLECTION, PROP_NONE);
3013 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
3014 RNA_def_property_struct_type(prop, "ObjectBase");
3015 RNA_def_property_ui_text(prop, "Bases", "");
3016 rna_def_scene_bases(brna, prop);
3018 prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
3019 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
3020 RNA_def_property_struct_type(prop, "Object");
3021 RNA_def_property_ui_text(prop, "Objects", "");
3022 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0);
3023 rna_def_scene_objects(brna, prop);
3026 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
3027 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
3028 RNA_def_property_array(prop, 20);
3029 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
3030 RNA_def_property_ui_text(prop, "Layers", "Layers visible when rendering the scene");
3031 RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_view3d_update");
3033 /* Frame Range Stuff */
3034 prop= RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
3035 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3036 RNA_def_property_int_sdna(prop, NULL, "r.cfra");
3037 RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
3038 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL);
3039 RNA_def_property_ui_text(prop, "Current Frame", "");
3040 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
3041 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
3043 prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
3044 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3045 RNA_def_property_int_sdna(prop, NULL, "r.sfra");
3046 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
3047 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
3048 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
3049 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
3051 prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
3052 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3053 RNA_def_property_int_sdna(prop, NULL, "r.efra");
3054 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
3055 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
3056 RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
3057 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
3059 prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
3060 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3061 RNA_def_property_int_sdna(prop, NULL, "r.frame_step");
3062 RNA_def_property_range(prop, 0, MAXFRAME);
3063 RNA_def_property_ui_range(prop, 1, 100, 1, 0);
3064 RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
3065 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
3067 /* Preview Range (frame-range for UI playback) */
3068 prop=RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
3069 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3070 RNA_def_property_boolean_sdna(prop, NULL, "r.flag", SCER_PRV_RANGE);
3071 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_preview_range_set");
3072 RNA_def_property_ui_text(prop, "Use Preview Range", "Use an alternative start/end frame for UI playback, rather than the scene start/end frame");
3073 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
3074 RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
3076 prop= RNA_def_property(srna, "preview_range_frame_start", PROP_INT, PROP_TIME);
3077 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3078 RNA_def_property_int_sdna(prop, NULL, "r.psfra");
3079 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
3080 RNA_def_property_ui_text(prop, "Preview Range Start Frame", "Alternative start frame for UI playback");
3081 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
3083 prop= RNA_def_property(srna, "preview_range_frame_end", PROP_INT, PROP_TIME);
3084 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3085 RNA_def_property_int_sdna(prop, NULL, "r.pefra");
3086 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
3087 RNA_def_property_ui_text(prop, "Preview Range End Frame", "Alternative end frame for UI playback");
3088 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
3091 prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
3092 RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
3093 RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping");
3094 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3096 /* Animation Data (for Scene) */
3097 rna_def_animdata_common(srna);
3099 /* Readonly Properties */
3100 prop= RNA_def_property(srna, "nla_tweakmode_on", PROP_BOOLEAN, PROP_NONE);
3101 RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_NLA_EDIT_ON);
3102 RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
3103 RNA_def_property_ui_text(prop, "NLA TweakMode", "Indicates whether there is any action referenced by NLA being edited. Strictly read-only");
3104 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
3106 /* Frame dropping flag for playback and sync enum */
3107 prop= RNA_def_property(srna, "frame_drop", PROP_BOOLEAN, PROP_NONE);
3108 RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_FRAME_DROP);
3109 RNA_def_property_ui_text(prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");