2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * Contributor(s): Blender Foundation (2008).
20 * ***** END GPL LICENSE BLOCK *****
23 /** \file blender/makesrna/intern/rna_scene.c
30 #include "RNA_define.h"
31 #include "RNA_enum_types.h"
33 #include "rna_internal.h"
35 #include "DNA_group_types.h"
36 #include "DNA_modifier_types.h"
37 #include "DNA_particle_types.h"
38 #include "DNA_scene_types.h"
39 #include "DNA_userdef_types.h"
42 #include "BKE_tessmesh.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", "Constant 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;
579 BKE_add_image_extension(str, rd->imtype);
582 void rna_RenderSettings_jpeg2k_preset_update(RenderData *rd)
584 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
586 switch(rd->jp2_depth) {
588 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
589 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
592 switch(rd->jp2_preset) {
593 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
594 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
595 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
596 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
597 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
598 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
599 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
604 static void rna_RenderSettings_jpeg2k_preset_set(PointerRNA *ptr, int value)
606 RenderData *rd= (RenderData*)ptr->data;
607 rd->jp2_preset= value;
608 rna_RenderSettings_jpeg2k_preset_update(rd);
611 static void rna_RenderSettings_jpeg2k_depth_set(PointerRNA *ptr, int value)
613 RenderData *rd= (RenderData*)ptr->data;
614 rd->jp2_depth= value;
615 rna_RenderSettings_jpeg2k_preset_update(rd);
619 #ifdef WITH_QUICKTIME
620 static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
622 RenderData *rd= (RenderData*)ptr->data;
624 return quicktime_rnatmpvalue_from_videocodectype(rd->qtcodecsettings.codecType);
627 static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
629 RenderData *rd= (RenderData*)ptr->data;
631 rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
634 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr,
635 PropertyRNA *UNUSED(prop), int *free)
637 EnumPropertyItem *item= NULL;
638 EnumPropertyItem tmp = {0, "", 0, "", ""};
639 QuicktimeCodecTypeDesc *codecTypeDesc;
643 for(i=0;i<quicktime_get_num_videocodecs();i++) {
644 codecTypeDesc = quicktime_get_videocodecType_desc(i);
645 if (!codecTypeDesc) break;
647 tmp.value= codecTypeDesc->rnatmpvalue;
648 *((int*)id) = codecTypeDesc->codecType;
651 tmp.name= codecTypeDesc->codecName;
652 RNA_enum_item_add(&item, &totitem, &tmp);
655 RNA_enum_item_end(&item, &totitem);
662 static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
664 RenderData *rd= (RenderData*)ptr->data;
666 return quicktime_rnatmpvalue_from_audiocodectype(rd->qtcodecsettings.audiocodecType);
669 static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
671 RenderData *rd= (RenderData*)ptr->data;
673 rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
676 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr,
677 PropertyRNA *UNUSED(prop), int *free)
679 EnumPropertyItem *item= NULL;
680 EnumPropertyItem tmp = {0, "", 0, "", ""};
681 QuicktimeCodecTypeDesc *codecTypeDesc;
684 for(i=0;i<quicktime_get_num_audiocodecs();i++) {
685 codecTypeDesc = quicktime_get_audiocodecType_desc(i);
686 if (!codecTypeDesc) break;
688 tmp.value= codecTypeDesc->rnatmpvalue;
689 tmp.identifier= codecTypeDesc->codecName;
690 tmp.name= codecTypeDesc->codecName;
691 RNA_enum_item_add(&item, &totitem, &tmp);
694 RNA_enum_item_end(&item, &totitem);
702 static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
704 RenderData *rd= (RenderData*)ptr->data;
708 static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
710 RenderData *rd= (RenderData*)ptr->data;
714 static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
716 RenderData *rd= (RenderData*)ptr->data;
719 *max= BLI_countlist(&rd->layers)-1;
723 static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
725 RenderData *rd= (RenderData*)ptr->data;
726 SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
728 return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
731 static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
733 RenderData *rd= (RenderData*)ptr->data;
734 SceneRenderLayer *srl= (SceneRenderLayer*)value.data;
735 const int index= BLI_findindex(&rd->layers, srl);
736 if (index != -1) rd->actlay= index;
739 static SceneRenderLayer *rna_RenderLayer_new(ID *id, RenderData *UNUSED(rd), const char *name)
741 Scene *scene= (Scene *)id;
742 SceneRenderLayer *srl= scene_add_render_layer(scene, name);
744 WM_main_add_notifier(NC_SCENE|ND_RENDER_OPTIONS, NULL);
749 static void rna_RenderLayer_remove(ID *id, RenderData *UNUSED(rd), Main *bmain, ReportList *reports, SceneRenderLayer *srl)
751 Scene *scene= (Scene *)id;
753 if (!scene_remove_render_layer(bmain, scene, srl)) {
754 BKE_reportf(reports, RPT_ERROR, "RenderLayer '%s' could not be removed from scene '%s'", srl->name, scene->id.name+2);
757 WM_main_add_notifier(NC_SCENE|ND_RENDER_OPTIONS, NULL);
761 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
763 RenderData *rd= (RenderData*)ptr->data;
764 RenderEngineType *type= BLI_findlink(&R_engines, value);
767 BLI_strncpy_utf8(rd->engine, type->idname, sizeof(rd->engine));
770 static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
771 PropertyRNA *UNUSED(prop), int *free)
773 RenderEngineType *type;
774 EnumPropertyItem *item= NULL;
775 EnumPropertyItem tmp = {0, "", 0, "", ""};
778 for(type=R_engines.first; type; type=type->next, a++) {
780 tmp.identifier= type->idname;
781 tmp.name= type->name;
782 RNA_enum_item_add(&item, &totitem, &tmp);
785 RNA_enum_item_end(&item, &totitem);
791 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
793 RenderData *rd= (RenderData*)ptr->data;
794 RenderEngineType *type;
797 for(type=R_engines.first; type; type=type->next, a++)
798 if(strcmp(type->idname, rd->engine) == 0)
804 static void rna_RenderSettings_engine_update(Main *bmain, Scene *UNUSED(unused), PointerRNA *UNUSED(ptr))
806 ED_render_engine_changed(bmain);
809 static void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
811 Scene *scene= (Scene*)ptr->id.data;
813 DAG_id_tag_update(&scene->id, 0);
816 static void rna_RenderSettings_color_management_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
818 /* reset image nodes */
819 Scene *scene= (Scene*)ptr->id.data;
820 bNodeTree *ntree=scene->nodetree;
823 if(ntree && scene->use_nodes) {
824 /* XXX images are freed here, stop render and preview threads, until Image is threadsafe */
825 WM_jobs_stop_all(bmain->wm.first);
827 for (node=ntree->nodes.first; node; node=node->next) {
828 if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
829 ED_node_changed_update(&scene->id, node);
830 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
832 if (node->type == CMP_NODE_IMAGE)
833 BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
838 rna_Scene_glsl_update(bmain, scene, ptr);
841 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
843 Scene *scene= (Scene*)ptr->id.data;
844 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
845 BLI_strncpy_utf8(rl->name, value, sizeof(rl->name));
846 BLI_uniquename(&scene->r.layers, rl, "RenderLayer", '.', offsetof(SceneRenderLayer, name), sizeof(rl->name));
848 if(scene->nodetree) {
850 int index= BLI_findindex(&scene->r.layers, rl);
852 for(node= scene->nodetree->nodes.first; node; node= node->next) {
853 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
854 if(node->custom1==index)
855 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
861 static int rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr))
863 return (BLI_countlist(&R_engines) > 1);
866 static int rna_RenderSettings_use_shading_nodes_get(PointerRNA *ptr)
868 Scene *scene= (Scene*)ptr->id.data;
869 return scene_use_new_shading_nodes(scene);
872 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
874 RenderData *rd= (RenderData*)ptr->data;
875 RenderEngineType *type;
877 for(type=R_engines.first; type; type=type->next)
878 if(strcmp(type->idname, rd->engine) == 0)
879 return (type->flag & RE_GAME);
884 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
886 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
887 rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL);
890 static void rna_SceneRenderLayer_pass_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
892 Scene *scene= (Scene*)ptr->id.data;
895 ntreeCompositForceHidden(scene->nodetree, scene);
898 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
900 Scene *scene= (Scene*)ptr->data;
902 scene->use_nodes= value;
903 if(scene->use_nodes && scene->nodetree==NULL)
904 ED_node_composit_default(scene);
907 static void rna_Physics_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
909 Scene *scene= (Scene*)ptr->id.data;
912 for(base = scene->base.first; base; base=base->next)
913 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
916 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
918 Scene *scene= (Scene*)ptr->id.data;
919 ToolSettings *ts = (ToolSettings*)ptr->data;
920 int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
923 ts->selectmode = flag;
926 Mesh *me= get_mesh(scene->basact->object);
927 if(me && me->edit_btmesh && me->edit_btmesh->selectmode != flag) {
928 me->edit_btmesh->selectmode= flag;
929 EDBM_selectmode_set(me->edit_btmesh);
935 static void rna_Scene_editmesh_select_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
940 me= get_mesh(scene->basact->object);
941 if(me && me->edit_btmesh==NULL)
945 WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
946 WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
949 static void object_simplify_update(Object *ob)
952 ParticleSystem *psys;
954 for(md=ob->modifiers.first; md; md=md->next)
955 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
956 ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
958 for(psys=ob->particlesystem.first; psys; psys=psys->next)
959 psys->recalc |= PSYS_RECALC_CHILD;
964 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
965 object_simplify_update(gob->ob);
969 static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
974 for(SETLOOPER(scene, sce_iter, base))
975 object_simplify_update(base->object);
977 DAG_ids_flush_update(bmain, 0);
978 WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
981 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
983 if(scene->r.mode & R_SIMPLIFY)
984 rna_Scene_use_simplify_update(bmain, scene, ptr);
987 static int rna_Scene_use_audio_get(PointerRNA *ptr)
989 Scene *scene= (Scene*)ptr->data;
990 return scene->audio.flag & AUDIO_MUTE;
993 static void rna_Scene_use_audio_set(PointerRNA *ptr, int value)
995 Scene *scene= (Scene*)ptr->data;
998 scene->audio.flag |= AUDIO_MUTE;
1000 scene->audio.flag &= ~AUDIO_MUTE;
1002 sound_mute_scene(scene, value);
1005 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
1007 Scene *scene= (Scene*)ptr->data;
1008 if(scene->audio.flag & AUDIO_SYNC)
1010 return scene->flag & SCE_FRAME_DROP;
1013 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
1015 Scene *scene= (Scene*)ptr->data;
1017 if(value == AUDIO_SYNC)
1018 scene->audio.flag |= AUDIO_SYNC;
1019 else if(value == SCE_FRAME_DROP)
1021 scene->audio.flag &= ~AUDIO_SYNC;
1022 scene->flag |= SCE_FRAME_DROP;
1026 scene->audio.flag &= ~AUDIO_SYNC;
1027 scene->flag &= ~SCE_FRAME_DROP;
1031 static int rna_GameSettings_auto_start_get(PointerRNA *UNUSED(ptr))
1033 if (G.fileflags & G_FILE_AUTOPLAY)
1039 static void rna_GameSettings_auto_start_set(PointerRNA *UNUSED(ptr), int value)
1042 G.fileflags |= G_FILE_AUTOPLAY;
1044 G.fileflags &= ~G_FILE_AUTOPLAY;
1048 static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[])
1050 TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
1051 marker->flag= SELECT;
1053 BLI_strncpy_utf8(marker->name, name, sizeof(marker->name));
1054 BLI_addtail(&scene->markers, marker);
1058 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker)
1060 if (!BLI_remlink_safe(&scene->markers, marker)) {
1061 BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in scene '%s'", marker->name, scene->id.name+2);
1065 /* XXX, invalidates PyObject */
1069 static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, const char name[])
1071 KeyingSet *ks= NULL;
1073 /* call the API func, and set the active keyingset index */
1074 ks= BKE_keyingset_add(&sce->keyingsets, name, KEYINGSET_ABSOLUTE, 0);
1077 sce->active_keyingset= BLI_countlist(&sce->keyingsets);
1081 BKE_report(reports, RPT_ERROR, "Keying Set could not be added");
1088 /* note: without this, when Multi-Paint is activated/deactivated, the colors
1089 * will not change right away when multiple bones are selected, this function
1090 * is not for general use and only for the few cases where changing scene
1091 * settings and NOT for general purpose updates, possibly this should be
1092 * given its own notifier. */
1093 static void rna_Scene_update_active_object_data(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
1097 DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
1098 WM_main_add_notifier(NC_OBJECT|ND_DRAW, &ob->id);
1102 static void rna_SceneCamera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1104 Scene *scene= (Scene*)ptr->id.data;
1105 Object *camera= scene->camera;
1108 DAG_id_tag_update(&camera->id, 0);
1113 static void rna_def_transform_orientation(BlenderRNA *brna)
1118 const int matrix_dimsize[]= {3, 3};
1120 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
1122 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
1123 RNA_def_property_float_sdna(prop, NULL, "mat");
1124 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
1125 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1127 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1128 RNA_def_struct_name_property(srna, prop);
1129 RNA_def_property_ui_text(prop, "Name", "Name of the custom transform orientation");
1130 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1133 static void rna_def_tool_settings(BlenderRNA *brna)
1138 static EnumPropertyItem uv_select_mode_items[] = {
1139 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
1140 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
1141 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
1142 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
1143 {0, NULL, 0, NULL, NULL}};
1145 /* the construction of this enum is quite special - everything is stored as bitflags,
1146 * with 1st position only for for on/off (and exposed as boolean), while others are mutually
1147 * exclusive options but which will only have any effect when autokey is enabled
1149 static EnumPropertyItem auto_key_items[] = {
1150 {AUTOKEY_MODE_NORMAL & ~AUTOKEY_ON, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
1151 {AUTOKEY_MODE_EDITKEYS & ~AUTOKEY_ON, "REPLACE_KEYS", 0, "Replace", ""},
1152 {0, NULL, 0, NULL, NULL}};
1154 static EnumPropertyItem retarget_roll_items[] = {
1155 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
1156 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
1157 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
1158 {0, NULL, 0, NULL, NULL}};
1160 static EnumPropertyItem sketch_convert_items[] = {
1161 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
1162 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
1163 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive",
1164 "Subdivide stroke adaptively, with more subdivision in curvier parts"},
1165 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
1166 {0, NULL, 0, NULL, NULL}};
1168 static EnumPropertyItem edge_tag_items[] = {
1169 {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
1170 {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
1171 {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
1172 {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
1173 {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
1174 {0, NULL, 0, NULL, NULL}};
1176 srna= RNA_def_struct(brna, "ToolSettings", NULL);
1177 RNA_def_struct_ui_text(srna, "Tool Settings", "");
1179 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
1180 RNA_def_property_struct_type(prop, "Sculpt");
1181 RNA_def_property_ui_text(prop, "Sculpt", "");
1183 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
1184 RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
1185 RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
1186 "Ensure all bone-deforming vertex groups add up "
1187 "to 1.0 while weight painting");
1188 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
1190 prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
1191 RNA_def_property_boolean_sdna(prop, NULL, "multipaint", 1);
1192 RNA_def_property_ui_text(prop, "WPaint Multi-Paint",
1193 "Paint across all selected bones while "
1195 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
1197 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
1198 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
1199 RNA_def_property_ui_text(prop, "Vertex Paint", "");
1201 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
1202 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
1203 RNA_def_property_ui_text(prop, "Weight Paint", "");
1205 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
1206 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
1207 RNA_def_property_ui_text(prop, "Image Paint", "");
1209 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
1210 RNA_def_property_pointer_sdna(prop, NULL, "particle");
1211 RNA_def_property_ui_text(prop, "Particle Edit", "");
1214 prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
1215 RNA_def_property_enum_sdna(prop, NULL, "proportional");
1216 RNA_def_property_enum_items(prop, proportional_editing_items);
1217 RNA_def_property_ui_text(prop, "Proportional Editing",
1218 "Proportional Editing mode, allows transforms with distance fall-off");
1219 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1221 prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
1222 RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
1223 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing object mode");
1224 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
1225 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1227 prop= RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
1228 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
1229 RNA_def_property_enum_items(prop, proportional_falloff_items);
1230 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
1231 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1233 prop= RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
1234 RNA_def_property_float_sdna(prop, NULL, "proportional_size");
1235 RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle");
1236 RNA_def_property_range(prop, 0.00001, 5000.0);
1238 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
1239 RNA_def_property_float_sdna(prop, NULL, "normalsize");
1240 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
1241 RNA_def_property_range(prop, 0.00001, 1000.0);
1242 RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
1243 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
1245 prop= RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
1246 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
1247 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
1249 prop= RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
1250 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
1251 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
1252 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
1253 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1255 prop= RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
1256 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
1257 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
1258 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
1259 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1261 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
1262 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
1263 RNA_def_property_enum_items(prop, snap_element_items);
1264 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
1265 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1267 prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
1268 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
1269 RNA_def_property_enum_items(prop, snap_target_items);
1270 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
1271 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1273 prop= RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
1274 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
1275 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
1276 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
1277 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1279 prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
1280 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
1281 RNA_def_property_ui_text(prop, "Project Individual Elements",
1282 "Project individual elements on the surface of other objects");
1283 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
1284 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1286 prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
1287 RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
1288 RNA_def_property_ui_text(prop, "Project to Self", "Snap onto itself (editmode)");
1289 RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
1290 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1293 prop = RNA_def_property(srna, "use_grease_pencil_sessions", PROP_BOOLEAN, PROP_NONE);
1294 RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINTSESSIONS_ON);
1295 RNA_def_property_ui_text(prop, "Use Sketching Sessions", "Allow drawing multiple strokes at a time with Grease Pencil");
1296 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); // xxx: need toolbar to be redrawn...
1299 prop= RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
1300 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
1301 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
1302 RNA_def_property_ui_icon(prop, ICON_REC, 0);
1304 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
1305 RNA_def_property_enum_bitflag_sdna(prop, NULL, "autokey_mode");
1306 RNA_def_property_enum_items(prop, auto_key_items);
1307 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
1309 prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
1310 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
1311 RNA_def_property_ui_text(prop, "Layered",
1312 "Add a new NLA Track + Strip for every loop/pass made over the animation "
1313 "to allow non-destructive tweaking");
1315 prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
1316 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
1317 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set",
1318 "Automatic keyframe insertion using active Keying Set only");
1319 RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0);
1322 prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
1323 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
1324 RNA_def_property_enum_items(prop, uv_select_mode_items);
1325 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
1326 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1328 prop= RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
1329 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
1330 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
1331 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1332 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1334 prop= RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
1335 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
1336 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
1337 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1340 prop= RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
1341 RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
1342 RNA_def_property_array(prop, 3);
1343 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
1344 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
1345 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
1347 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
1348 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
1349 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
1351 /* use with MESH_OT_select_shortest_path */
1352 prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
1353 RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
1354 RNA_def_property_enum_items(prop, edge_tag_items);
1355 RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
1357 prop= RNA_def_property(srna, "edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
1358 RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1);
1359 RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edges seam re-calculates UV unwrap");
1362 prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
1363 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
1364 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
1365 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1367 prop= RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
1368 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
1369 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
1371 prop= RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
1372 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
1373 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
1375 prop= RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
1376 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
1377 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
1379 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
1380 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1381 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
1383 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
1384 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1385 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
1387 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
1388 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
1389 RNA_def_property_flag(prop, PROP_EDITABLE);
1390 RNA_def_property_struct_type(prop, "Object");
1391 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
1392 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
1394 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
1395 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
1396 RNA_def_property_range(prop, 1, 255);
1397 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
1398 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1400 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
1401 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
1402 RNA_def_property_range(prop, 0.00001, 1.0);
1403 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
1404 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
1405 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1407 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
1408 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
1409 RNA_def_property_range(prop, 0.00001, 100000.0);
1410 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1411 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
1412 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1414 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
1415 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
1416 RNA_def_property_enum_items(prop, retarget_roll_items);
1417 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
1419 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
1420 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
1421 RNA_def_property_enum_items(prop, sketch_convert_items);
1422 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
1423 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1425 /* Sculpt/Paint Unified Size and Strength */
1427 prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
1428 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
1429 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius",
1430 "Instead of per brush radius, the radius is shared across brushes");
1432 prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
1433 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
1434 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength",
1435 "Instead of per brush strength, the strength is shared across brushes");
1439 static void rna_def_unit_settings(BlenderRNA *brna)
1444 static EnumPropertyItem unit_systems[] = {
1445 {USER_UNIT_NONE, "NONE", 0, "None", ""},
1446 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
1447 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
1448 {0, NULL, 0, NULL, NULL}};
1450 static EnumPropertyItem rotation_units[] = {
1451 {0, "DEGREES", 0, "Degrees", "Use degrees for measuring angles and rotations"},
1452 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
1453 {0, NULL, 0, NULL, NULL}};
1455 srna= RNA_def_struct(brna, "UnitSettings", NULL);
1456 RNA_def_struct_ui_text(srna, "Unit Settings", "");
1459 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
1460 RNA_def_property_enum_items(prop, unit_systems);
1461 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
1462 RNA_def_property_update(prop, NC_WINDOW, NULL);
1464 prop= RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
1465 RNA_def_property_enum_items(prop, rotation_units);
1466 RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
1467 RNA_def_property_update(prop, NC_WINDOW, NULL);
1469 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
1470 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
1471 RNA_def_property_range(prop, 0.00001, 100000.0);
1472 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1473 RNA_def_property_update(prop, NC_WINDOW, NULL);
1475 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
1476 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
1477 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs");
1478 RNA_def_property_update(prop, NC_WINDOW, NULL);
1481 void rna_def_render_layer_common(StructRNA *srna, int scene)
1485 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1486 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
1487 else RNA_def_property_string_sdna(prop, NULL, "name");
1488 RNA_def_property_ui_text(prop, "Name", "Render layer name");
1489 RNA_def_struct_name_property(srna, prop);
1490 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1491 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1493 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
1494 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
1495 RNA_def_property_struct_type(prop, "Material");
1496 RNA_def_property_flag(prop, PROP_EDITABLE);
1497 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
1498 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1499 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1501 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
1502 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
1503 RNA_def_property_struct_type(prop, "Group");
1504 RNA_def_property_flag(prop, PROP_EDITABLE);
1505 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
1506 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1507 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1510 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1511 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1512 RNA_def_property_array(prop, 20);
1513 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
1514 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
1515 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
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, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
1520 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
1521 RNA_def_property_array(prop, 20);
1522 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers for solid faces");
1523 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1524 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1527 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
1528 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
1529 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
1530 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1531 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1533 prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
1534 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
1535 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
1536 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1537 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1539 prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
1540 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
1541 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
1542 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1543 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1545 prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
1546 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
1547 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
1548 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1549 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1551 prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
1552 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
1553 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
1554 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1555 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1557 prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
1558 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
1559 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
1560 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1561 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1563 prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
1564 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
1565 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (on top of Solid and Halos)");
1566 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1567 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1569 prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
1570 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
1571 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
1572 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1573 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1575 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
1576 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
1577 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
1578 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1579 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1581 prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
1582 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
1583 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
1584 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1585 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1588 prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
1589 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
1590 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
1591 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1592 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1594 prop= RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
1595 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
1596 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
1597 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1598 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1600 prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
1601 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
1602 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
1603 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1604 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1606 prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
1607 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
1608 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
1609 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1610 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1612 prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
1613 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
1614 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
1615 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1616 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1618 prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
1619 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
1620 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
1621 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1622 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1624 prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
1625 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
1626 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
1627 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1628 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1630 prop= RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
1631 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXMA);
1632 RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
1633 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1634 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1636 prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
1637 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
1638 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
1639 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1640 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1642 prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
1643 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
1644 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
1645 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1646 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1648 prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
1649 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
1650 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
1651 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1652 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1654 prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
1655 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
1656 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
1657 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1658 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1660 prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1661 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
1662 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
1663 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1664 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1666 prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
1667 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
1668 RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
1669 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1670 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1672 prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
1673 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
1674 RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
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, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
1679 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
1680 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
1681 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1682 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1684 prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
1685 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
1686 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
1687 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1688 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1690 prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
1691 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
1692 RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
1693 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1694 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1696 prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
1697 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
1698 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
1699 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1700 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1701 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1703 prop= RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
1704 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
1705 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
1706 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1707 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1708 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1710 prop= RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1711 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
1712 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
1713 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1714 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1715 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1717 prop= RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
1718 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
1719 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
1720 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1721 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1722 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1724 prop= RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
1725 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
1726 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
1727 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1728 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1729 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1731 prop= RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
1732 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
1733 RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
1734 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1735 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1736 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1738 prop= RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
1739 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
1740 RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
1741 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1742 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1743 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1745 prop= RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
1746 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
1747 RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
1748 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1749 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1750 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1753 static void rna_def_scene_game_recast_data(BlenderRNA *brna)
1758 srna= RNA_def_struct(brna, "SceneGameRecastData", NULL);
1759 RNA_def_struct_sdna(srna, "RecastData");
1760 RNA_def_struct_nested(brna, srna, "Scene");
1761 RNA_def_struct_ui_text(srna, "Recast Data", "Recast data for a Game datablock");
1763 prop= RNA_def_property(srna, "cell_size", PROP_FLOAT, PROP_NONE);
1764 RNA_def_property_float_sdna(prop, NULL, "cellsize");
1765 RNA_def_property_ui_range(prop, 0.1, 1, 1, 2);
1766 RNA_def_property_ui_text(prop, "Cell Size", "Rasterized cell size");
1767 RNA_def_property_update(prop, NC_SCENE, NULL);
1769 prop= RNA_def_property(srna, "cell_height", PROP_FLOAT, PROP_NONE);
1770 RNA_def_property_float_sdna(prop, NULL, "cellheight");
1771 RNA_def_property_ui_range(prop, 0.1, 1, 1, 2);
1772 RNA_def_property_ui_text(prop, "Cell Height", "Rasterized cell height");
1773 RNA_def_property_update(prop, NC_SCENE, NULL);
1775 prop= RNA_def_property(srna, "agent_height", PROP_FLOAT, PROP_NONE);
1776 RNA_def_property_float_sdna(prop, NULL, "agentheight");
1777 RNA_def_property_ui_range(prop, 0.1, 5, 1, 2);
1778 RNA_def_property_ui_text(prop, "Agent Height", "Minimum height where the agent can still walk");
1779 RNA_def_property_update(prop, NC_SCENE, NULL);
1781 prop= RNA_def_property(srna, "agent_radius", PROP_FLOAT, PROP_NONE);
1782 RNA_def_property_float_sdna(prop, NULL, "agentradius");
1783 RNA_def_property_ui_range(prop, 0.1, 5, 1, 2);
1784 RNA_def_property_ui_text(prop, "Agent Radius", "Radius of the agent");
1785 RNA_def_property_update(prop, NC_SCENE, NULL);
1787 prop= RNA_def_property(srna, "climb_max", PROP_FLOAT, PROP_NONE);
1788 RNA_def_property_float_sdna(prop, NULL, "agentmaxclimb");
1789 RNA_def_property_ui_range(prop, 0.1, 5, 1, 2);
1790 RNA_def_property_ui_text(prop, "Max Climb", "Maximum height between grid cells the agent can climb");
1791 RNA_def_property_update(prop, NC_SCENE, NULL);
1793 prop= RNA_def_property(srna, "slope_max", PROP_FLOAT, PROP_ANGLE);
1794 RNA_def_property_float_sdna(prop, NULL, "agentmaxslope");
1795 RNA_def_property_range(prop, 0, M_PI/2);
1796 RNA_def_property_ui_text(prop, "Max Slope", "Maximum walkable slope angle in degrees");
1797 RNA_def_property_update(prop, NC_SCENE, NULL);
1800 prop= RNA_def_property(srna, "region_min_size", PROP_FLOAT, PROP_NONE);
1801 RNA_def_property_float_sdna(prop, NULL, "regionminsize");
1802 RNA_def_property_ui_range(prop, 0, 150, 1, 2);
1803 RNA_def_property_ui_text(prop, "Min Region Size", "Minimum regions size (smaller regions will be deleted)");
1804 RNA_def_property_update(prop, NC_SCENE, NULL);
1806 prop= RNA_def_property(srna, "region_merge_size", PROP_FLOAT, PROP_NONE);
1807 RNA_def_property_float_sdna(prop, NULL, "regionmergesize");
1808 RNA_def_property_ui_range(prop, 0, 150, 1, 2);
1809 RNA_def_property_ui_text(prop, "Merged Region Size", "Minimum regions size (smaller regions will be merged)");
1810 RNA_def_property_update(prop, NC_SCENE, NULL);
1812 prop= RNA_def_property(srna, "edge_max_len", PROP_FLOAT, PROP_NONE);
1813 RNA_def_property_float_sdna(prop, NULL, "edgemaxlen");
1814 RNA_def_property_ui_range(prop, 0, 50, 1, 2);
1815 RNA_def_property_ui_text(prop, "Max Edge Length", "Maximum contour edge length");
1816 RNA_def_property_update(prop, NC_SCENE, NULL);
1818 prop= RNA_def_property(srna, "edge_max_error", PROP_FLOAT, PROP_NONE);
1819 RNA_def_property_float_sdna(prop, NULL, "edgemaxerror");
1820 RNA_def_property_ui_range(prop, 0.1, 3.0, 1, 2);
1821 RNA_def_property_ui_text(prop, "Max Edge Error", "Maximum distance error from contour to cells");
1822 RNA_def_property_update(prop, NC_SCENE, NULL);
1824 prop= RNA_def_property(srna, "verts_per_poly", PROP_INT, PROP_NONE);
1825 RNA_def_property_int_sdna(prop, NULL, "vertsperpoly");
1826 RNA_def_property_ui_range(prop, 3, 12, 1, 0);
1827 RNA_def_property_ui_text(prop, "Verts Per Poly", "Max number of vertices per polygon");
1828 RNA_def_property_update(prop, NC_SCENE, NULL);
1830 prop= RNA_def_property(srna, "sample_dist", PROP_FLOAT, PROP_NONE);
1831 RNA_def_property_float_sdna(prop, NULL, "detailsampledist");
1832 RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2);
1833 RNA_def_property_ui_text(prop, "Sample Distance", "Detail mesh sample spacing");
1834 RNA_def_property_update(prop, NC_SCENE, NULL);
1836 prop= RNA_def_property(srna, "sample_max_error", PROP_FLOAT, PROP_NONE);
1837 RNA_def_property_float_sdna(prop, NULL, "detailsamplemaxerror");
1838 RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2);
1839 RNA_def_property_ui_text(prop, "Max Sample Error", "Detail mesh simplification max sample error");
1840 RNA_def_property_update(prop, NC_SCENE, NULL);
1843 static void rna_def_scene_game_data(BlenderRNA *brna)
1848 static EnumPropertyItem framing_types_items[] ={
1849 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox",
1850 "Show the entire viewport in the display window, using bar horizontally or vertically"},
1851 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend",
1852 "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1853 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1854 {0, NULL, 0, NULL, NULL}};
1856 static EnumPropertyItem dome_modes_items[] ={
1857 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1858 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1859 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1860 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1861 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1862 {0, NULL, 0, NULL, NULL}};
1864 static EnumPropertyItem stereo_modes_items[] ={
1865 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1866 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1867 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1868 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1869 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1870 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1871 {0, NULL, 0, NULL, NULL}};
1873 static EnumPropertyItem stereo_items[] ={
1874 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
1875 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
1876 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
1877 {0, NULL, 0, NULL, NULL}};
1879 static EnumPropertyItem physics_engine_items[] = {
1880 {WOPHY_NONE, "NONE", 0, "None", "Don't use a physics engine"},
1881 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1882 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1883 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1884 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1885 {WOPHY_BULLET, "BULLET", 0, "Bullet", "Use the Bullet physics engine"},
1886 {0, NULL, 0, NULL, NULL}};
1888 static EnumPropertyItem material_items[] ={
1889 {GAME_MAT_TEXFACE, "SINGLETEXTURE", 0, "Singletexture", "Singletexture face materials"},
1890 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
1891 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
1892 {0, NULL, 0, NULL, NULL}};
1894 static EnumPropertyItem obstacle_simulation_items[] = {
1895 {OBSTSIMULATION_NONE, "NONE", 0, "None", ""},
1896 {OBSTSIMULATION_TOI_rays, "RVO_RAYS", 0, "RVO (rays)", ""},
1897 {OBSTSIMULATION_TOI_cells, "RVO_CELLS", 0, "RVO (cells)", ""},
1898 {0, NULL, 0, NULL, NULL}};
1900 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1901 RNA_def_struct_sdna(srna, "GameData");
1902 RNA_def_struct_nested(brna, srna, "Scene");
1903 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
1905 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1906 RNA_def_property_int_sdna(prop, NULL, "xplay");
1907 RNA_def_property_range(prop, 4, 10000);
1908 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
1909 RNA_def_property_update(prop, NC_SCENE, NULL);
1911 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1912 RNA_def_property_int_sdna(prop, NULL, "yplay");
1913 RNA_def_property_range(prop, 4, 10000);
1914 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
1915 RNA_def_property_update(prop, NC_SCENE, NULL);
1917 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
1918 RNA_def_property_int_sdna(prop, NULL, "depth");
1919 RNA_def_property_range(prop, 8, 32);
1920 RNA_def_property_ui_text(prop, "Bits", "Display bit depth of full screen display");
1921 RNA_def_property_update(prop, NC_SCENE, NULL);
1923 // Do we need it here ? (since we already have it in World
1924 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1925 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1926 RNA_def_property_range(prop, 4, 2000);
1927 RNA_def_property_ui_text(prop, "Freq", "Display clock frequency of fullscreen display");
1928 RNA_def_property_update(prop, NC_SCENE, NULL);
1930 prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
1931 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1932 RNA_def_property_ui_text(prop, "Fullscreen", "Start player in a new fullscreen display");
1933 RNA_def_property_update(prop, NC_SCENE, NULL);
1936 prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
1937 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1938 RNA_def_property_enum_items(prop, framing_types_items);
1939 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
1940 RNA_def_property_update(prop, NC_SCENE, NULL);
1942 prop= RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
1943 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1944 RNA_def_property_range(prop, 0.0f, 1.0f);
1945 RNA_def_property_array(prop, 3);
1946 RNA_def_property_ui_text(prop, "Framing Color", "Set color of the bars");
1947 RNA_def_property_update(prop, NC_SCENE, NULL);
1950 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1951 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1952 RNA_def_property_enum_items(prop, stereo_items);
1953 RNA_def_property_ui_text(prop, "Stereo Options", "");
1954 RNA_def_property_update(prop, NC_SCENE, NULL);
1956 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1957 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1958 RNA_def_property_enum_items(prop, stereo_modes_items);
1959 RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
1960 RNA_def_property_update(prop, NC_SCENE, NULL);
1962 prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
1963 RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
1964 RNA_def_property_range(prop, 0.01, 5.0);
1965 RNA_def_property_ui_text(prop, "Eye Separation",
1966 "Set the distance between the eyes - the camera focal length/30 should be fine");
1967 RNA_def_property_update(prop, NC_SCENE, NULL);
1970 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1971 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1972 RNA_def_property_enum_items(prop, dome_modes_items);
1973 RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
1974 RNA_def_property_update(prop, NC_SCENE, NULL);
1976 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1977 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1978 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1979 RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
1980 RNA_def_property_update(prop, NC_SCENE, NULL);
1982 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1983 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1984 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1985 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1986 RNA_def_property_update(prop, NC_SCENE, NULL);
1988 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1989 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1990 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1991 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1992 RNA_def_property_update(prop, NC_SCENE, NULL);
1994 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1995 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1996 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1997 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1998 RNA_def_property_update(prop, NC_SCENE, NULL);
2000 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
2001 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
2002 RNA_def_property_struct_type(prop, "Text");
2003 RNA_def_property_flag(prop, PROP_EDITABLE);
2004 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
2005 RNA_def_property_update(prop, NC_SCENE, NULL);
2008 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
2009 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
2010 RNA_def_property_enum_items(prop, physics_engine_items);
2011 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
2012 RNA_def_property_update(prop, NC_SCENE, NULL);
2014 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
2015 RNA_def_property_float_sdna(prop, NULL, "gravity");
2016 RNA_def_property_ui_range(prop, 0.0, 25.0, 1, 2);
2017 RNA_def_property_range(prop, 0.0, 10000.0);
2018 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
2019 RNA_def_property_update(prop, NC_SCENE, NULL);
2021 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_INT, PROP_NONE);
2022 RNA_def_property_int_sdna(prop, NULL, "occlusionRes");
2023 RNA_def_property_range(prop, 128.0, 1024.0);
2024 RNA_def_property_ui_text(prop, "Occlusion Resolution",
2025 "Size of the occlusion buffer in pixel, use higher value for better precision (slower)");
2026 RNA_def_property_update(prop, NC_SCENE, NULL);
2028 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2029 RNA_def_property_int_sdna(prop, NULL, "ticrate");
2030 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
2031 RNA_def_property_range(prop, 1, 250);
2032 RNA_def_property_ui_text(prop, "Frames Per Second",
2033 "Nominal number of game frames per second "
2034 "(physics fixed timestep = 1/fps, independently of actual frame rate)");
2035 RNA_def_property_update(prop, NC_SCENE, NULL);
2037 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
2038 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
2039 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
2040 RNA_def_property_range(prop, 1, 5);
2041 RNA_def_property_ui_text(prop, "Max Logic Steps",
2042 "Maximum number of logic frame per game frame if graphics slows down the game, "
2043 "higher value allows better synchronization with physics");
2044 RNA_def_property_update(prop, NC_SCENE, NULL);
2046 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
2047 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
2048 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
2049 RNA_def_property_range(prop, 1, 5);
2050 RNA_def_property_ui_text(prop, "Max Physics Steps",
2051 "Maximum number of physics step per game frame if graphics slows down the game, "
2052 "higher value allows physics to keep up with realtime");
2053 RNA_def_property_update(prop, NC_SCENE, NULL);
2055 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
2056 RNA_def_property_int_sdna(prop, NULL, "physubstep");
2057 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
2058 RNA_def_property_range(prop, 1, 5);
2059 RNA_def_property_ui_text(prop, "Physics Sub Steps",
2060 "Number of simulation substep per physic timestep, "
2061 "higher value give better physics precision");
2062 RNA_def_property_update(prop, NC_SCENE, NULL);
2065 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
2066 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
2067 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
2069 // not used // deprecated !!!!!!!!!!!!!
2070 prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
2071 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
2072 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
2074 // not used // deprecated !!!!!!!!!!!!!
2075 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
2076 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
2077 RNA_def_property_range(prop, 0.0, 1000.0);
2078 RNA_def_property_ui_text(prop, "box radius",
2079 "Radius of the activity bubble, in Manhattan length "
2080 "(objects outside the box are activity-culled)");
2083 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
2084 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
2085 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
2087 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
2088 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
2089 RNA_def_property_ui_text(prop, "Show Framerate and Profile",
2090 "Show framerate and profiling information while the game runs");
2092 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
2093 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
2094 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
2096 prop= RNA_def_property(srna, "show_mouse", PROP_BOOLEAN, PROP_NONE);
2097 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_MOUSE);
2098 RNA_def_property_ui_text(prop, "Show Mouse", "Start player with a visible mouse cursor");
2100 prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
2101 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
2102 RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
2104 prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
2105 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
2106 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
2108 prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
2109 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
2110 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
2112 prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
2113 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
2114 RNA_def_property_ui_text(prop, "Record Animation", "Record animation to F-Curves");
2116 prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
2117 RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
2118 RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
2120 prop= RNA_def_property(srna, "restrict_animation_updates", PROP_BOOLEAN, PROP_NONE);
2121 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_RESTRICT_ANIM_UPDATES);
2122 RNA_def_property_ui_text(prop, "Restrict Animation Updates",
2123 "Restrict the number of animation updates to the animation FPS (this is "
2124 "better for performance, but can cause issues with smooth playback)");
2127 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
2128 RNA_def_property_enum_sdna(prop, NULL, "matmode");
2129 RNA_def_property_enum_items(prop, material_items);
2130 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
2131 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
2133 prop= RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
2134 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
2135 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
2136 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2138 prop= RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
2139 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
2140 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
2141 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2143 prop= RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
2144 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
2145 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
2146 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2148 prop= RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
2149 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
2150 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
2151 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2153 prop= RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
2154 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
2155 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
2156 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2158 prop= RNA_def_property(srna, "use_glsl_color_management", PROP_BOOLEAN, PROP_NONE);
2159 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_COLOR_MANAGEMENT);
2160 RNA_def_property_ui_text(prop, "GLSL Color Management", "Use color management for GLSL rendering");
2161 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2163 prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
2164 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
2165 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
2166 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
2168 /* obstacle simulation */
2169 prop= RNA_def_property(srna, "obstacle_simulation", PROP_ENUM, PROP_NONE);
2170 RNA_def_property_enum_sdna(prop, NULL, "obstacleSimulation");
2171 RNA_def_property_enum_items(prop, obstacle_simulation_items);
2172 RNA_def_property_ui_text(prop, "Obstacle simulation", "Simulation used for obstacle avoidance in the game engine");
2173 RNA_def_property_update(prop, NC_SCENE, NULL);
2175 prop= RNA_def_property(srna, "level_height", PROP_FLOAT, PROP_ACCELERATION);
2176 RNA_def_property_float_sdna(prop, NULL, "levelHeight");
2177 RNA_def_property_range(prop, 0.0f, 200.0f);
2178 RNA_def_property_ui_text(prop, "Level height", "Max difference in heights of obstacles to enable their interaction");
2179 RNA_def_property_update(prop, NC_SCENE, NULL);
2181 prop= RNA_def_property(srna, "show_obstacle_simulation", PROP_BOOLEAN, PROP_NONE);
2182 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_OBSTACLE_SIMULATION);
2183 RNA_def_property_ui_text(prop, "Visualization", "Enable debug visualization for obstacle simulation");
2185 /* Recast Settings */
2186 prop= RNA_def_property(srna, "recast_data", PROP_POINTER, PROP_NONE);
2187 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2188 RNA_def_property_pointer_sdna(prop, NULL, "recastData");
2189 RNA_def_property_struct_type(prop, "SceneGameRecastData");
2190 RNA_def_property_ui_text(prop, "Recast Data", "");
2193 rna_def_scene_game_recast_data(brna);
2196 static void rna_def_scene_render_layer(BlenderRNA *brna)
2200 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
2201 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
2202 RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
2204 rna_def_render_layer_common(srna, 1);
2208 static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
2216 RNA_def_property_srna(cprop, "RenderLayers");
2217 srna= RNA_def_struct(brna, "RenderLayers", NULL);
2218 RNA_def_struct_sdna(srna, "RenderData");
2219 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
2221 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
2222 RNA_def_property_int_sdna(prop, NULL, "actlay");
2223 RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set",
2224 "rna_RenderSettings_active_layer_index_range");
2225 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
2226 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2228 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
2229 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2230 RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get",
2231 "rna_RenderSettings_active_layer_set", NULL, NULL);
2232 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
2233 RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
2234 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2236 func= RNA_def_function(srna, "new", "rna_RenderLayer_new");
2237 RNA_def_function_ui_description(func, "Add a render layer to scene");
2238 RNA_def_function_flag(func, FUNC_USE_SELF_ID);
2239 parm= RNA_def_string(func, "name", "RenderLayer", 0, "", "New name for the marker (not unique)");
2240 RNA_def_property_flag(parm, PROP_REQUIRED);
2241 parm= RNA_def_pointer(func, "result", "SceneRenderLayer", "", "Newly created render layer");
2242 RNA_def_function_return(func, parm);
2244 func= RNA_def_function(srna, "remove", "rna_RenderLayer_remove");
2245 RNA_def_function_ui_description(func, "Remove a render layer");
2246 RNA_def_function_flag(func, FUNC_USE_MAIN|FUNC_USE_REPORTS|FUNC_USE_SELF_ID);
2247 parm= RNA_def_pointer(func, "layer", "SceneRenderLayer", "", "Timeline marker to remove");
2248 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
2251 static void rna_def_scene_render_data(BlenderRNA *brna)
2256 static EnumPropertyItem pixel_filter_items[] ={
2257 {R_FILTER_BOX, "BOX", 0, "Box", "Use a box filter for anti-aliasing"},
2258 {R_FILTER_TENT, "TENT", 0, "Tent", "Use a tent filter for anti-aliasing"},
2259 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", "Use a quadratic filter for anti-aliasing"},
2260 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", "Use a cubic filter for anti-aliasing"},
2261 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", "Use a Catmull-Rom filter for anti-aliasing"},
2262 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", "Use a Gaussian filter for anti-aliasing"},
2263 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", "Use a Mitchell-Netravali filter for anti-aliasing"},
2264 {0, NULL, 0, NULL, NULL}};
2266 static EnumPropertyItem alpha_mode_items[] ={
2267 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
2268 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
2269 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
2270 {0, NULL, 0, NULL, NULL}};
2272 static EnumPropertyItem display_mode_items[] ={
2273 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
2274 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
2275 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
2276 {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes, optionally showing result"},
2277 {0, NULL, 0, NULL, NULL}};
2280 static EnumPropertyItem bake_mode_items[] ={
2281 {RE_BAKE_ALL, "FULL", 0, "Full Render", "Bake everything"},
2282 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"},
2283 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", "Bake shadows"},
2284 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"},
2285 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", "Bake textures"},
2286 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"},
2287 {RE_BAKE_EMIT, "EMIT", 0, "Emission", "Bake Emit values (glow)"},
2288 {RE_BAKE_ALPHA, "ALPHA", 0, "Alpha", "Bake Alpha values (transparency)"},
2289 {RE_BAKE_MIRROR_INTENSITY, "MIRROR_INTENSITY", 0, "Mirror Intensity", "Bake Mirror values"},
2290 {RE_BAKE_MIRROR_COLOR, "MIRROR_COLOR", 0, "Mirror Colors", "Bake Mirror colors"},
2291 {RE_BAKE_SPEC_INTENSITY, "SPEC_INTENSITY", 0, "Specular Intensity", "Bake Specular values"},
2292 {RE_BAKE_SPEC_COLOR, "SPEC_COLOR", 0, "Specular Colors", "Bake Specular colors"},
2293 {0, NULL, 0, NULL, NULL}};
2295 static EnumPropertyItem bake_normal_space_items[] ={
2296 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", "Bake the normals in camera space"},
2297 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", "Bake the normals in world space"},
2298 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"},
2299 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"},
2300 {0, NULL, 0, NULL, NULL}};
2302 static EnumPropertyItem bake_qyad_split_items[] ={
2303 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
2304 {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
2305 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
2306 {0, NULL, 0, NULL, NULL}};
2308 static EnumPropertyItem octree_resolution_items[] = {
2309 {64, "64", 0, "64", ""},
2310 {128, "128", 0, "128", ""},
2311 {256, "256", 0, "256", ""},
2312 {512, "512", 0, "512", ""},
2313 {0, NULL, 0, NULL, NULL}};
2315 static EnumPropertyItem raytrace_structure_items[] = {
2316 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", "Automatically select acceleration structure"},
2317 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"},
2318 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
2319 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", "Use vBVH"},
2320 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", "Use SIMD SVBVH"},
2321 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", "Use SIMD QBVH"},
2322 {0, NULL, 0, NULL, NULL}
2325 static EnumPropertyItem fixed_oversample_items[] = {
2326 {5, "5", 0, "5", ""},
2327 {8, "8", 0, "8", ""},
2328 {11, "11", 0, "11", ""},
2329 {16, "16", 0, "16", ""},
2330 {0, NULL, 0, NULL, NULL}};
2332 static EnumPropertyItem field_order_items[] = {
2333 {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"},
2334 {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"},
2335 {0, NULL, 0, NULL, NULL}};
2337 static EnumPropertyItem threads_mode_items[] = {
2338 {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
2339 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
2340 {0, NULL, 0, NULL, NULL}};
2343 static EnumPropertyItem exr_codec_items[] = {
2344 {0, "NONE", 0, "None", ""},
2345 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
2346 {2, "ZIP", 0, "ZIP (lossless)", ""},
2347 {3, "PIZ", 0, "PIZ (lossless)", ""},
2348 {4, "RLE", 0, "RLE (lossless)", ""},
2349 {0, NULL, 0, NULL, NULL}};
2352 #ifdef WITH_OPENJPEG
2353 static EnumPropertyItem jp2_preset_items[] = {
2354 {0, "NO_PRESET", 0, "No Preset", ""},
2355 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
2356 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
2357 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
2358 {4, "CINE_SCOPE_24FPS", 0, "Cine-Scope 24fps 2048x858", ""},
2359 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
2360 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
2361 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
2362 {0, NULL, 0, NULL, NULL}};
2364 static EnumPropertyItem jp2_depth_items[] = {
2365 {8, "8", 0, "8", "8 bit color channels"},
2366 {12, "12", 0, "12", "12 bit color channels"},
2367 {16, "16", 0, "16", "16 bit color channels"},
2368 {0, NULL, 0, NULL, NULL}};
2371 #ifdef WITH_QUICKTIME
2372 static EnumPropertyItem quicktime_codec_type_items[] = {
2373 {0, "codec", 0, "codec", ""},
2374 {0, NULL, 0, NULL, NULL}};
2377 static EnumPropertyItem quicktime_audio_samplerate_items[] = {
2378 {22050, "22050", 0, "22kHz", ""},
2379 {44100, "44100", 0, "44.1kHz", ""},
2380 {48000, "48000", 0, "48kHz", ""},
2381 {88200, "88200", 0, "88.2kHz", ""},
2382 {96000, "96000", 0, "96kHz", ""},
2383 {192000, "192000", 0, "192kHz", ""},
2384 {0, NULL, 0, NULL, NULL}};
2386 static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
2387 {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
2388 {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
2389 {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
2390 {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
2391 {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
2392 {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
2393 {0, NULL, 0, NULL, NULL}};
2395 static EnumPropertyItem quicktime_audio_bitrate_items[] = {
2396 {64000, "64000", 0, "64kbps", ""},
2397 {112000, "112000", 0, "112kpbs", ""},
2398 {128000, "128000", 0, "128kbps", ""},
2399 {192000, "192000", 0, "192kbps", ""},
2400 {256000, "256000", 0, "256kbps", ""},
2401 {320000, "320000", 0, "320kbps", ""},
2402 {0, NULL, 0, NULL, NULL}};
2407 static EnumPropertyItem ffmpeg_format_items[] = {
2408 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
2409 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
2410 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
2411 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
2412 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
2413 {FFMPEG_DV, "DV", 0, "DV", ""},
2414 {FFMPEG_H264, "H264", 0, "H.264", ""},
2415 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
2416 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
2417 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
2418 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
2419 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
2420 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
2421 {0, NULL, 0, NULL, NULL}};
2423 static EnumPropertyItem ffmpeg_codec_items[] = {
2424 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2425 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
2426 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
2427 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
2428 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
2429 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
2430 {CODEC_ID_H264, "H264", 0, "H.264", ""},
2431 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
2432 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
2433 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
2434 {0, NULL, 0, NULL, NULL}};
2436 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
2437 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2438 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
2439 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
2440 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
2441 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
2442 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
2443 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
2444 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
2445 {0, NULL, 0, NULL, NULL}};
2448 static EnumPropertyItem audio_channel_items[] = {
2449 {1, "MONO", 0, "Mono", "Set audio channels to mono"},
2450 {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
2451 {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
2452 {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
2453 {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
2454 {0, NULL, 0, NULL, NULL}};
2456 static EnumPropertyItem engine_items[] = {
2457 {0, "BLENDER_RENDER", 0, "Blender Render", "Use the Blender internal rendering engine for rendering"},
2458 {0, NULL, 0, NULL, NULL}};
2460 srna= RNA_def_struct(brna, "RenderSettings", NULL);
2461 RNA_def_struct_sdna(srna, "RenderData");
2462 RNA_def_struct_nested(brna, srna, "Scene");
2463 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
2464 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
2466 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
2467 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
2468 RNA_def_property_enum_items(prop, image_color_mode_items);
2469 RNA_def_property_ui_text(prop, "Color Mode",
2470 "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, "
2471 "and RGBA for saving red, green, blue and alpha channels");
2472 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2474 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
2475 RNA_def_property_int_sdna(prop, NULL, "xsch");
2476 RNA_def_property_range(prop, 4, 10000);
2477 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
2478 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update");
2480 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
2481 RNA_def_property_int_sdna(prop, NULL, "ysch");
2482 RNA_def_property_range(prop, 4, 10000);
2483 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
2484 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update");
2486 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
2487 RNA_def_property_int_sdna(prop, NULL, "size");
2488 RNA_def_property_range(prop, 1, SHRT_MAX);
2489 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
2490 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
2491 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2493 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
2494 RNA_def_property_int_sdna(prop, NULL, "xparts");
2495 RNA_def_property_range(prop, 1, 512);
2496 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
2497 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2499 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
2500 RNA_def_property_int_sdna(prop, NULL, "yparts");
2501 RNA_def_property_range(prop, 1, 512);
2502 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
2503 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2505 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
2506 RNA_def_property_float_sdna(prop, NULL, "xasp");
2507 RNA_def_property_range(prop, 1.0f, 200.0f);
2508 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
2509 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update");
2511 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
2512 RNA_def_property_float_sdna(prop, NULL, "yasp");
2513 RNA_def_property_range(prop, 1.0f, 200.0f);
2514 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
2515 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update");
2517 /* JPEG and AVI JPEG */
2519 prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
2520 RNA_def_property_int_sdna(prop, NULL, "quality");
2521 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
2522 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, compression for PNG's");
2523 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2527 prop= RNA_def_property(srna, "use_tiff_16bit", PROP_BOOLEAN, PROP_NONE);
2528 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
2529 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
2530 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2532 /* Cineon and DPX */
2534 prop= RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
2535 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
2536 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
2537 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2539 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
2540 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
2541 RNA_def_property_range(prop, 0, 1024);
2542 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
2543 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2545 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
2546 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
2547 RNA_def_property_range(prop, 0, 1024);
2548 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
2549 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2551 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
2552 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
2553 RNA_def_property_range(prop, 0.0f, 10.0f);
2554 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
2555 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2560 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
2561 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
2562 RNA_def_property_enum_items(prop, exr_codec_items);
2563 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
2564 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2566 prop= RNA_def_property(srna, "use_exr_half", PROP_BOOLEAN, PROP_NONE);
2567 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
2568 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
2569 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2571 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
2572 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
2573 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int z-buffer)");
2574 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2576 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
2577 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
2578 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
2579 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2582 #ifdef WITH_OPENJPEG
2585 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
2586 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
2587 RNA_def_property_enum_items(prop, jp2_preset_items);
2588 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_preset_set", NULL);
2589 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
2590 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2592 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
2593 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
2594 RNA_def_property_enum_items(prop, jp2_depth_items);
2595 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_depth_set", NULL);
2596 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
2597 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2599 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
2600 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
2601 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
2602 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2605 #ifdef WITH_QUICKTIME
2608 prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
2609 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
2610 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2611 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
2612 "rna_RenderSettings_qtcodecsettings_codecType_set",
2613 "rna_RenderSettings_qtcodecsettings_codecType_itemf");
2614 RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
2615 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2617 prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
2618 RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
2619 RNA_def_property_range(prop, 0, 100);
2620 RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
2621 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2624 prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE);
2625 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType");
2626 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2627 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
2628 "rna_RenderSettings_qtcodecsettings_audiocodecType_set",
2629 "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
2630 RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
2631 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2633 prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE);
2634 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate");
2635 RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
2636 RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
2637 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2639 prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE);
2640 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth");
2641 RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
2642 RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
2643 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2645 prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
2646 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
2647 RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
2648 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2650 prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
2651 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
2652 RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
2653 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2655 prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE);
2656 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate");
2657 RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
2658 RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
2659 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2666 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
2667 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
2668 RNA_def_property_enum_items(prop, ffmpeg_format_items);
2669 RNA_def_property_ui_text(prop, "Format", "Output file format");
2670 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2672 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
2673 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
2674 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
2675 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
2676 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2678 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
2679 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
2680 RNA_def_property_range(prop, 1, 14000);
2681 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate (kb/s)");
2682 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2684 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
2685 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
2686 RNA_def_property_range(prop, 0, 9000);
2687 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate (kb/s)");
2688 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2690 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
2691 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
2692 RNA_def_property_range(prop, 1, 14000);
2693 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kb/s)");
2694 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2696 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
2697 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
2698 RNA_def_property_range(prop, 0, 100000000);
2699 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
2700 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2702 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
2703 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
2704 RNA_def_property_range(prop, 0, 100);
2705 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
2706 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2708 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
2709 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
2710 RNA_def_property_range(prop, 0, 2000);
2711 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
2712 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2714 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
2715 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
2716 RNA_def_property_range(prop, 0, 16384);
2717 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
2718 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2720 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
2721 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
2722 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
2723 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2726 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
2727 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
2728 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2729 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
2730 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
2731 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2733 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
2734 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
2735 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2736 RNA_def_property_range(prop, 32, 384);
2737 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)");
2738 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2740 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
2741 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
2742 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2743 RNA_def_property_range(prop, 0.0f, 1.0f);
2744 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
2745 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2748 // the following two "ffmpeg" settings are general audio settings
2749 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
2750 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
2751 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2752 RNA_def_property_range(prop, 8000, 192000);
2753 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
2754 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2756 prop= RNA_def_property(srna, "ffmpeg_audio_channels", PROP_ENUM, PROP_NONE);
2757 RNA_def_property_enum_sdna(prop, NULL, "ffcodecdata.audio_channels");
2758 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2759 RNA_def_property_enum_items(prop, audio_channel_items);
2760 RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
2762 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2763 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
2764 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2765 RNA_def_property_range(prop, 1, 120);
2766 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
2767 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_Scene_fps_update");
2769 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
2770 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
2771 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2772 RNA_def_property_range(prop, 0.1f, 120.0f);
2773 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
2774 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_Scene_fps_update");
2777 prop= RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
2778 RNA_def_property_int_sdna(prop, NULL, "framapto");
2779 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2780 RNA_def_property_range(prop, 1, 900);
2781 RNA_def_property_ui_text(prop, "Frame Map Old", "Old mapping value in frames");
2782 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
2784 prop= RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
2785 RNA_def_property_int_sdna(prop, NULL, "images");
2786 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2787 RNA_def_property_range(prop, 1, 900);
2788 RNA_def_property_ui_text(prop, "Frame Map New", "How many frames the Map Old will last");
2789 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
2792 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
2793 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
2794 RNA_def_property_range(prop, 0.0f, 2.0f);
2795 RNA_def_property_ui_text(prop, "Dither Intensity",
2796 "Amount of dithering noise added to the rendered image to break up banding");
2797 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2799 prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
2800 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
2801 RNA_def_property_enum_items(prop, pixel_filter_items);
2802 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
2803 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2805 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
2806 RNA_def_property_float_sdna(prop, NULL, "gauss");
2807 RNA_def_property_range(prop, 0.5f, 1.5f);
2808 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
2809 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2811 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2812 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
2813 RNA_def_property_enum_items(prop, alpha_mode_items);
2814 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2815 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2817 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
2818 RNA_def_property_enum_sdna(prop, NULL, "ocres");
2819 RNA_def_property_enum_items(prop, octree_resolution_items);
2820 RNA_def_property_ui_text(prop, "Octree Resolution",
2821 "Resolution of raytrace accelerator, use higher resolutions for larger scenes");
2822 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2824 prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
2825 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
2826 RNA_def_property_enum_items(prop, raytrace_structure_items);
2827 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
2828 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2830 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
2831 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
2832 RNA_def_property_ui_text(prop, "Use Instances",
2833 "Instance support leads to effective memory reduction when using duplicates");
2834 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2836 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
2837 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
2838 RNA_def_property_ui_text(prop, "Use Local Coords",
2839 "Vertex coordinates are stored localy on each primitive "
2840 "(increases memory usage, but may have impact on speed)");
2841 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2843 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2844 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
2845 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
2846 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2848 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
2849 RNA_def_property_enum_sdna(prop, NULL, "osa");
2850 RNA_def_property_enum_items(prop, fixed_oversample_items);
2851 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
2852 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2854 prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
2855 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
2856 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
2857 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2859 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
2860 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2861 RNA_def_property_enum_items(prop, field_order_items);
2862 RNA_def_property_ui_text(prop, "Field Order",
2863 "Order of video fields (select which lines get rendered first, "
2864 "to create smooth motion for TV output)");
2865 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2867 prop= RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
2868 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
2869 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
2870 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2872 /* rendering features */
2873 prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
2874 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
2875 RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
2876 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2878 prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
2879 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
2880 RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
2881 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2883 prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
2884 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
2885 RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
2886 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2888 prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
2889 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
2890 RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
2891 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2893 prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
2894 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
2895 RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
2896 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2898 prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
2899 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
2900 RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
2901 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2903 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
2904 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
2905 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
2906 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2908 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
2909 RNA_def_property_int_sdna(prop, NULL, "edgeint");
2910 RNA_def_property_range(prop, 0, 255);
2911 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
2912 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2914 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
2915 RNA_def_property_float_sdna(prop, NULL, "edgeR");
2916 RNA_def_property_array(prop, 3);
2917 RNA_def_property_ui_text(prop, "Edge Color", "Edge color");
2918 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2921 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
2922 RNA_def_property_int_sdna(prop, NULL, "threads");
2923 RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
2924 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
2925 RNA_def_property_ui_text(prop, "Threads",
2926 "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
2927 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2929 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
2930 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2931 RNA_def_property_enum_items(prop, threads_mode_items);
2932 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
2933 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2936 prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
2937 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
2938 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
2939 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2941 prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
2942 RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
2943 RNA_def_property_range(prop, 1, 32);
2944 RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
2945 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2947 prop= RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
2948 RNA_def_property_float_sdna(prop, NULL, "blurfac");
2949 RNA_def_property_range(prop, 0.01f, 10.0f);
2950 RNA_def_property_ui_range(prop, 0.01, 2.0f, 1, 0);
2951 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
2952 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2955 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
2956 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
2957 RNA_def_property_ui_text(prop, "Border",
2958 "Render a user-defined border region, within the frame size "
2959 "(note that this disables save_buffers and full_sample)");
2960 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2962 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
2963 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
2964 RNA_def_property_range(prop, 0.0f, 1.0f);
2965 RNA_def_property_ui_text(prop, "Border Minimum X", "Minimum X value to for the render border");
2966 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2968 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
2969 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
2970 RNA_def_property_range(prop, 0.0f, 1.0f);
2971 RNA_def_property_ui_text(prop, "Border Minimum Y", "Minimum Y value for the render border");
2972 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2974 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
2975 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
2976 RNA_def_property_range(prop, 0.0f, 1.0f);
2977 RNA_def_property_ui_text(prop, "Border Maximum X", "Maximum X value for the render border");
2978 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2980 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
2981 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
2982 RNA_def_property_range(prop, 0.0f, 1.0f);
2983 RNA_def_property_ui_text(prop, "Border Maximum Y", "Maximum Y value for the render border");
2984 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2986 prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
2987 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
2988 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
2989 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2991 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
2992 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
2993 RNA_def_property_ui_text(prop, "Placeholders",
2994 "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
2995 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2997 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2998 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2999 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
3000 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3002 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
3003 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
3004 RNA_def_property_ui_text(prop, "Compositing",
3005 "Process the render result through the compositing pipeline, if compositing nodes are enabled");
3006 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3008 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
3009 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
3010 RNA_def_property_ui_text(prop, "Sequencer",
3011 "Process the render (and composited) result through the video sequence "
3012 "editor pipeline, if sequencer strips exist");
3013 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3015 prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
3016 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
3017 RNA_def_property_ui_text(prop, "Color Management", "Use linear workflow - gamma corrected imaging pipeline");
3018 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_RenderSettings_color_management_update");
3021 prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
3022 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
3023 RNA_def_property_ui_text(prop, "File Extensions",
3024 "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
3025 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3027 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
3028 RNA_def_property_enum_sdna(prop, NULL, "imtype");
3029 RNA_def_property_enum_items(prop, image_type_items);
3030 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
3031 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
3032 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3034 prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
3035 RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
3036 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
3037 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
3039 prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
3040 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
3041 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
3042 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
3044 prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
3045 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
3046 RNA_def_property_ui_text(prop, "Free Image Textures",
3047 "Free all image texture from memory after render, to save memory before compositing");
3048 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3050 prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
3051 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
3052 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
3053 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3055 prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
3056 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
3057 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
3058 RNA_def_property_ui_text(prop, "Save Buffers",
3059 "Save tiles for all RenderLayers and SceneNodes to files in the temp directory "
3060 "(saves memory, required for Full Sample)");
3061 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3063 prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
3064 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
3065 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
3066 RNA_def_property_ui_text(prop, "Full Sample",
3067 "Save for every anti-aliasing sample the entire RenderLayer results "
3068 "(this solves anti-aliasing issues with compositing)");
3069 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3071 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
3072 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
3073 RNA_def_property_enum_items(prop, display_mode_items);
3074 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
3075 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3077 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
3078 RNA_def_property_string_sdna(prop, NULL, "pic");
3079 RNA_def_property_ui_text(prop, "Output Path",
3080 "Directory/name to save animations, # characters defines the position "
3081 "and length of frame numbers");
3082 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
3086 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
3087 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
3088 RNA_def_property_enum_items(prop, bake_mode_items);
3089 RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
3091 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
3092 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
3093 RNA_def_property_enum_items(prop, bake_normal_space_items);
3094 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
3096 prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
3097 RNA_def_property_enum_items(prop, bake_qyad_split_items);
3098 RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
3100 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
3101 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
3102 RNA_def_property_enum_items(prop, fixed_oversample_items);
3103 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
3105 prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
3106 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
3107 RNA_def_property_ui_text(prop, "Selected to Active",