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 *****
25 /** \file blender/makesrna/intern/rna_scene.c
32 #include "RNA_define.h"
33 #include "RNA_enum_types.h"
35 #include "rna_internal.h"
37 #include "DNA_group_types.h"
38 #include "DNA_modifier_types.h"
39 #include "DNA_particle_types.h"
40 #include "DNA_scene_types.h"
41 #include "DNA_userdef_types.h"
44 /* Include for Bake Options */
45 #include "RE_engine.h"
46 #include "RE_pipeline.h"
49 #include "quicktime_export.h"
50 # ifdef WITH_AUDASPACE
51 # include "AUD_Space.h"
56 #include "BKE_writeffmpeg.h"
57 #include <libavcodec/avcodec.h>
58 #include <libavformat/avformat.h>
61 #include "ED_render.h"
66 #include "BLI_threads.h"
68 EnumPropertyItem snap_target_items[] = {
69 {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
70 {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target"},
71 {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
72 {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
73 {0, NULL, 0, NULL, NULL}};
75 EnumPropertyItem proportional_falloff_items[] ={
76 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
77 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
78 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
79 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
80 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
81 {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", "Consant falloff"},
82 {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", "Random falloff"},
83 {0, NULL, 0, NULL, NULL}};
86 EnumPropertyItem proportional_editing_items[] = {
87 {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"},
88 {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"},
89 {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", "Proportional Editing using connected geometry only"},
90 {0, NULL, 0, NULL, NULL}};
92 /* keep for operators, not used here */
93 EnumPropertyItem mesh_select_mode_items[] = {
94 {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
95 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
96 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
97 {0, NULL, 0, NULL, NULL}};
99 EnumPropertyItem snap_element_items[] = {
100 {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid"},
101 {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
102 {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"},
103 {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces"},
104 {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"},
105 {0, NULL, 0, NULL, NULL}};
107 EnumPropertyItem image_type_items[] = {
108 {0, "", 0, "Image", NULL},
109 {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"},
111 {R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"},
113 {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in (old!) SGI IRIS format"},
114 {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"},
115 {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"},
117 {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", "Output image in JPEG 2000 format"},
119 {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"},
120 {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", "Output image in uncompressed Targa format"},
121 {0, "", 0, " ", NULL},
123 {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"},
124 {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", "Output image in DPX format"},
127 {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", "Output image in multilayer OpenEXR format"},
128 {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", "Output image in OpenEXR format"},
131 {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", "Output image in Radiance HDR format"},
134 {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"},
136 {0, "", 0, "Movie", NULL},
138 {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", "Output video in AVI format"}, // XXX Missing codec menu
140 {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", "Output video in AVI JPEG format"},
141 {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", "Output video in AVI Raw format"},
142 #ifdef WITH_FRAMESERVER
143 {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", "Output image to a frameserver"},
146 {R_H264, "H264", ICON_FILE_MOVIE, "H.264", "Output video in H.264 format"},
147 {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", "Output video in MPEG format"},
148 {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", "Output video in Ogg format"},
150 #ifdef WITH_QUICKTIME
152 {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"},
154 {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"},
158 {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", "Output video in Xvid format"},
160 {0, NULL, 0, NULL, NULL}};
162 EnumPropertyItem image_color_mode_items[] ={
163 {R_PLANESBW, "BW", 0, "BW", "Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)"},
164 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
165 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
166 {0, NULL, 0, NULL, NULL}};
170 #include "DNA_anim_types.h"
171 #include "DNA_node_types.h"
172 #include "DNA_object_types.h"
173 #include "DNA_mesh_types.h"
175 #include "RNA_access.h"
177 #include "MEM_guardedalloc.h"
179 #include "BLI_threads.h"
180 #include "BLI_editVert.h"
182 #include "BKE_context.h"
183 #include "BKE_global.h"
184 #include "BKE_image.h"
185 #include "BKE_main.h"
186 #include "BKE_node.h"
187 #include "BKE_pointcache.h"
188 #include "BKE_scene.h"
189 #include "BKE_depsgraph.h"
190 #include "BKE_image.h"
191 #include "BKE_mesh.h"
192 #include "BKE_sound.h"
193 #include "BKE_screen.h"
194 #include "BKE_sequencer.h"
195 #include "BKE_animsys.h"
201 #include "ED_view3d.h"
203 #include "ED_keyframing.h"
205 #include "RE_engine.h"
207 static int rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
209 Scene *scene= (Scene*)ptr->data;
212 for(base= scene->base.first; base; base= base->next) {
213 if(strncmp(base->object->id.name+2, key, sizeof(base->object->id.name)-2)==0) {
214 *r_ptr= rna_pointer_inherit_refine(ptr, &RNA_ObjectBase, base);
222 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
224 ListBaseIterator *internal= iter->internal;
226 /* we are actually iterating a Base list, so override get */
227 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
230 static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
232 Scene *scene_act= CTX_data_scene(C);
235 if (object_in_scene(ob, scene)) {
236 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\"", ob->id.name+2, scene->id.name+2);
240 base= scene_add_base(scene, ob);
243 /* this is similar to what object_add_type and add_object do */
244 base->lay= scene->lay;
246 /* when linking to an inactive scene dont touch the layer */
247 if(scene == scene_act)
250 ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
252 /* slows down importers too much, run scene.update() */
253 /* DAG_scene_sort(G.main, scene); */
255 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
260 static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
262 Base *base= object_in_scene(ob, scene);
264 BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'", ob->id.name+2, scene->id.name+2);
267 if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
268 BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink", ob->id.name+2);
271 if(scene->basact==base) {
275 BLI_remlink(&scene->base, base);
280 /* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
281 DAG_scene_sort(G.main, scene);
282 DAG_ids_flush_update(G.main, 0);
284 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
287 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
289 ToolSettings *ts = (ToolSettings*)ptr->data;
290 if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
291 ts->skgen_template = value.data;
293 ts->skgen_template = NULL;
296 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
298 Scene *scene= (Scene*)ptr->data;
299 return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
302 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
304 Scene *scene= (Scene*)ptr->data;
306 scene->basact= object_in_scene((Object*)value.data, scene);
311 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
313 Scene *scene= (Scene*)ptr->data;
314 Scene *set= (Scene*)value.data;
317 for(nested_set= set; nested_set; nested_set= nested_set->set) {
318 if(nested_set==scene)
325 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
327 Scene *scene= (Scene*)ptr->data;
329 scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
332 static void rna_Scene_view3d_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr)
334 Scene *scene= (Scene*)ptr->data;
336 BKE_screen_view3d_main_sync(&bmain->screen, scene);
339 static void rna_Scene_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
341 rna_Scene_view3d_update(bmain, scene, ptr);
342 DAG_on_visible_update(bmain, FALSE);
345 static void rna_Scene_fps_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
347 sound_update_fps(scene);
348 seq_update_sound_bounds_all(scene);
351 static void rna_Scene_listener_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
353 sound_update_scene_listener(scene);
356 static void rna_Scene_volume_set(PointerRNA *ptr, float value)
358 Scene *scene= (Scene*)(ptr->data);
360 scene->audio.volume = value;
361 if(scene->sound_scene)
362 sound_set_scene_volume(scene, value);
365 static void rna_Scene_framelen_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
367 scene->r.framelen= (float)scene->r.framapto/(float)scene->r.images;
371 static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
373 Scene *data= (Scene*)ptr->data;
375 /* if negative frames aren't allowed, then we can't use them */
376 FRAMENUMBER_MIN_CLAMP(value);
380 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
382 Scene *data= (Scene*)ptr->data;
383 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
384 CLAMP(value, MINFRAME, data->r.efra);
388 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
390 Scene *data= (Scene*)ptr->data;
391 CLAMP(value, data->r.sfra, MAXFRAME);
395 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
397 Scene *data= (Scene*)ptr->data;
400 /* copy range from scene if not set before */
401 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
402 data->r.psfra= data->r.sfra;
403 data->r.pefra= data->r.efra;
406 data->r.flag |= SCER_PRV_RANGE;
409 data->r.flag &= ~SCER_PRV_RANGE;
413 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
415 Scene *data= (Scene*)ptr->data;
417 /* check if enabled already */
418 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
419 /* set end of preview range to end frame, then clamp as per normal */
420 // TODO: or just refuse to set instead?
421 data->r.pefra= data->r.efra;
424 /* now set normally */
425 CLAMP(value, MINAFRAME, data->r.pefra);
426 data->r.psfra= value;
429 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
431 Scene *data= (Scene*)ptr->data;
433 /* check if enabled already */
434 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
435 /* set start of preview range to start frame, then clamp as per normal */
436 // TODO: or just refuse to set instead?
437 data->r.psfra= data->r.sfra;
440 /* now set normally */
441 CLAMP(value, data->r.psfra, MAXFRAME);
442 data->r.pefra= value;
445 static void rna_Scene_frame_update(Main *bmain, Scene *UNUSED(current_scene), PointerRNA *ptr)
447 Scene *scene= (Scene*)ptr->id.data;
448 sound_seek_scene(bmain, scene);
451 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
453 Scene *scene= (Scene *)ptr->data;
454 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
457 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
459 Scene *scene= (Scene *)ptr->data;
460 KeyingSet *ks= (KeyingSet*)value.data;
462 scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
465 /* get KeyingSet index stuff for list of Keying Sets editing UI
466 * - active_keyingset-1 since 0 is reserved for 'none'
467 * - don't clamp, otherwise can never set builtins types as active...
469 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
471 Scene *scene= (Scene *)ptr->data;
472 return scene->active_keyingset-1;
475 /* get KeyingSet index stuff for list of Keying Sets editing UI
476 * - value+1 since 0 is reserved for 'none'
478 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
480 Scene *scene= (Scene *)ptr->data;
481 scene->active_keyingset= value+1;
484 // XXX: evil... builtin_keyingsets is defined in keyingsets.c!
485 // TODO: make API function to retrieve this...
486 extern ListBase builtin_keyingsets;
488 static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
490 Scene *scene= (Scene*)ptr->data;
492 /* start going over the scene KeyingSets first, while we still have pointer to it
493 * but only if we have any Keying Sets to use...
495 if (scene->keyingsets.first)
496 rna_iterator_listbase_begin(iter, &scene->keyingsets, NULL);
498 rna_iterator_listbase_begin(iter, &builtin_keyingsets, NULL);
501 static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
503 ListBaseIterator *internal= iter->internal;
504 KeyingSet *ks= (KeyingSet*)internal->link;
506 /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
507 if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
508 internal->link= (Link*)builtin_keyingsets.first;
510 internal->link= (Link*)ks->next;
512 iter->valid= (internal->link != NULL);
516 static char *rna_RenderSettings_path(PointerRNA *UNUSED(ptr))
518 return BLI_sprintfN("render");
521 static int rna_RenderSettings_threads_get(PointerRNA *ptr)
523 RenderData *rd= (RenderData*)ptr->data;
525 if(rd->mode & R_FIXED_THREADS)
528 return BLI_system_thread_count();
531 static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
533 RenderData *rd= (RenderData*)ptr->data;
534 return BKE_imtype_is_movie(rd->imtype);
537 static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
539 RenderData *rd= (RenderData*)ptr->data;
540 if(rd->mode & R_BORDER)
543 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
546 static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
548 RenderData *rd= (RenderData*)ptr->data;
550 return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
553 static void rna_RenderSettings_file_format_set(PointerRNA *ptr, int value)
555 RenderData *rd= (RenderData*)ptr->data;
559 ffmpeg_verify_image_type(rd);
561 #ifdef WITH_QUICKTIME
562 quicktime_verify_image_type(rd);
566 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
568 RenderData *rd= (RenderData*)ptr->data;
571 BKE_add_image_extension(ext, rd->imtype);
575 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
577 RenderData *rd= (RenderData*)ptr->data;
578 BKE_add_image_extension(str, rd->imtype);
581 void rna_RenderSettings_jpeg2k_preset_update(RenderData *rd)
583 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
585 switch(rd->jp2_depth) {
587 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
588 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
591 switch(rd->jp2_preset) {
592 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
593 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
594 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
595 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
596 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
597 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
598 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
603 static void rna_RenderSettings_jpeg2k_preset_set(PointerRNA *ptr, int value)
605 RenderData *rd= (RenderData*)ptr->data;
606 rd->jp2_preset= value;
607 rna_RenderSettings_jpeg2k_preset_update(rd);
610 static void rna_RenderSettings_jpeg2k_depth_set(PointerRNA *ptr, int value)
612 RenderData *rd= (RenderData*)ptr->data;
613 rd->jp2_depth= value;
614 rna_RenderSettings_jpeg2k_preset_update(rd);
618 #ifdef WITH_QUICKTIME
619 static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
621 RenderData *rd= (RenderData*)ptr->data;
623 return quicktime_rnatmpvalue_from_videocodectype(rd->qtcodecsettings.codecType);
626 static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
628 RenderData *rd= (RenderData*)ptr->data;
630 rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
633 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr,
634 PropertyRNA *UNUSED(prop), int *free)
636 EnumPropertyItem *item= NULL;
637 EnumPropertyItem tmp = {0, "", 0, "", ""};
638 QuicktimeCodecTypeDesc *codecTypeDesc;
642 for(i=0;i<quicktime_get_num_videocodecs();i++) {
643 codecTypeDesc = quicktime_get_videocodecType_desc(i);
644 if (!codecTypeDesc) break;
646 tmp.value= codecTypeDesc->rnatmpvalue;
647 *((int*)id) = codecTypeDesc->codecType;
650 tmp.name= codecTypeDesc->codecName;
651 RNA_enum_item_add(&item, &totitem, &tmp);
654 RNA_enum_item_end(&item, &totitem);
661 static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
663 RenderData *rd= (RenderData*)ptr->data;
665 return quicktime_rnatmpvalue_from_audiocodectype(rd->qtcodecsettings.audiocodecType);
668 static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
670 RenderData *rd= (RenderData*)ptr->data;
672 rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
675 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr,
676 PropertyRNA *UNUSED(prop), int *free)
678 EnumPropertyItem *item= NULL;
679 EnumPropertyItem tmp = {0, "", 0, "", ""};
680 QuicktimeCodecTypeDesc *codecTypeDesc;
683 for(i=0;i<quicktime_get_num_audiocodecs();i++) {
684 codecTypeDesc = quicktime_get_audiocodecType_desc(i);
685 if (!codecTypeDesc) break;
687 tmp.value= codecTypeDesc->rnatmpvalue;
688 tmp.identifier= codecTypeDesc->codecName;
689 tmp.name= codecTypeDesc->codecName;
690 RNA_enum_item_add(&item, &totitem, &tmp);
693 RNA_enum_item_end(&item, &totitem);
701 static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
703 RenderData *rd= (RenderData*)ptr->data;
707 static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
709 RenderData *rd= (RenderData*)ptr->data;
713 static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
715 RenderData *rd= (RenderData*)ptr->data;
718 *max= BLI_countlist(&rd->layers)-1;
722 static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
724 RenderData *rd= (RenderData*)ptr->data;
725 SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
727 return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
730 static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
732 RenderData *rd= (RenderData*)ptr->data;
733 SceneRenderLayer *srl= (SceneRenderLayer*)value.data;
734 const int index= BLI_findindex(&rd->layers, srl);
735 if (index != -1) rd->actlay= index;
738 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
740 RenderData *rd= (RenderData*)ptr->data;
741 RenderEngineType *type= BLI_findlink(&R_engines, value);
744 BLI_strncpy_utf8(rd->engine, type->idname, sizeof(rd->engine));
747 static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
748 PropertyRNA *UNUSED(prop), int *free)
750 RenderEngineType *type;
751 EnumPropertyItem *item= NULL;
752 EnumPropertyItem tmp = {0, "", 0, "", ""};
755 for(type=R_engines.first; type; type=type->next, a++) {
757 tmp.identifier= type->idname;
758 tmp.name= type->name;
759 RNA_enum_item_add(&item, &totitem, &tmp);
762 RNA_enum_item_end(&item, &totitem);
768 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
770 RenderData *rd= (RenderData*)ptr->data;
771 RenderEngineType *type;
774 for(type=R_engines.first; type; type=type->next, a++)
775 if(strcmp(type->idname, rd->engine) == 0)
781 static void rna_RenderSettings_engine_update(Main *bmain, Scene *UNUSED(unused), PointerRNA *UNUSED(ptr))
783 ED_render_engine_changed(bmain);
786 static void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
788 Scene *scene= (Scene*)ptr->id.data;
790 DAG_id_tag_update(&scene->id, 0);
793 static void rna_RenderSettings_color_management_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
795 /* reset image nodes */
796 Scene *scene= (Scene*)ptr->id.data;
797 bNodeTree *ntree=scene->nodetree;
800 if(ntree && scene->use_nodes) {
801 /* XXX images are freed here, stop render and preview threads, until Image is threadsafe */
802 WM_jobs_stop_all(bmain->wm.first);
804 for (node=ntree->nodes.first; node; node=node->next) {
805 if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
806 ED_node_changed_update(&scene->id, node);
807 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
809 if (node->type == CMP_NODE_IMAGE)
810 BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
815 rna_Scene_glsl_update(bmain, scene, ptr);
818 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
820 Scene *scene= (Scene*)ptr->id.data;
821 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
822 BLI_strncpy_utf8(rl->name, value, sizeof(rl->name));
823 BLI_uniquename(&scene->r.layers, rl, "RenderLayer", '.', offsetof(SceneRenderLayer, name), sizeof(rl->name));
825 if(scene->nodetree) {
827 int index= BLI_findindex(&scene->r.layers, rl);
829 for(node= scene->nodetree->nodes.first; node; node= node->next) {
830 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
831 if(node->custom1==index)
832 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
838 static int rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr))
840 return (BLI_countlist(&R_engines) > 1);
843 static int rna_RenderSettings_use_shading_nodes_get(PointerRNA *ptr)
845 Scene *scene= (Scene*)ptr->id.data;
846 return scene_use_new_shading_nodes(scene);
849 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
851 RenderData *rd= (RenderData*)ptr->data;
852 RenderEngineType *type;
854 for(type=R_engines.first; type; type=type->next)
855 if(strcmp(type->idname, rd->engine) == 0)
856 return (type->flag & RE_GAME);
861 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
863 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
864 rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL);
867 static void rna_SceneRenderLayer_pass_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
869 Scene *scene= (Scene*)ptr->id.data;
872 ntreeCompositForceHidden(scene->nodetree, scene);
875 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
877 Scene *scene= (Scene*)ptr->data;
879 scene->use_nodes= value;
880 if(scene->use_nodes && scene->nodetree==NULL)
881 ED_node_composit_default(scene);
884 static void rna_Physics_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
886 Scene *scene= (Scene*)ptr->id.data;
889 for(base = scene->base.first; base; base=base->next)
890 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
893 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
895 Scene *scene= (Scene*)ptr->id.data;
896 ToolSettings *ts = (ToolSettings*)ptr->data;
897 int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
900 ts->selectmode = flag;
903 Mesh *me= get_mesh(scene->basact->object);
904 if(me && me->edit_mesh && me->edit_mesh->selectmode != flag) {
905 me->edit_mesh->selectmode= flag;
906 EM_selectmode_set(me->edit_mesh);
912 static void rna_Scene_editmesh_select_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
917 me= get_mesh(scene->basact->object);
918 if(me && me->edit_mesh==NULL)
922 WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
923 WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
926 static void object_simplify_update(Object *ob)
929 ParticleSystem *psys;
931 for(md=ob->modifiers.first; md; md=md->next)
932 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
933 ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
935 for(psys=ob->particlesystem.first; psys; psys=psys->next)
936 psys->recalc |= PSYS_RECALC_CHILD;
941 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
942 object_simplify_update(gob->ob);
946 static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
951 for(SETLOOPER(scene, sce_iter, base))
952 object_simplify_update(base->object);
954 DAG_ids_flush_update(bmain, 0);
955 WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
958 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
960 if(scene->r.mode & R_SIMPLIFY)
961 rna_Scene_use_simplify_update(bmain, scene, ptr);
964 static int rna_Scene_use_audio_get(PointerRNA *ptr)
966 Scene *scene= (Scene*)ptr->data;
967 return scene->audio.flag & AUDIO_MUTE;
970 static void rna_Scene_use_audio_set(PointerRNA *ptr, int value)
972 Scene *scene= (Scene*)ptr->data;
975 scene->audio.flag |= AUDIO_MUTE;
977 scene->audio.flag &= ~AUDIO_MUTE;
979 sound_mute_scene(scene, value);
982 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
984 Scene *scene= (Scene*)ptr->data;
985 if(scene->audio.flag & AUDIO_SYNC)
987 return scene->flag & SCE_FRAME_DROP;
990 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
992 Scene *scene= (Scene*)ptr->data;
994 if(value == AUDIO_SYNC)
995 scene->audio.flag |= AUDIO_SYNC;
996 else if(value == SCE_FRAME_DROP)
998 scene->audio.flag &= ~AUDIO_SYNC;
999 scene->flag |= SCE_FRAME_DROP;
1003 scene->audio.flag &= ~AUDIO_SYNC;
1004 scene->flag &= ~SCE_FRAME_DROP;
1008 static int rna_GameSettings_auto_start_get(PointerRNA *UNUSED(ptr))
1010 if (G.fileflags & G_FILE_AUTOPLAY)
1016 static void rna_GameSettings_auto_start_set(PointerRNA *UNUSED(ptr), int value)
1019 G.fileflags |= G_FILE_AUTOPLAY;
1021 G.fileflags &= ~G_FILE_AUTOPLAY;
1025 static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[])
1027 TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
1028 marker->flag= SELECT;
1030 BLI_strncpy_utf8(marker->name, name, sizeof(marker->name));
1031 BLI_addtail(&scene->markers, marker);
1035 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker)
1037 if (!BLI_remlink_safe(&scene->markers, marker)) {
1038 BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in scene '%s'", marker->name, scene->id.name+2);
1042 /* XXX, invalidates PyObject */
1046 static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, const char name[])
1048 KeyingSet *ks= NULL;
1050 /* call the API func, and set the active keyingset index */
1051 ks= BKE_keyingset_add(&sce->keyingsets, name, KEYINGSET_ABSOLUTE, 0);
1054 sce->active_keyingset= BLI_countlist(&sce->keyingsets);
1058 BKE_report(reports, RPT_ERROR, "Keying Set could not be added");
1065 /* note: without this, when Multi-Paint is activated/deactivated, the colors
1066 * will not change right away when multiple bones are selected, this function
1067 * is not for general use and only for the few cases where changing scene
1068 * settings and NOT for general purpose updates, possibly this should be
1069 * given its own notifier. */
1070 static void rna_Scene_update_active_object_data(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
1074 DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
1075 WM_main_add_notifier(NC_OBJECT|ND_DRAW, &ob->id);
1081 static void rna_def_transform_orientation(BlenderRNA *brna)
1086 const int matrix_dimsize[]= {3, 3};
1088 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
1090 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
1091 RNA_def_property_float_sdna(prop, NULL, "mat");
1092 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
1093 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1095 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1096 RNA_def_property_string_sdna(prop, NULL, "name");
1097 RNA_def_struct_name_property(srna, prop);
1098 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1101 static void rna_def_tool_settings(BlenderRNA *brna)
1106 static EnumPropertyItem uv_select_mode_items[] = {
1107 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
1108 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
1109 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
1110 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
1111 {0, NULL, 0, NULL, NULL}};
1113 /* the construction of this enum is quite special - everything is stored as bitflags,
1114 * with 1st position only for for on/off (and exposed as boolean), while others are mutually
1115 * exclusive options but which will only have any effect when autokey is enabled
1117 static EnumPropertyItem auto_key_items[] = {
1118 {AUTOKEY_MODE_NORMAL & ~AUTOKEY_ON, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
1119 {AUTOKEY_MODE_EDITKEYS & ~AUTOKEY_ON, "REPLACE_KEYS", 0, "Replace", ""},
1120 {0, NULL, 0, NULL, NULL}};
1122 static EnumPropertyItem retarget_roll_items[] = {
1123 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
1124 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
1125 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
1126 {0, NULL, 0, NULL, NULL}};
1128 static EnumPropertyItem sketch_convert_items[] = {
1129 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
1130 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
1131 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive",
1132 "Subdivide stroke adaptively, with more subdivision in curvier parts"},
1133 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
1134 {0, NULL, 0, NULL, NULL}};
1136 static EnumPropertyItem edge_tag_items[] = {
1137 {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
1138 {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
1139 {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
1140 {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
1141 {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
1142 {0, NULL, 0, NULL, NULL}};
1144 srna= RNA_def_struct(brna, "ToolSettings", NULL);
1145 RNA_def_struct_ui_text(srna, "Tool Settings", "");
1147 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
1148 RNA_def_property_struct_type(prop, "Sculpt");
1149 RNA_def_property_ui_text(prop, "Sculpt", "");
1151 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
1152 RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
1153 RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
1154 "Ensure all bone-deforming vertex groups add up "
1155 "to 1.0 while weight painting");
1156 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
1158 prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
1159 RNA_def_property_boolean_sdna(prop, NULL, "multipaint", 1);
1160 RNA_def_property_ui_text(prop, "WPaint Multi-Paint",
1161 "Paint across all selected bones while "
1163 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
1165 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
1166 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
1167 RNA_def_property_ui_text(prop, "Vertex Paint", "");
1169 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
1170 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
1171 RNA_def_property_ui_text(prop, "Weight Paint", "");
1173 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
1174 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
1175 RNA_def_property_ui_text(prop, "Image Paint", "");
1177 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
1178 RNA_def_property_pointer_sdna(prop, NULL, "particle");
1179 RNA_def_property_ui_text(prop, "Particle Edit", "");
1182 prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
1183 RNA_def_property_enum_sdna(prop, NULL, "proportional");
1184 RNA_def_property_enum_items(prop, proportional_editing_items);
1185 RNA_def_property_ui_text(prop, "Proportional Editing",
1186 "Proportional Editing mode, allows transforms with distance fall-off");
1187 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1189 prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
1190 RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
1191 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing object mode");
1192 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
1193 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1195 prop= RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
1196 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
1197 RNA_def_property_enum_items(prop, proportional_falloff_items);
1198 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
1199 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1201 prop= RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
1202 RNA_def_property_float_sdna(prop, NULL, "proportional_size");
1203 RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle");
1204 RNA_def_property_range(prop, 0.00001, 5000.0);
1206 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
1207 RNA_def_property_float_sdna(prop, NULL, "normalsize");
1208 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
1209 RNA_def_property_range(prop, 0.00001, 1000.0);
1210 RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
1211 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
1213 prop= RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
1214 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
1215 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
1217 prop= RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
1218 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
1219 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
1220 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
1221 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1223 prop= RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
1224 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
1225 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
1226 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
1227 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1229 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
1230 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
1231 RNA_def_property_enum_items(prop, snap_element_items);
1232 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
1233 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1235 prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
1236 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
1237 RNA_def_property_enum_items(prop, snap_target_items);
1238 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
1239 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1241 prop= RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
1242 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
1243 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
1244 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
1245 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1247 prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
1248 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
1249 RNA_def_property_ui_text(prop, "Project Individual Elements",
1250 "Project individual elements on the surface of other objects");
1251 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
1252 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1254 prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
1255 RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
1256 RNA_def_property_ui_text(prop, "Project to Self", "Snap onto itself (editmode)");
1257 RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
1258 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1261 prop = RNA_def_property(srna, "use_grease_pencil_sessions", PROP_BOOLEAN, PROP_NONE);
1262 RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINTSESSIONS_ON);
1263 RNA_def_property_ui_text(prop, "Use Sketching Sessions", "Allow drawing multiple strokes at a time with Grease Pencil");
1264 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); // xxx: need toolbar to be redrawn...
1267 prop= RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
1268 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
1269 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
1270 RNA_def_property_ui_icon(prop, ICON_REC, 0);
1272 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
1273 RNA_def_property_enum_bitflag_sdna(prop, NULL, "autokey_mode");
1274 RNA_def_property_enum_items(prop, auto_key_items);
1275 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
1277 prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
1278 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
1279 RNA_def_property_ui_text(prop, "Layered",
1280 "Add a new NLA Track + Strip for every loop/pass made over the animation "
1281 "to allow non-destructive tweaking");
1283 prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
1284 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
1285 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set",
1286 "Automatic keyframe insertion using active Keying Set only");
1287 RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0);
1290 prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
1291 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
1292 RNA_def_property_enum_items(prop, uv_select_mode_items);
1293 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
1294 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1296 prop= RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
1297 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
1298 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
1299 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1300 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1302 prop= RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
1303 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
1304 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
1305 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1308 prop= RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
1309 RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
1310 RNA_def_property_array(prop, 3);
1311 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
1312 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
1313 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
1315 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
1316 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
1317 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
1319 /* use with MESH_OT_select_shortest_path */
1320 prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
1321 RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
1322 RNA_def_property_enum_items(prop, edge_tag_items);
1323 RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
1325 prop= RNA_def_property(srna, "edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
1326 RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1);
1327 RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edges seam re-calculates UV unwrap");
1330 prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
1331 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
1332 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
1333 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1335 prop= RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
1336 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
1337 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
1339 prop= RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
1340 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
1341 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
1343 prop= RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
1344 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
1345 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
1347 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
1348 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1349 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
1351 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
1352 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1353 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
1355 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
1356 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
1357 RNA_def_property_flag(prop, PROP_EDITABLE);
1358 RNA_def_property_struct_type(prop, "Object");
1359 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
1360 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
1362 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
1363 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
1364 RNA_def_property_range(prop, 1, 255);
1365 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
1366 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1368 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
1369 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
1370 RNA_def_property_range(prop, 0.00001, 1.0);
1371 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
1372 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
1373 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1375 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
1376 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
1377 RNA_def_property_range(prop, 0.00001, 100000.0);
1378 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1379 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
1380 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1382 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
1383 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
1384 RNA_def_property_enum_items(prop, retarget_roll_items);
1385 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
1387 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
1388 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
1389 RNA_def_property_enum_items(prop, sketch_convert_items);
1390 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
1391 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1393 /* Sculpt/Paint Unified Size and Strength */
1395 prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
1396 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
1397 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius",
1398 "Instead of per brush radius, the radius is shared across brushes");
1400 prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
1401 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
1402 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength",
1403 "Instead of per brush strength, the strength is shared across brushes");
1407 static void rna_def_unit_settings(BlenderRNA *brna)
1412 static EnumPropertyItem unit_systems[] = {
1413 {USER_UNIT_NONE, "NONE", 0, "None", ""},
1414 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
1415 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
1416 {0, NULL, 0, NULL, NULL}};
1418 static EnumPropertyItem rotation_units[] = {
1419 {0, "DEGREES", 0, "Degrees", "Use degrees for measuring angles and rotations"},
1420 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
1421 {0, NULL, 0, NULL, NULL}};
1423 srna= RNA_def_struct(brna, "UnitSettings", NULL);
1424 RNA_def_struct_ui_text(srna, "Unit Settings", "");
1427 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
1428 RNA_def_property_enum_items(prop, unit_systems);
1429 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
1430 RNA_def_property_update(prop, NC_WINDOW, NULL);
1432 prop= RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
1433 RNA_def_property_enum_items(prop, rotation_units);
1434 RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
1435 RNA_def_property_update(prop, NC_WINDOW, NULL);
1437 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
1438 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
1439 RNA_def_property_range(prop, 0.00001, 100000.0);
1440 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1441 RNA_def_property_update(prop, NC_WINDOW, NULL);
1443 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
1444 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
1445 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs");
1446 RNA_def_property_update(prop, NC_WINDOW, NULL);
1449 void rna_def_render_layer_common(StructRNA *srna, int scene)
1453 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1454 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
1455 else RNA_def_property_string_sdna(prop, NULL, "name");
1456 RNA_def_property_ui_text(prop, "Name", "Render layer name");
1457 RNA_def_struct_name_property(srna, prop);
1458 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1459 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1461 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
1462 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
1463 RNA_def_property_struct_type(prop, "Material");
1464 RNA_def_property_flag(prop, PROP_EDITABLE);
1465 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
1466 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1467 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1469 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
1470 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
1471 RNA_def_property_struct_type(prop, "Group");
1472 RNA_def_property_flag(prop, PROP_EDITABLE);
1473 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
1474 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1475 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1478 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1479 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1480 RNA_def_property_array(prop, 20);
1481 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
1482 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
1483 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
1484 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1485 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1487 prop= RNA_def_property(srna, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
1488 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
1489 RNA_def_property_array(prop, 20);
1490 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers for solid faces");
1491 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1492 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1495 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
1496 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
1497 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
1498 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1499 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1501 prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
1502 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
1503 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
1504 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1505 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1507 prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
1508 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
1509 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
1510 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1511 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1513 prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
1514 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
1515 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
1516 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1517 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1519 prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
1520 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
1521 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
1522 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1523 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1525 prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
1526 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
1527 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
1528 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1529 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1531 prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
1532 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
1533 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (on top of Solid and Halos)");
1534 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1535 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1537 prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
1538 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
1539 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
1540 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1541 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1543 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
1544 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
1545 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
1546 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1547 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1549 prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
1550 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
1551 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
1552 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1553 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1556 prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
1557 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
1558 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
1559 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1560 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1562 prop= RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
1563 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
1564 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
1565 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1566 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1568 prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
1569 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
1570 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
1571 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1572 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1574 prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
1575 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
1576 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
1577 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1578 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1580 prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
1581 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
1582 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
1583 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1584 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1586 prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
1587 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
1588 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
1589 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1590 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1592 prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
1593 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
1594 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
1595 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1596 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1598 prop= RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
1599 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXMA);
1600 RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
1601 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1602 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1604 prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
1605 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
1606 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
1607 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1608 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1610 prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
1611 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
1612 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
1613 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1614 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1616 prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
1617 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
1618 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
1619 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1620 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1622 prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
1623 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
1624 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
1625 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1626 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1628 prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1629 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
1630 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
1631 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1632 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1634 prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
1635 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
1636 RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
1637 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1638 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1640 prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
1641 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
1642 RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
1643 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1644 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1646 prop= RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
1647 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
1648 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
1649 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1650 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1652 prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
1653 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
1654 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
1655 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1656 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1658 prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
1659 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
1660 RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
1661 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1662 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1664 prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
1665 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
1666 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
1667 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1668 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1669 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1671 prop= RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
1672 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
1673 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
1674 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1675 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1676 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1678 prop= RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1679 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
1680 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
1681 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1682 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1683 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1685 prop= RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
1686 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
1687 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
1688 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1689 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1690 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1692 prop= RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
1693 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
1694 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
1695 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1696 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1697 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1699 prop= RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
1700 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
1701 RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
1702 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1703 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1704 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1706 prop= RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
1707 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
1708 RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
1709 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1710 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1711 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1713 prop= RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
1714 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
1715 RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
1716 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1717 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1718 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1721 static void rna_def_scene_game_recast_data(BlenderRNA *brna)
1726 srna= RNA_def_struct(brna, "SceneGameRecastData", NULL);
1727 RNA_def_struct_sdna(srna, "RecastData");
1728 RNA_def_struct_nested(brna, srna, "Scene");
1729 RNA_def_struct_ui_text(srna, "Recast Data", "Recast data for a Game datablock");
1731 prop= RNA_def_property(srna, "cell_size", PROP_FLOAT, PROP_NONE);
1732 RNA_def_property_float_sdna(prop, NULL, "cellsize");
1733 RNA_def_property_ui_range(prop, 0.1, 1, 1, 2);
1734 RNA_def_property_ui_text(prop, "Cell Size", "Rasterized cell size");
1735 RNA_def_property_update(prop, NC_SCENE, NULL);
1737 prop= RNA_def_property(srna, "cell_height", PROP_FLOAT, PROP_NONE);
1738 RNA_def_property_float_sdna(prop, NULL, "cellheight");
1739 RNA_def_property_ui_range(prop, 0.1, 1, 1, 2);
1740 RNA_def_property_ui_text(prop, "Cell Height", "Rasterized cell height");
1741 RNA_def_property_update(prop, NC_SCENE, NULL);
1743 prop= RNA_def_property(srna, "agent_height", PROP_FLOAT, PROP_NONE);
1744 RNA_def_property_float_sdna(prop, NULL, "agentheight");
1745 RNA_def_property_ui_range(prop, 0.1, 5, 1, 2);
1746 RNA_def_property_ui_text(prop, "Agent Height", "Minimum height where the agent can still walk");
1747 RNA_def_property_update(prop, NC_SCENE, NULL);
1749 prop= RNA_def_property(srna, "agent_radius", PROP_FLOAT, PROP_NONE);
1750 RNA_def_property_float_sdna(prop, NULL, "agentradius");
1751 RNA_def_property_ui_range(prop, 0.1, 5, 1, 2);
1752 RNA_def_property_ui_text(prop, "Agent Radius", "Radius of the agent");
1753 RNA_def_property_update(prop, NC_SCENE, NULL);
1755 prop= RNA_def_property(srna, "climb_max", PROP_FLOAT, PROP_NONE);
1756 RNA_def_property_float_sdna(prop, NULL, "agentmaxclimb");
1757 RNA_def_property_ui_range(prop, 0.1, 5, 1, 2);
1758 RNA_def_property_ui_text(prop, "Max Climb", "Maximum height between grid cells the agent can climb");
1759 RNA_def_property_update(prop, NC_SCENE, NULL);
1761 prop= RNA_def_property(srna, "slope_max", PROP_FLOAT, PROP_ANGLE);
1762 RNA_def_property_float_sdna(prop, NULL, "agentmaxslope");
1763 RNA_def_property_range(prop, 0, M_PI/2);
1764 RNA_def_property_ui_text(prop, "Max Slope", "Maximum walkable slope angle in degrees");
1765 RNA_def_property_update(prop, NC_SCENE, NULL);
1768 prop= RNA_def_property(srna, "region_min_size", PROP_FLOAT, PROP_NONE);
1769 RNA_def_property_float_sdna(prop, NULL, "regionminsize");
1770 RNA_def_property_ui_range(prop, 0, 150, 1, 2);
1771 RNA_def_property_ui_text(prop, "Min Region Size", "Minimum regions size (smaller regions will be deleted)");
1772 RNA_def_property_update(prop, NC_SCENE, NULL);
1774 prop= RNA_def_property(srna, "region_merge_size", PROP_FLOAT, PROP_NONE);
1775 RNA_def_property_float_sdna(prop, NULL, "regionmergesize");
1776 RNA_def_property_ui_range(prop, 0, 150, 1, 2);
1777 RNA_def_property_ui_text(prop, "Merged Region Size", "Minimum regions size (smaller regions will be merged)");
1778 RNA_def_property_update(prop, NC_SCENE, NULL);
1780 prop= RNA_def_property(srna, "edge_max_len", PROP_FLOAT, PROP_NONE);
1781 RNA_def_property_float_sdna(prop, NULL, "edgemaxlen");
1782 RNA_def_property_ui_range(prop, 0, 50, 1, 2);
1783 RNA_def_property_ui_text(prop, "Max Edge Length", "Maximum contour edge length");
1784 RNA_def_property_update(prop, NC_SCENE, NULL);
1786 prop= RNA_def_property(srna, "edge_max_error", PROP_FLOAT, PROP_NONE);
1787 RNA_def_property_float_sdna(prop, NULL, "edgemaxerror");
1788 RNA_def_property_ui_range(prop, 0.1, 3.0, 1, 2);
1789 RNA_def_property_ui_text(prop, "Max Edge Error", "Maximum distance error from contour to cells");
1790 RNA_def_property_update(prop, NC_SCENE, NULL);
1792 prop= RNA_def_property(srna, "verts_per_poly", PROP_INT, PROP_NONE);
1793 RNA_def_property_int_sdna(prop, NULL, "vertsperpoly");
1794 RNA_def_property_ui_range(prop, 3, 12, 1, 0);
1795 RNA_def_property_ui_text(prop, "Verts Per Poly", "Max number of vertices per polygon");
1796 RNA_def_property_update(prop, NC_SCENE, NULL);
1798 prop= RNA_def_property(srna, "sample_dist", PROP_FLOAT, PROP_NONE);
1799 RNA_def_property_float_sdna(prop, NULL, "detailsampledist");
1800 RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2);
1801 RNA_def_property_ui_text(prop, "Sample Distance", "Detail mesh sample spacing");
1802 RNA_def_property_update(prop, NC_SCENE, NULL);
1804 prop= RNA_def_property(srna, "sample_max_error", PROP_FLOAT, PROP_NONE);
1805 RNA_def_property_float_sdna(prop, NULL, "detailsamplemaxerror");
1806 RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2);
1807 RNA_def_property_ui_text(prop, "Max Sample Error", "Detail mesh simplification max sample error");
1808 RNA_def_property_update(prop, NC_SCENE, NULL);
1811 static void rna_def_scene_game_data(BlenderRNA *brna)
1816 static EnumPropertyItem framing_types_items[] ={
1817 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox",
1818 "Show the entire viewport in the display window, using bar horizontally or vertically"},
1819 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend",
1820 "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1821 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1822 {0, NULL, 0, NULL, NULL}};
1824 static EnumPropertyItem dome_modes_items[] ={
1825 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1826 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1827 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1828 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1829 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1830 {0, NULL, 0, NULL, NULL}};
1832 static EnumPropertyItem stereo_modes_items[] ={
1833 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1834 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1835 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1836 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1837 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1838 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1839 {0, NULL, 0, NULL, NULL}};
1841 static EnumPropertyItem stereo_items[] ={
1842 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
1843 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
1844 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
1845 {0, NULL, 0, NULL, NULL}};
1847 static EnumPropertyItem physics_engine_items[] = {
1848 {WOPHY_NONE, "NONE", 0, "None", "Don't use a physics engine"},
1849 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1850 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1851 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1852 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1853 {WOPHY_BULLET, "BULLET", 0, "Bullet", "Use the Bullet physics engine"},
1854 {0, NULL, 0, NULL, NULL}};
1856 static EnumPropertyItem material_items[] ={
1857 {GAME_MAT_TEXFACE, "SINGLETEXTURE", 0, "Singletexture", "Singletexture face materials"},
1858 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
1859 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
1860 {0, NULL, 0, NULL, NULL}};
1862 static EnumPropertyItem obstacle_simulation_items[] = {
1863 {OBSTSIMULATION_NONE, "NONE", 0, "None", ""},
1864 {OBSTSIMULATION_TOI_rays, "RVO_RAYS", 0, "RVO (rays)", ""},
1865 {OBSTSIMULATION_TOI_cells, "RVO_CELLS", 0, "RVO (cells)", ""},
1866 {0, NULL, 0, NULL, NULL}};
1868 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1869 RNA_def_struct_sdna(srna, "GameData");
1870 RNA_def_struct_nested(brna, srna, "Scene");
1871 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
1873 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1874 RNA_def_property_int_sdna(prop, NULL, "xplay");
1875 RNA_def_property_range(prop, 4, 10000);
1876 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
1877 RNA_def_property_update(prop, NC_SCENE, NULL);
1879 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1880 RNA_def_property_int_sdna(prop, NULL, "yplay");
1881 RNA_def_property_range(prop, 4, 10000);
1882 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
1883 RNA_def_property_update(prop, NC_SCENE, NULL);
1885 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
1886 RNA_def_property_int_sdna(prop, NULL, "depth");
1887 RNA_def_property_range(prop, 8, 32);
1888 RNA_def_property_ui_text(prop, "Bits", "Display bit depth of full screen display");
1889 RNA_def_property_update(prop, NC_SCENE, NULL);
1891 // Do we need it here ? (since we already have it in World
1892 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1893 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1894 RNA_def_property_range(prop, 4, 2000);
1895 RNA_def_property_ui_text(prop, "Freq", "Display clock frequency of fullscreen display");
1896 RNA_def_property_update(prop, NC_SCENE, NULL);
1898 prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
1899 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1900 RNA_def_property_ui_text(prop, "Fullscreen", "Start player in a new fullscreen display");
1901 RNA_def_property_update(prop, NC_SCENE, NULL);
1904 prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
1905 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1906 RNA_def_property_enum_items(prop, framing_types_items);
1907 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
1908 RNA_def_property_update(prop, NC_SCENE, NULL);
1910 prop= RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
1911 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1912 RNA_def_property_range(prop, 0.0f, 1.0f);
1913 RNA_def_property_array(prop, 3);
1914 RNA_def_property_ui_text(prop, "Framing Color", "Set color of the bars");
1915 RNA_def_property_update(prop, NC_SCENE, NULL);
1918 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1919 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1920 RNA_def_property_enum_items(prop, stereo_items);
1921 RNA_def_property_ui_text(prop, "Stereo Options", "");
1922 RNA_def_property_update(prop, NC_SCENE, NULL);
1924 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1925 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1926 RNA_def_property_enum_items(prop, stereo_modes_items);
1927 RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
1928 RNA_def_property_update(prop, NC_SCENE, NULL);
1930 prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
1931 RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
1932 RNA_def_property_range(prop, 0.01, 5.0);
1933 RNA_def_property_ui_text(prop, "Eye Separation",
1934 "Set the distance between the eyes - the camera focal length/30 should be fine");
1935 RNA_def_property_update(prop, NC_SCENE, NULL);
1938 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1939 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1940 RNA_def_property_enum_items(prop, dome_modes_items);
1941 RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
1942 RNA_def_property_update(prop, NC_SCENE, NULL);
1944 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1945 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1946 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1947 RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
1948 RNA_def_property_update(prop, NC_SCENE, NULL);
1950 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1951 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1952 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1953 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1954 RNA_def_property_update(prop, NC_SCENE, NULL);
1956 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1957 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1958 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1959 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1960 RNA_def_property_update(prop, NC_SCENE, NULL);
1962 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1963 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1964 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1965 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1966 RNA_def_property_update(prop, NC_SCENE, NULL);
1968 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
1969 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
1970 RNA_def_property_struct_type(prop, "Text");
1971 RNA_def_property_flag(prop, PROP_EDITABLE);
1972 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
1973 RNA_def_property_update(prop, NC_SCENE, NULL);
1976 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
1977 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
1978 RNA_def_property_enum_items(prop, physics_engine_items);
1979 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
1980 RNA_def_property_update(prop, NC_SCENE, NULL);
1982 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
1983 RNA_def_property_float_sdna(prop, NULL, "gravity");
1984 RNA_def_property_ui_range(prop, 0.0, 25.0, 1, 2);
1985 RNA_def_property_range(prop, 0.0, 10000.0);
1986 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
1987 RNA_def_property_update(prop, NC_SCENE, NULL);
1989 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_INT, PROP_NONE);
1990 RNA_def_property_int_sdna(prop, NULL, "occlusionRes");
1991 RNA_def_property_range(prop, 128.0, 1024.0);
1992 RNA_def_property_ui_text(prop, "Occlusion Resolution",
1993 "Size of the occlusion buffer in pixel, use higher value for better precision (slower)");
1994 RNA_def_property_update(prop, NC_SCENE, NULL);
1996 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1997 RNA_def_property_int_sdna(prop, NULL, "ticrate");
1998 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
1999 RNA_def_property_range(prop, 1, 250);
2000 RNA_def_property_ui_text(prop, "Frames Per Second",
2001 "Nominal number of game frames per second "
2002 "(physics fixed timestep = 1/fps, independently of actual frame rate)");
2003 RNA_def_property_update(prop, NC_SCENE, NULL);
2005 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
2006 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
2007 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
2008 RNA_def_property_range(prop, 1, 5);
2009 RNA_def_property_ui_text(prop, "Max Logic Steps",
2010 "Maximum number of logic frame per game frame if graphics slows down the game, "
2011 "higher value allows better synchronization with physics");
2012 RNA_def_property_update(prop, NC_SCENE, NULL);
2014 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
2015 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
2016 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
2017 RNA_def_property_range(prop, 1, 5);
2018 RNA_def_property_ui_text(prop, "Max Physics Steps",
2019 "Maximum number of physics step per game frame if graphics slows down the game, "
2020 "higher value allows physics to keep up with realtime");
2021 RNA_def_property_update(prop, NC_SCENE, NULL);
2023 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
2024 RNA_def_property_int_sdna(prop, NULL, "physubstep");
2025 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
2026 RNA_def_property_range(prop, 1, 5);
2027 RNA_def_property_ui_text(prop, "Physics Sub Steps",
2028 "Number of simulation substep per physic timestep, "
2029 "higher value give better physics precision");
2030 RNA_def_property_update(prop, NC_SCENE, NULL);
2033 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
2034 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
2035 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
2037 // not used // deprecated !!!!!!!!!!!!!
2038 prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
2039 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
2040 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
2042 // not used // deprecated !!!!!!!!!!!!!
2043 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
2044 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
2045 RNA_def_property_range(prop, 0.0, 1000.0);
2046 RNA_def_property_ui_text(prop, "box radius",
2047 "Radius of the activity bubble, in Manhattan length "
2048 "(objects outside the box are activity-culled)");
2051 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
2052 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
2053 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
2055 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
2056 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
2057 RNA_def_property_ui_text(prop, "Show Framerate and Profile",
2058 "Show framerate and profiling information while the game runs");
2060 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
2061 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
2062 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
2064 prop= RNA_def_property(srna, "show_mouse", PROP_BOOLEAN, PROP_NONE);
2065 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_MOUSE);
2066 RNA_def_property_ui_text(prop, "Show Mouse", "Start player with a visible mouse cursor");
2068 prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
2069 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
2070 RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
2072 prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
2073 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
2074 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
2076 prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
2077 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
2078 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
2080 prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
2081 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
2082 RNA_def_property_ui_text(prop, "Record Animation", "Record animation to F-Curves");
2084 prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
2085 RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
2086 RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
2088 prop= RNA_def_property(srna, "restrict_animation_updates", PROP_BOOLEAN, PROP_NONE);
2089 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_RESTRICT_ANIM_UPDATES);
2090 RNA_def_property_ui_text(prop, "Restrict Animation Updates",
2091 "Restrict the number of animation updates to the animation FPS (this is "
2092 "better for performance, but can cause issues with smooth playback)");
2095 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
2096 RNA_def_property_enum_sdna(prop, NULL, "matmode");
2097 RNA_def_property_enum_items(prop, material_items);
2098 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
2099 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
2101 prop= RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
2102 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
2103 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
2104 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2106 prop= RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
2107 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
2108 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
2109 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2111 prop= RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
2112 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
2113 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
2114 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2116 prop= RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
2117 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
2118 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
2119 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2121 prop= RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
2122 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
2123 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
2124 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2126 prop= RNA_def_property(srna, "use_glsl_color_management", PROP_BOOLEAN, PROP_NONE);
2127 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_COLOR_MANAGEMENT);
2128 RNA_def_property_ui_text(prop, "GLSL Color Management", "Use color management for GLSL rendering");
2129 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2131 prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
2132 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
2133 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
2134 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2136 /* obstacle simulation */
2137 prop= RNA_def_property(srna, "obstacle_simulation", PROP_ENUM, PROP_NONE);
2138 RNA_def_property_enum_sdna(prop, NULL, "obstacleSimulation");
2139 RNA_def_property_enum_items(prop, obstacle_simulation_items);
2140 RNA_def_property_ui_text(prop, "Obstacle simulation", "Simulation used for obstacle avoidance in the game engine");
2141 RNA_def_property_update(prop, NC_SCENE, NULL);
2143 prop= RNA_def_property(srna, "level_height", PROP_FLOAT, PROP_ACCELERATION);
2144 RNA_def_property_float_sdna(prop, NULL, "levelHeight");
2145 RNA_def_property_range(prop, 0.0f, 200.0f);
2146 RNA_def_property_ui_text(prop, "Level height", "Max difference in heights of obstacles to enable their interaction");
2147 RNA_def_property_update(prop, NC_SCENE, NULL);
2149 prop= RNA_def_property(srna, "show_obstacle_simulation", PROP_BOOLEAN, PROP_NONE);
2150 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_OBSTACLE_SIMULATION);
2151 RNA_def_property_ui_text(prop, "Visualization", "Enable debug visualization for obstacle simulation");
2153 /* Recast Settings */
2154 prop= RNA_def_property(srna, "recast_data", PROP_POINTER, PROP_NONE);
2155 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2156 RNA_def_property_pointer_sdna(prop, NULL, "recastData");
2157 RNA_def_property_struct_type(prop, "SceneGameRecastData");
2158 RNA_def_property_ui_text(prop, "Recast Data", "");
2161 rna_def_scene_game_recast_data(brna);
2164 static void rna_def_scene_render_layer(BlenderRNA *brna)
2168 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
2169 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
2170 RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
2172 rna_def_render_layer_common(srna, 1);
2176 static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
2181 // FunctionRNA *func;
2182 // PropertyRNA *parm;
2184 RNA_def_property_srna(cprop, "RenderLayers");
2185 srna= RNA_def_struct(brna, "RenderLayers", NULL);
2186 RNA_def_struct_sdna(srna, "RenderData");
2187 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
2189 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
2190 RNA_def_property_int_sdna(prop, NULL, "actlay");
2191 RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set",
2192 "rna_RenderSettings_active_layer_index_range");
2193 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
2194 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2196 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
2197 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2198 RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get",
2199 "rna_RenderSettings_active_layer_set", NULL, NULL);
2200 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
2201 RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
2202 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2206 static void rna_def_scene_render_data(BlenderRNA *brna)
2211 static EnumPropertyItem pixel_filter_items[] ={
2212 {R_FILTER_BOX, "BOX", 0, "Box", "Use a box filter for anti-aliasing"},
2213 {R_FILTER_TENT, "TENT", 0, "Tent", "Use a tent filter for anti-aliasing"},
2214 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", "Use a quadratic filter for anti-aliasing"},
2215 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", "Use a cubic filter for anti-aliasing"},
2216 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", "Use a Catmull-Rom filter for anti-aliasing"},
2217 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", "Use a Gaussian filter for anti-aliasing"},
2218 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", "Use a Mitchell-Netravali filter for anti-aliasing"},
2219 {0, NULL, 0, NULL, NULL}};
2221 static EnumPropertyItem alpha_mode_items[] ={
2222 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
2223 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
2224 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
2225 {0, NULL, 0, NULL, NULL}};
2227 static EnumPropertyItem display_mode_items[] ={
2228 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
2229 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
2230 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
2231 {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes, optionally showing result"},
2232 {0, NULL, 0, NULL, NULL}};
2235 static EnumPropertyItem bake_mode_items[] ={
2236 {RE_BAKE_ALL, "FULL", 0, "Full Render", "Bake everything"},
2237 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"},
2238 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", "Bake shadows"},
2239 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"},
2240 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", "Bake textures"},
2241 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"},
2242 {RE_BAKE_EMIT, "EMIT", 0, "Emission", "Bake Emit values (glow)"},
2243 {RE_BAKE_ALPHA, "ALPHA", 0, "Alpha", "Bake Alpha values (transparency)"},
2244 {RE_BAKE_MIRROR_INTENSITY, "MIRROR_INTENSITY", 0, "Mirror Intensity", "Bake Mirror values"},
2245 {RE_BAKE_MIRROR_COLOR, "MIRROR_COLOR", 0, "Mirror Colors", "Bake Mirror colors"},
2246 {RE_BAKE_SPEC_INTENSITY, "SPEC_INTENSITY", 0, "Specular Intensity", "Bake Specular values"},
2247 {RE_BAKE_SPEC_COLOR, "SPEC_COLOR", 0, "Specular Colors", "Bake Specular colors"},
2248 {0, NULL, 0, NULL, NULL}};
2250 static EnumPropertyItem bake_normal_space_items[] ={
2251 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", "Bake the normals in camera space"},
2252 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", "Bake the normals in world space"},
2253 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"},
2254 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"},
2255 {0, NULL, 0, NULL, NULL}};
2257 static EnumPropertyItem bake_qyad_split_items[] ={
2258 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
2259 {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
2260 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
2261 {0, NULL, 0, NULL, NULL}};
2263 static EnumPropertyItem octree_resolution_items[] = {
2264 {64, "64", 0, "64", ""},
2265 {128, "128", 0, "128", ""},
2266 {256, "256", 0, "256", ""},
2267 {512, "512", 0, "512", ""},
2268 {0, NULL, 0, NULL, NULL}};
2270 static EnumPropertyItem raytrace_structure_items[] = {
2271 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", "Automatically select acceleration structure"},
2272 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"},
2273 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
2274 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", "Use vBVH"},
2275 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", "Use SIMD SVBVH"},
2276 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", "Use SIMD QBVH"},
2277 {0, NULL, 0, NULL, NULL}
2280 static EnumPropertyItem fixed_oversample_items[] = {
2281 {5, "5", 0, "5", ""},
2282 {8, "8", 0, "8", ""},
2283 {11, "11", 0, "11", ""},
2284 {16, "16", 0, "16", ""},
2285 {0, NULL, 0, NULL, NULL}};
2287 static EnumPropertyItem field_order_items[] = {
2288 {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"},
2289 {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"},
2290 {0, NULL, 0, NULL, NULL}};
2292 static EnumPropertyItem threads_mode_items[] = {
2293 {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
2294 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
2295 {0, NULL, 0, NULL, NULL}};
2298 static EnumPropertyItem exr_codec_items[] = {
2299 {0, "NONE", 0, "None", ""},
2300 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
2301 {2, "ZIP", 0, "ZIP (lossless)", ""},
2302 {3, "PIZ", 0, "PIZ (lossless)", ""},
2303 {4, "RLE", 0, "RLE (lossless)", ""},
2304 {0, NULL, 0, NULL, NULL}};
2307 #ifdef WITH_OPENJPEG
2308 static EnumPropertyItem jp2_preset_items[] = {
2309 {0, "NO_PRESET", 0, "No Preset", ""},
2310 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
2311 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
2312 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
2313 {4, "CINE_SCOPE_24FPS", 0, "Cine-Scope 24fps 2048x858", ""},
2314 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
2315 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
2316 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
2317 {0, NULL, 0, NULL, NULL}};
2319 static EnumPropertyItem jp2_depth_items[] = {
2320 {8, "8", 0, "8", "8 bit color channels"},
2321 {12, "12", 0, "12", "12 bit color channels"},
2322 {16, "16", 0, "16", "16 bit color channels"},
2323 {0, NULL, 0, NULL, NULL}};
2326 #ifdef WITH_QUICKTIME
2327 static EnumPropertyItem quicktime_codec_type_items[] = {
2328 {0, "codec", 0, "codec", ""},
2329 {0, NULL, 0, NULL, NULL}};
2332 static EnumPropertyItem quicktime_audio_samplerate_items[] = {
2333 {22050, "22050", 0, "22kHz", ""},
2334 {44100, "44100", 0, "44.1kHz", ""},
2335 {48000, "48000", 0, "48kHz", ""},
2336 {88200, "88200", 0, "88.2kHz", ""},
2337 {96000, "96000", 0, "96kHz", ""},
2338 {192000, "192000", 0, "192kHz", ""},
2339 {0, NULL, 0, NULL, NULL}};
2341 static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
2342 {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
2343 {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
2344 {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
2345 {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
2346 {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
2347 {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
2348 {0, NULL, 0, NULL, NULL}};
2350 static EnumPropertyItem quicktime_audio_bitrate_items[] = {
2351 {64000, "64000", 0, "64kbps", ""},
2352 {112000, "112000", 0, "112kpbs", ""},
2353 {128000, "128000", 0, "128kbps", ""},
2354 {192000, "192000", 0, "192kbps", ""},
2355 {256000, "256000", 0, "256kbps", ""},
2356 {320000, "320000", 0, "320kbps", ""},
2357 {0, NULL, 0, NULL, NULL}};
2362 static EnumPropertyItem ffmpeg_format_items[] = {
2363 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
2364 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
2365 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
2366 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
2367 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
2368 {FFMPEG_DV, "DV", 0, "DV", ""},
2369 {FFMPEG_H264, "H264", 0, "H.264", ""},
2370 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
2371 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
2372 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
2373 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
2374 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
2375 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
2376 {0, NULL, 0, NULL, NULL}};
2378 static EnumPropertyItem ffmpeg_codec_items[] = {
2379 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2380 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
2381 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
2382 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
2383 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
2384 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
2385 {CODEC_ID_H264, "H264", 0, "H.264", ""},
2386 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
2387 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
2388 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
2389 {0, NULL, 0, NULL, NULL}};
2391 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
2392 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2393 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
2394 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
2395 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
2396 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
2397 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
2398 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
2399 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
2400 {0, NULL, 0, NULL, NULL}};
2403 static EnumPropertyItem audio_channel_items[] = {
2404 {1, "MONO", 0, "Mono", "Set audio channels to mono"},
2405 {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
2406 {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
2407 {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
2408 {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
2409 {0, NULL, 0, NULL, NULL}};
2411 static EnumPropertyItem engine_items[] = {
2412 {0, "BLENDER_RENDER", 0, "Blender Render", "Use the Blender internal rendering engine for rendering"},
2413 {0, NULL, 0, NULL, NULL}};
2415 srna= RNA_def_struct(brna, "RenderSettings", NULL);
2416 RNA_def_struct_sdna(srna, "RenderData");
2417 RNA_def_struct_nested(brna, srna, "Scene");
2418 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
2419 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
2421 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
2422 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
2423 RNA_def_property_enum_items(prop, image_color_mode_items);
2424 RNA_def_property_ui_text(prop, "Color Mode",
2425 "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, "
2426 "and RGBA for saving red, green, blue and alpha channels");
2427 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2429 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
2430 RNA_def_property_int_sdna(prop, NULL, "xsch");
2431 RNA_def_property_range(prop, 4, 10000);
2432 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
2433 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2435 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
2436 RNA_def_property_int_sdna(prop, NULL, "ysch");
2437 RNA_def_property_range(prop, 4, 10000);
2438 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
2439 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2441 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
2442 RNA_def_property_int_sdna(prop, NULL, "size");
2443 RNA_def_property_range(prop, 1, SHRT_MAX);
2444 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
2445 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
2446 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2448 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
2449 RNA_def_property_int_sdna(prop, NULL, "xparts");
2450 RNA_def_property_range(prop, 1, 512);
2451 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
2452 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2454 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
2455 RNA_def_property_int_sdna(prop, NULL, "yparts");
2456 RNA_def_property_range(prop, 1, 512);
2457 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
2458 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2460 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
2461 RNA_def_property_float_sdna(prop, NULL, "xasp");
2462 RNA_def_property_range(prop, 1.0f, 200.0f);
2463 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
2464 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2466 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
2467 RNA_def_property_float_sdna(prop, NULL, "yasp");
2468 RNA_def_property_range(prop, 1.0f, 200.0f);
2469 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
2470 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2472 /* JPEG and AVI JPEG */
2474 prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
2475 RNA_def_property_int_sdna(prop, NULL, "quality");
2476 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
2477 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, compression for PNG's");
2478 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2482 prop= RNA_def_property(srna, "use_tiff_16bit", PROP_BOOLEAN, PROP_NONE);
2483 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
2484 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
2485 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2487 /* Cineon and DPX */
2489 prop= RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
2490 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
2491 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
2492 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2494 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
2495 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
2496 RNA_def_property_range(prop, 0, 1024);
2497 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
2498 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2500 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
2501 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
2502 RNA_def_property_range(prop, 0, 1024);
2503 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
2504 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2506 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
2507 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
2508 RNA_def_property_range(prop, 0.0f, 10.0f);
2509 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
2510 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2515 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
2516 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
2517 RNA_def_property_enum_items(prop, exr_codec_items);
2518 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
2519 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2521 prop= RNA_def_property(srna, "use_exr_half", PROP_BOOLEAN, PROP_NONE);
2522 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
2523 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
2524 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2526 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
2527 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
2528 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int z-buffer)");
2529 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2531 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
2532 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
2533 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
2534 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2537 #ifdef WITH_OPENJPEG
2540 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
2541 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
2542 RNA_def_property_enum_items(prop, jp2_preset_items);
2543 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_preset_set", NULL);
2544 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
2545 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2547 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
2548 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
2549 RNA_def_property_enum_items(prop, jp2_depth_items);
2550 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_depth_set", NULL);
2551 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
2552 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2554 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
2555 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
2556 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
2557 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2560 #ifdef WITH_QUICKTIME
2563 prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
2564 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
2565 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2566 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
2567 "rna_RenderSettings_qtcodecsettings_codecType_set",
2568 "rna_RenderSettings_qtcodecsettings_codecType_itemf");
2569 RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
2570 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2572 prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
2573 RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
2574 RNA_def_property_range(prop, 0, 100);
2575 RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
2576 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2579 prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE);
2580 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType");
2581 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2582 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
2583 "rna_RenderSettings_qtcodecsettings_audiocodecType_set",
2584 "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
2585 RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
2586 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2588 prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE);
2589 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate");
2590 RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
2591 RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
2592 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2594 prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE);
2595 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth");
2596 RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
2597 RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
2598 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2600 prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
2601 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
2602 RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
2603 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2605 prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
2606 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
2607 RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
2608 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2610 prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE);
2611 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate");
2612 RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
2613 RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
2614 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2621 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
2622 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
2623 RNA_def_property_enum_items(prop, ffmpeg_format_items);
2624 RNA_def_property_ui_text(prop, "Format", "Output file format");
2625 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2627 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
2628 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
2629 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
2630 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
2631 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2633 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
2634 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
2635 RNA_def_property_range(prop, 1, 14000);
2636 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate (kb/s)");
2637 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2639 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
2640 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
2641 RNA_def_property_range(prop, 0, 9000);
2642 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate (kb/s)");
2643 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2645 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
2646 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
2647 RNA_def_property_range(prop, 1, 14000);
2648 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kb/s)");
2649 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2651 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
2652 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
2653 RNA_def_property_range(prop, 0, 100000000);
2654 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
2655 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2657 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
2658 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
2659 RNA_def_property_range(prop, 0, 100);
2660 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
2661 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2663 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
2664 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
2665 RNA_def_property_range(prop, 0, 2000);
2666 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
2667 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2669 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
2670 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
2671 RNA_def_property_range(prop, 0, 16384);
2672 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
2673 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2675 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
2676 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
2677 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
2678 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2681 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
2682 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
2683 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2684 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
2685 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
2686 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2688 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
2689 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
2690 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2691 RNA_def_property_range(prop, 32, 384);
2692 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)");
2693 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2695 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
2696 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
2697 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2698 RNA_def_property_range(prop, 0.0f, 1.0f);
2699 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
2700 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2703 // the following two "ffmpeg" settings are general audio settings
2704 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
2705 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
2706 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2707 RNA_def_property_range(prop, 8000, 192000);
2708 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
2709 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2711 prop= RNA_def_property(srna, "ffmpeg_audio_channels", PROP_ENUM, PROP_NONE);
2712 RNA_def_property_enum_sdna(prop, NULL, "ffcodecdata.audio_channels");
2713 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2714 RNA_def_property_enum_items(prop, audio_channel_items);
2715 RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
2717 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2718 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
2719 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2720 RNA_def_property_range(prop, 1, 120);
2721 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
2722 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_Scene_fps_update");
2724 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
2725 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
2726 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2727 RNA_def_property_range(prop, 0.1f, 120.0f);
2728 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
2729 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_Scene_fps_update");
2732 prop= RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
2733 RNA_def_property_int_sdna(prop, NULL, "framapto");
2734 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2735 RNA_def_property_range(prop, 1, 900);
2736 RNA_def_property_ui_text(prop, "Frame Map Old", "Old mapping value in frames");
2737 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
2739 prop= RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
2740 RNA_def_property_int_sdna(prop, NULL, "images");
2741 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2742 RNA_def_property_range(prop, 1, 900);
2743 RNA_def_property_ui_text(prop, "Frame Map New", "How many frames the Map Old will last");
2744 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
2747 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
2748 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
2749 RNA_def_property_range(prop, 0.0f, 2.0f);
2750 RNA_def_property_ui_text(prop, "Dither Intensity",
2751 "Amount of dithering noise added to the rendered image to break up banding");
2752 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2754 prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
2755 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
2756 RNA_def_property_enum_items(prop, pixel_filter_items);
2757 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
2758 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2760 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
2761 RNA_def_property_float_sdna(prop, NULL, "gauss");
2762 RNA_def_property_range(prop, 0.5f, 1.5f);
2763 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
2764 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2766 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2767 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
2768 RNA_def_property_enum_items(prop, alpha_mode_items);
2769 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2770 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2772 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
2773 RNA_def_property_enum_sdna(prop, NULL, "ocres");
2774 RNA_def_property_enum_items(prop, octree_resolution_items);
2775 RNA_def_property_ui_text(prop, "Octree Resolution",
2776 "Resolution of raytrace accelerator, use higher resolutions for larger scenes");
2777 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2779 prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
2780 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
2781 RNA_def_property_enum_items(prop, raytrace_structure_items);
2782 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
2783 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2785 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
2786 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
2787 RNA_def_property_ui_text(prop, "Use Instances",
2788 "Instance support leads to effective memory reduction when using duplicates");
2789 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2791 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
2792 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
2793 RNA_def_property_ui_text(prop, "Use Local Coords",
2794 "Vertex coordinates are stored localy on each primitive "
2795 "(increases memory usage, but may have impact on speed)");
2796 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2798 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2799 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
2800 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
2801 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2803 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
2804 RNA_def_property_enum_sdna(prop, NULL, "osa");
2805 RNA_def_property_enum_items(prop, fixed_oversample_items);
2806 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
2807 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2809 prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
2810 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
2811 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
2812 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2814 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
2815 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2816 RNA_def_property_enum_items(prop, field_order_items);
2817 RNA_def_property_ui_text(prop, "Field Order",
2818 "Order of video fields (select which lines get rendered first, "
2819 "to create smooth motion for TV output)");
2820 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2822 prop= RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
2823 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
2824 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
2825 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2827 /* rendering features */
2828 prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
2829 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
2830 RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
2831 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2833 prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
2834 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
2835 RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
2836 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2838 prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
2839 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
2840 RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
2841 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2843 prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
2844 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
2845 RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
2846 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2848 prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
2849 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
2850 RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
2851 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2853 prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
2854 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
2855 RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
2856 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2858 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
2859 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
2860 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
2861 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2863 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
2864 RNA_def_property_int_sdna(prop, NULL, "edgeint");
2865 RNA_def_property_range(prop, 0, 255);
2866 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
2867 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2869 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
2870 RNA_def_property_float_sdna(prop, NULL, "edgeR");
2871 RNA_def_property_array(prop, 3);
2872 RNA_def_property_ui_text(prop, "Edge Color", "Edge color");
2873 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2876 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
2877 RNA_def_property_int_sdna(prop, NULL, "threads");
2878 RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
2879 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
2880 RNA_def_property_ui_text(prop, "Threads",
2881 "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
2882 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2884 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
2885 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2886 RNA_def_property_enum_items(prop, threads_mode_items);
2887 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
2888 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2891 prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
2892 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
2893 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
2894 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2896 prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
2897 RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
2898 RNA_def_property_range(prop, 1, 32);
2899 RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
2900 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2902 prop= RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
2903 RNA_def_property_float_sdna(prop, NULL, "blurfac");
2904 RNA_def_property_range(prop, 0.01f, 10.0f);
2905 RNA_def_property_ui_range(prop, 0.01, 2.0f, 1, 0);
2906 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
2907 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2910 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
2911 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
2912 RNA_def_property_ui_text(prop, "Border",
2913 "Render a user-defined border region, within the frame size "
2914 "(note that this disables save_buffers and full_sample)");
2915 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2917 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
2918 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
2919 RNA_def_property_range(prop, 0.0f, 1.0f);
2920 RNA_def_property_ui_text(prop, "Border Minimum X", "Minimum X value to for the render border");
2921 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2923 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
2924 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
2925 RNA_def_property_range(prop, 0.0f, 1.0f);
2926 RNA_def_property_ui_text(prop, "Border Minimum Y", "Minimum Y value for the render border");
2927 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2929 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
2930 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
2931 RNA_def_property_range(prop, 0.0f, 1.0f);
2932 RNA_def_property_ui_text(prop, "Border Maximum X", "Maximum X value for the render border");
2933 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2935 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
2936 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
2937 RNA_def_property_range(prop, 0.0f, 1.0f);
2938 RNA_def_property_ui_text(prop, "Border Maximum Y", "Maximum Y value for the render border");
2939 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2941 prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
2942 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
2943 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
2944 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2946 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
2947 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
2948 RNA_def_property_ui_text(prop, "Placeholders",
2949 "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
2950 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2952 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2953 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2954 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
2955 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2957 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
2958 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
2959 RNA_def_property_ui_text(prop, "Compositing",
2960 "Process the render result through the compositing pipeline, if compositing nodes are enabled");
2961 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2963 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
2964 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
2965 RNA_def_property_ui_text(prop, "Sequencer",
2966 "Process the render (and composited) result through the video sequence "
2967 "editor pipeline, if sequencer strips exist");
2968 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2970 prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
2971 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
2972 RNA_def_property_ui_text(prop, "Color Management", "Use linear workflow - gamma corrected imaging pipeline");
2973 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_RenderSettings_color_management_update");
2976 prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
2977 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
2978 RNA_def_property_ui_text(prop, "File Extensions",
2979 "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
2980 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2982 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
2983 RNA_def_property_enum_sdna(prop, NULL, "imtype");
2984 RNA_def_property_enum_items(prop, image_type_items);
2985 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
2986 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
2987 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2989 prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
2990 RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
2991 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
2992 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2994 prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
2995 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
2996 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2997 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
2999 prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
3000 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
3001 RNA_def_property_ui_text(prop, "Free Image Textures",
3002 "Free all image texture from memory after render, to save memory before compositing");
3003 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3005 prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
3006 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
3007 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
3008 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3010 prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
3011 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
3012 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
3013 RNA_def_property_ui_text(prop, "Save Buffers",
3014 "Save tiles for all RenderLayers and SceneNodes to files in the temp directory "
3015 "(saves memory, required for Full Sample)");
3016 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3018 prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
3019 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
3020 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
3021 RNA_def_property_ui_text(prop, "Full Sample",
3022 "Save for every anti-aliasing sample the entire RenderLayer results "
3023 "(this solves anti-aliasing issues with compositing)");
3024 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3026 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
3027 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
3028 RNA_def_property_enum_items(prop, display_mode_items);
3029 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
3030 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3032 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
3033 RNA_def_property_string_sdna(prop, NULL, "pic");
3034 RNA_def_property_ui_text(prop, "Output Path",
3035 "Directory/name to save animations, # characters defines the position "
3036 "and length of frame numbers");
3037 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3041 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
3042 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
3043 RNA_def_property_enum_items(prop, bake_mode_items);
3044 RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
3046 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
3047 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
3048 RNA_def_property_enum_items(prop, bake_normal_space_items);
3049 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
3051 prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
3052 RNA_def_property_enum_items(prop, bake_qyad_split_items);
3053 RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
3055 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
3056 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
3057 RNA_def_property_enum_items(prop, fixed_oversample_items);
3058 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
3060 prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
3061 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
3062 RNA_def_property_ui_text(prop, "Selected to Active",
3063 "Bake shading on the surface of selected objects to the active object");
3065 prop= RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
3066 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
3067 RNA_def_property_ui_text(prop, "Normalized",
3068 "With displacement normalize to the distance, with ambient occlusion "
3069 "normalize without using material settings");
3071 prop= RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
3072 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
3073 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
3075 prop= RNA_def_property(srna, "use_bake_antialiasing", PROP_BOOLEAN, PROP_NONE);
3076 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
3077 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
3079 prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
3080 RNA_def_property_int_sdna(prop, NULL, "bake_filter");
3081 RNA_def_property_range(prop, 0, 64);
3082 RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
3084 prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
3085 RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
3086 RNA_def_property_range(prop, 0.0, 1000.0);
3087 RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units)");
3089 prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
3090 RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
3091 RNA_def_property_range(prop, 0.0, 1000.0);
3092 RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
3094 prop= RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE);
3095 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_MULTIRES);
3096 RNA_def_property_ui_text(prop, "Bake from Multires", "Bake directly from multires object");
3098 prop= RNA_def_property(srna, "use_bake_lores_mesh", PROP_BOOLEAN, PROP_NONE);
3099 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_LORES_MESH);
3100 RNA_def_property_ui_text(prop, "Low Resolution Mesh", "Calculate heights against unsubdivided low resolution mesh");