4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * Contributor(s): Blender Foundation (2008).
22 * ***** END GPL LICENSE BLOCK *****
25 /** \file blender/makesrna/intern/rna_scene.c
32 #include "RNA_define.h"
33 #include "RNA_enum_types.h"
35 #include "rna_internal.h"
37 #include "DNA_group_types.h"
38 #include "DNA_modifier_types.h"
39 #include "DNA_particle_types.h"
40 #include "DNA_scene_types.h"
41 #include "DNA_userdef_types.h"
43 #include "BKE_tessmesh.h"
45 /* Include for Bake Options */
46 #include "RE_pipeline.h"
49 #include "quicktime_export.h"
50 # ifdef WITH_AUDASPACE
51 # include "AUD_C-API.h"
56 #include "BKE_writeffmpeg.h"
57 #include <libavcodec/avcodec.h>
58 #include <libavformat/avformat.h>
64 #include "BLI_threads.h"
66 EnumPropertyItem snap_target_items[] = {
67 {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
68 {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target"},
69 {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
70 {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
71 {0, NULL, 0, NULL, NULL}};
73 EnumPropertyItem proportional_falloff_items[] ={
74 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
75 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
76 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
77 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
78 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
79 {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", "Consant falloff"},
80 {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", "Random falloff"},
81 {0, NULL, 0, NULL, NULL}};
84 EnumPropertyItem proportional_editing_items[] = {
85 {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"},
86 {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"},
87 {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", "Proportional Editing using connected geometry only"},
88 {0, NULL, 0, NULL, NULL}};
90 /* keep for operators, not used here */
91 EnumPropertyItem mesh_select_mode_items[] = {
92 {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
93 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
94 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
95 {0, NULL, 0, NULL, NULL}};
97 EnumPropertyItem snap_element_items[] = {
98 {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid"},
99 {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
100 {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"},
101 {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces"},
102 {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"},
103 {0, NULL, 0, NULL, NULL}};
105 EnumPropertyItem image_type_items[] = {
106 {0, "", 0, "Image", NULL},
107 {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"},
109 {R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"},
111 {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in (old!) SGI IRIS format"},
112 {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"},
113 {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"},
115 {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", "Output image in JPEG 2000 format"},
117 {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"},
118 {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", "Output image in uncompressed Targa format"},
119 {0, "", 0, " ", NULL},
121 {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"},
122 {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", "Output image in DPX format"},
125 {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", "Output image in multilayer OpenEXR format"},
126 {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", "Output image in OpenEXR format"},
129 {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", "Output image in Radiance HDR format"},
132 {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"},
134 {0, "", 0, "Movie", NULL},
136 {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", "Output video in AVI format"}, // XXX Missing codec menu
138 {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", "Output video in AVI JPEG format"},
139 {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", "Output video in AVI Raw format"},
140 {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", "Output image to a frameserver"},
142 {R_H264, "H264", ICON_FILE_MOVIE, "H.264", "Output video in H.264 format"},
143 {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", "Output video in MPEG format"},
144 {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", "Output video in Ogg format"},
146 #ifdef WITH_QUICKTIME
148 {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"},
150 {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"},
154 {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", "Output video in Xvid format"},
156 {0, NULL, 0, NULL, NULL}};
160 #include "DNA_anim_types.h"
161 #include "DNA_node_types.h"
162 #include "DNA_object_types.h"
163 #include "DNA_mesh_types.h"
165 #include "RNA_access.h"
167 #include "MEM_guardedalloc.h"
169 #include "BLI_threads.h"
170 #include "BLI_editVert.h"
171 #include "BLI_blenlib.h"
173 #include "BKE_context.h"
174 #include "BKE_global.h"
175 #include "BKE_image.h"
176 #include "BKE_main.h"
177 #include "BKE_node.h"
178 #include "BKE_pointcache.h"
179 #include "BKE_scene.h"
180 #include "BKE_depsgraph.h"
181 #include "BKE_image.h"
182 #include "BKE_mesh.h"
183 #include "BKE_sound.h"
184 #include "BKE_screen.h"
185 #include "BKE_animsys.h"
191 #include "ED_view3d.h"
193 #include "ED_keyframing.h"
195 #include "RE_pipeline.h"
197 static int rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
199 Scene *scene= (Scene*)ptr->data;
202 for(base= scene->base.first; base; base= base->next) {
203 if(strncmp(base->object->id.name+2, key, sizeof(base->object->id.name)-2)==0) {
204 *r_ptr= rna_pointer_inherit_refine(ptr, &RNA_ObjectBase, base);
212 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
214 ListBaseIterator *internal= iter->internal;
216 /* we are actually iterating a Base list, so override get */
217 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
220 static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
222 Scene *scene_act= CTX_data_scene(C);
225 if (object_in_scene(ob, scene)) {
226 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
230 base= scene_add_base(scene, ob);
233 /* this is similar to what object_add_type and add_object do */
234 base->lay= scene->lay;
236 /* when linking to an inactive scene dont touch the layer */
237 if(scene == scene_act)
240 ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
242 /* slows down importers too much, run scene.update() */
243 /* DAG_scene_sort(G.main, scene); */
245 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
250 static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
252 Base *base= object_in_scene(ob, scene);
254 BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'.", ob->id.name+2, scene->id.name+2);
257 if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
258 BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink.", ob->id.name+2);
261 if(scene->basact==base) {
265 BLI_remlink(&scene->base, base);
270 /* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
271 DAG_scene_sort(G.main, scene);
272 DAG_ids_flush_update(G.main, 0);
274 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
277 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
279 ToolSettings *ts = (ToolSettings*)ptr->data;
280 if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
281 ts->skgen_template = value.data;
283 ts->skgen_template = NULL;
286 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
288 Scene *scene= (Scene*)ptr->data;
289 return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
292 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
294 Scene *scene= (Scene*)ptr->data;
296 scene->basact= object_in_scene((Object*)value.data, scene);
301 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
303 Scene *scene= (Scene*)ptr->data;
304 Scene *set= (Scene*)value.data;
307 for(nested_set= set; nested_set; nested_set= nested_set->set) {
308 if(nested_set==scene)
315 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
317 Scene *scene= (Scene*)ptr->data;
319 scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
322 static void rna_Scene_view3d_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr)
324 Scene *scene= (Scene*)ptr->data;
326 BKE_screen_view3d_main_sync(&bmain->screen, scene);
329 static void rna_Scene_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
331 rna_Scene_view3d_update(bmain, scene, ptr);
332 DAG_on_visible_update(bmain, FALSE);
335 static void rna_Scene_framelen_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
337 scene->r.framelen= (float)scene->r.framapto/(float)scene->r.images;
341 static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
343 Scene *data= (Scene*)ptr->data;
345 /* if negative frames aren't allowed, then we can't use them */
346 FRAMENUMBER_MIN_CLAMP(value);
350 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
352 Scene *data= (Scene*)ptr->data;
353 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
354 CLAMP(value, MINFRAME, data->r.efra);
358 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
360 Scene *data= (Scene*)ptr->data;
361 CLAMP(value, data->r.sfra, MAXFRAME);
365 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
367 Scene *data= (Scene*)ptr->data;
370 /* copy range from scene if not set before */
371 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
372 data->r.psfra= data->r.sfra;
373 data->r.pefra= data->r.efra;
376 data->r.flag |= SCER_PRV_RANGE;
379 data->r.flag &= ~SCER_PRV_RANGE;
383 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
385 Scene *data= (Scene*)ptr->data;
387 /* check if enabled already */
388 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
389 /* set end of preview range to end frame, then clamp as per normal */
390 // TODO: or just refuse to set instead?
391 data->r.pefra= data->r.efra;
394 /* now set normally */
395 CLAMP(value, MINAFRAME, data->r.pefra);
396 data->r.psfra= value;
399 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
401 Scene *data= (Scene*)ptr->data;
403 /* check if enabled already */
404 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
405 /* set start of preview range to start frame, then clamp as per normal */
406 // TODO: or just refuse to set instead?
407 data->r.psfra= data->r.sfra;
410 /* now set normally */
411 CLAMP(value, data->r.psfra, MAXFRAME);
412 data->r.pefra= value;
415 static void rna_Scene_frame_update(bContext *C, PointerRNA *UNUSED(ptr))
417 //Scene *scene= ptr->id.data;
418 //ED_update_for_newframe(C);
422 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
424 Scene *scene= (Scene *)ptr->data;
425 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
428 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
430 Scene *scene= (Scene *)ptr->data;
431 KeyingSet *ks= (KeyingSet*)value.data;
433 scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
436 /* get KeyingSet index stuff for list of Keying Sets editing UI
437 * - active_keyingset-1 since 0 is reserved for 'none'
438 * - don't clamp, otherwise can never set builtins types as active...
440 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
442 Scene *scene= (Scene *)ptr->data;
443 return scene->active_keyingset-1;
446 /* get KeyingSet index stuff for list of Keying Sets editing UI
447 * - value+1 since 0 is reserved for 'none'
449 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
451 Scene *scene= (Scene *)ptr->data;
452 scene->active_keyingset= value+1;
455 // XXX: evil... builtin_keyingsets is defined in keyingsets.c!
456 // TODO: make API function to retrieve this...
457 extern ListBase builtin_keyingsets;
459 static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
461 Scene *scene= (Scene*)ptr->data;
463 /* start going over the scene KeyingSets first, while we still have pointer to it
464 * but only if we have any Keying Sets to use...
466 if (scene->keyingsets.first)
467 rna_iterator_listbase_begin(iter, &scene->keyingsets, NULL);
469 rna_iterator_listbase_begin(iter, &builtin_keyingsets, NULL);
472 static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
474 ListBaseIterator *internal= iter->internal;
475 KeyingSet *ks= (KeyingSet*)internal->link;
477 /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
478 if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
479 internal->link= (Link*)builtin_keyingsets.first;
481 internal->link= (Link*)ks->next;
483 iter->valid= (internal->link != NULL);
487 static char *rna_RenderSettings_path(PointerRNA *UNUSED(ptr))
489 return BLI_sprintfN("render");
492 static int rna_RenderSettings_threads_get(PointerRNA *ptr)
494 RenderData *rd= (RenderData*)ptr->data;
496 if(rd->mode & R_FIXED_THREADS)
499 return BLI_system_thread_count();
502 static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
504 RenderData *rd= (RenderData*)ptr->data;
505 return BKE_imtype_is_movie(rd->imtype);
508 static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
510 RenderData *rd= (RenderData*)ptr->data;
511 if(rd->mode & R_BORDER)
514 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
517 static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
519 RenderData *rd= (RenderData*)ptr->data;
521 return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
524 static void rna_RenderSettings_file_format_set(PointerRNA *ptr, int value)
526 RenderData *rd= (RenderData*)ptr->data;
530 ffmpeg_verify_image_type(rd);
532 #ifdef WITH_QUICKTIME
533 quicktime_verify_image_type(rd);
537 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
539 RenderData *rd= (RenderData*)ptr->data;
542 BKE_add_image_extension(ext, rd->imtype);
546 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
548 RenderData *rd= (RenderData*)ptr->data;
549 BKE_add_image_extension(str, rd->imtype);
552 void rna_RenderSettings_jpeg2k_preset_update(RenderData *rd)
554 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
556 switch(rd->jp2_depth) {
558 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
559 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
562 switch(rd->jp2_preset) {
563 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
564 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
565 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
566 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
567 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
568 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
569 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
574 static void rna_RenderSettings_jpeg2k_preset_set(PointerRNA *ptr, int value)
576 RenderData *rd= (RenderData*)ptr->data;
577 rd->jp2_preset= value;
578 rna_RenderSettings_jpeg2k_preset_update(rd);
581 static void rna_RenderSettings_jpeg2k_depth_set(PointerRNA *ptr, int value)
583 RenderData *rd= (RenderData*)ptr->data;
584 rd->jp2_depth= value;
585 rna_RenderSettings_jpeg2k_preset_update(rd);
589 #ifdef WITH_QUICKTIME
590 static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
592 RenderData *rd= (RenderData*)ptr->data;
594 return quicktime_rnatmpvalue_from_videocodectype(rd->qtcodecsettings.codecType);
597 static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
599 RenderData *rd= (RenderData*)ptr->data;
601 rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
604 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
606 EnumPropertyItem *item= NULL;
607 EnumPropertyItem tmp = {0, "", 0, "", ""};
608 QuicktimeCodecTypeDesc *codecTypeDesc;
612 for(i=0;i<quicktime_get_num_videocodecs();i++) {
613 codecTypeDesc = quicktime_get_videocodecType_desc(i);
614 if (!codecTypeDesc) break;
616 tmp.value= codecTypeDesc->rnatmpvalue;
617 *((int*)id) = codecTypeDesc->codecType;
620 tmp.name= codecTypeDesc->codecName;
621 RNA_enum_item_add(&item, &totitem, &tmp);
624 RNA_enum_item_end(&item, &totitem);
631 static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
633 RenderData *rd= (RenderData*)ptr->data;
635 return quicktime_rnatmpvalue_from_audiocodectype(rd->qtcodecsettings.audiocodecType);
638 static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
640 RenderData *rd= (RenderData*)ptr->data;
642 rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
645 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
647 EnumPropertyItem *item= NULL;
648 EnumPropertyItem tmp = {0, "", 0, "", ""};
649 QuicktimeCodecTypeDesc *codecTypeDesc;
652 for(i=0;i<quicktime_get_num_audiocodecs();i++) {
653 codecTypeDesc = quicktime_get_audiocodecType_desc(i);
654 if (!codecTypeDesc) break;
656 tmp.value= codecTypeDesc->rnatmpvalue;
657 tmp.identifier= codecTypeDesc->codecName;
658 tmp.name= codecTypeDesc->codecName;
659 RNA_enum_item_add(&item, &totitem, &tmp);
662 RNA_enum_item_end(&item, &totitem);
670 static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
672 RenderData *rd= (RenderData*)ptr->data;
676 static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
678 RenderData *rd= (RenderData*)ptr->data;
682 static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
684 RenderData *rd= (RenderData*)ptr->data;
687 *max= BLI_countlist(&rd->layers)-1;
691 static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
693 RenderData *rd= (RenderData*)ptr->data;
694 SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
696 return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
699 static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
701 RenderData *rd= (RenderData*)ptr->data;
702 SceneRenderLayer *srl= (SceneRenderLayer*)value.data;
704 rd->actlay = BLI_findindex(&rd->layers, srl);
707 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
709 RenderData *rd= (RenderData*)ptr->data;
710 RenderEngineType *type= BLI_findlink(&R_engines, value);
713 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
716 static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
718 RenderEngineType *type;
719 EnumPropertyItem *item= NULL;
720 EnumPropertyItem tmp = {0, "", 0, "", ""};
723 for(type=R_engines.first; type; type=type->next, a++) {
725 tmp.identifier= type->idname;
726 tmp.name= type->name;
727 RNA_enum_item_add(&item, &totitem, &tmp);
730 RNA_enum_item_end(&item, &totitem);
736 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
738 RenderData *rd= (RenderData*)ptr->data;
739 RenderEngineType *type;
742 for(type=R_engines.first; type; type=type->next, a++)
743 if(strcmp(type->idname, rd->engine) == 0)
749 static void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
751 Scene *scene= (Scene*)ptr->id.data;
753 DAG_id_tag_update(&scene->id, 0);
756 static void rna_RenderSettings_color_management_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
758 /* reset image nodes */
759 Scene *scene= (Scene*)ptr->id.data;
760 bNodeTree *ntree=scene->nodetree;
763 if(ntree && scene->use_nodes) {
764 /* XXX images are freed here, stop render and preview threads, until Image is threadsafe */
765 WM_jobs_stop_all(bmain->wm.first);
767 for (node=ntree->nodes.first; node; node=node->next) {
768 if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
769 ED_node_changed_update(&scene->id, node);
770 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
772 if (node->type == CMP_NODE_IMAGE)
773 BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
778 rna_Scene_glsl_update(bmain, scene, ptr);
781 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
783 Scene *scene= (Scene*)ptr->id.data;
784 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
786 BLI_strncpy(rl->name, value, sizeof(rl->name));
788 if(scene->nodetree) {
790 int index= BLI_findindex(&scene->r.layers, rl);
792 for(node= scene->nodetree->nodes.first; node; node= node->next) {
793 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
794 if(node->custom1==index)
795 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
801 static int rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr))
803 return (BLI_countlist(&R_engines) > 1);
806 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
808 RenderData *rd= (RenderData*)ptr->data;
809 RenderEngineType *type;
811 for(type=R_engines.first; type; type=type->next)
812 if(strcmp(type->idname, rd->engine) == 0)
813 return (type->flag & RE_GAME);
818 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
820 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
821 rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL);
824 static void rna_SceneRenderLayer_pass_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
826 Scene *scene= (Scene*)ptr->id.data;
829 ntreeCompositForceHidden(scene->nodetree, scene);
832 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
834 Scene *scene= (Scene*)ptr->data;
836 scene->use_nodes= value;
837 if(scene->use_nodes && scene->nodetree==NULL)
838 ED_node_composit_default(scene);
841 static void rna_Physics_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
843 Scene *scene= (Scene*)ptr->id.data;
846 for(base = scene->base.first; base; base=base->next)
847 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
850 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
852 Scene *scene= (Scene*)ptr->id.data;
853 ToolSettings *ts = (ToolSettings*)ptr->data;
854 int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
857 ts->selectmode = flag;
860 Mesh *me= get_mesh(scene->basact->object);
861 if(me && me->edit_btmesh && me->edit_btmesh->selectmode != flag) {
862 me->edit_btmesh->selectmode= flag;
863 EDBM_selectmode_set(me->edit_btmesh);
869 static void rna_Scene_editmesh_select_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
874 me= get_mesh(scene->basact->object);
875 if(me && me->edit_btmesh==NULL)
879 WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
880 WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
883 static void object_simplify_update(Object *ob)
886 ParticleSystem *psys;
888 for(md=ob->modifiers.first; md; md=md->next)
889 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
890 ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
892 for(psys=ob->particlesystem.first; psys; psys=psys->next)
893 psys->recalc |= PSYS_RECALC_CHILD;
898 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
899 object_simplify_update(gob->ob);
903 static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
908 for(SETLOOPER(scene, sce_iter, base))
909 object_simplify_update(base->object);
911 DAG_ids_flush_update(bmain, 0);
912 WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
915 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
917 if(scene->r.mode & R_SIMPLIFY)
918 rna_Scene_use_simplify_update(bmain, scene, ptr);
921 static int rna_Scene_use_audio_get(PointerRNA *ptr)
923 Scene *scene= (Scene*)ptr->data;
924 return scene->audio.flag & AUDIO_MUTE;
927 static void rna_Scene_use_audio_set(PointerRNA *ptr, int value)
929 Scene *scene= (Scene*)ptr->data;
932 scene->audio.flag |= AUDIO_MUTE;
934 scene->audio.flag &= ~AUDIO_MUTE;
936 sound_mute_scene(scene, value);
939 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
941 Scene *scene= (Scene*)ptr->data;
942 if(scene->audio.flag & AUDIO_SYNC)
944 return scene->flag & SCE_FRAME_DROP;
947 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
949 Scene *scene= (Scene*)ptr->data;
951 if(value == AUDIO_SYNC)
952 scene->audio.flag |= AUDIO_SYNC;
953 else if(value == SCE_FRAME_DROP)
955 scene->audio.flag &= ~AUDIO_SYNC;
956 scene->flag |= SCE_FRAME_DROP;
960 scene->audio.flag &= ~AUDIO_SYNC;
961 scene->flag &= ~SCE_FRAME_DROP;
965 static int rna_GameSettings_auto_start_get(PointerRNA *UNUSED(ptr))
967 if (G.fileflags & G_FILE_AUTOPLAY)
973 static void rna_GameSettings_auto_start_set(PointerRNA *UNUSED(ptr), int value)
976 G.fileflags |= G_FILE_AUTOPLAY;
978 G.fileflags &= ~G_FILE_AUTOPLAY;
982 static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[])
984 TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
985 marker->flag= SELECT;
987 BLI_strncpy(marker->name, name, sizeof(marker->name));
988 BLI_addtail(&scene->markers, marker);
992 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker)
994 /* try to remove the F-Curve from the action */
995 if (!BLI_remlink_safe(&scene->markers, marker)) {
996 BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in action '%s'", marker->name, scene->id.name+2);
1000 /* XXX, invalidates PyObject */
1004 static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, const char name[])
1006 KeyingSet *ks= NULL;
1008 /* call the API func, and set the active keyingset index */
1009 ks= BKE_keyingset_add(&sce->keyingsets, name, KEYINGSET_ABSOLUTE, 0);
1012 sce->active_keyingset= BLI_countlist(&sce->keyingsets);
1016 BKE_report(reports, RPT_ERROR, "Keying Set could not be added.");
1023 static void rna_def_transform_orientation(BlenderRNA *brna)
1028 const int matrix_dimsize[]= {3, 3};
1030 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
1032 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
1033 RNA_def_property_float_sdna(prop, NULL, "mat");
1034 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
1035 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1037 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1038 RNA_def_property_string_sdna(prop, NULL, "name");
1039 RNA_def_struct_name_property(srna, prop);
1040 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1043 static void rna_def_tool_settings(BlenderRNA *brna)
1048 static EnumPropertyItem uv_select_mode_items[] = {
1049 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
1050 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
1051 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
1052 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
1053 {0, NULL, 0, NULL, NULL}};
1055 static EnumPropertyItem auto_key_items[] = {
1056 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
1057 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
1058 {0, NULL, 0, NULL, NULL}};
1060 static EnumPropertyItem retarget_roll_items[] = {
1061 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
1062 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
1063 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
1064 {0, NULL, 0, NULL, NULL}};
1066 static EnumPropertyItem sketch_convert_items[] = {
1067 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
1068 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
1069 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts"},
1070 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
1071 {0, NULL, 0, NULL, NULL}};
1073 static EnumPropertyItem edge_tag_items[] = {
1074 {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
1075 {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
1076 {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
1077 {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
1078 {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
1079 {0, NULL, 0, NULL, NULL}};
1081 srna= RNA_def_struct(brna, "ToolSettings", NULL);
1082 RNA_def_struct_ui_text(srna, "Tool Settings", "");
1084 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
1085 RNA_def_property_struct_type(prop, "Sculpt");
1086 RNA_def_property_ui_text(prop, "Sculpt", "");
1088 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
1089 RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
1090 RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
1091 "Ensure all bone-deforming vertex groups add up to 1.0 while "
1094 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
1095 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
1096 RNA_def_property_ui_text(prop, "Vertex Paint", "");
1098 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
1099 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
1100 RNA_def_property_ui_text(prop, "Weight Paint", "");
1102 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
1103 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
1104 RNA_def_property_ui_text(prop, "Image Paint", "");
1106 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
1107 RNA_def_property_pointer_sdna(prop, NULL, "particle");
1108 RNA_def_property_ui_text(prop, "Particle Edit", "");
1111 prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
1112 RNA_def_property_enum_sdna(prop, NULL, "proportional");
1113 RNA_def_property_enum_items(prop, proportional_editing_items);
1114 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional Editing mode, allows transforms with distance fall-off");
1115 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1117 prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
1118 RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
1119 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing object mode");
1120 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
1121 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1123 prop= RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
1124 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
1125 RNA_def_property_enum_items(prop, proportional_falloff_items);
1126 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
1127 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1129 prop= RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
1130 RNA_def_property_float_sdna(prop, NULL, "proportional_size");
1131 RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle");
1132 RNA_def_property_range(prop, 0.00001, 5000.0);
1134 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
1135 RNA_def_property_float_sdna(prop, NULL, "normalsize");
1136 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
1137 RNA_def_property_range(prop, 0.00001, 1000.0);
1138 RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
1139 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
1141 prop= RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
1142 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
1143 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
1145 prop= RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
1146 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
1147 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
1148 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
1149 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1151 prop= RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
1152 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
1153 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
1154 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
1155 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1157 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
1158 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
1159 RNA_def_property_enum_items(prop, snap_element_items);
1160 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
1161 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1163 prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
1164 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
1165 RNA_def_property_enum_items(prop, snap_target_items);
1166 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
1167 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1169 prop= RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
1170 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
1171 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
1172 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
1173 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1175 prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
1176 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
1177 RNA_def_property_ui_text(prop, "Project Individual Elements", "Project individual elements on the surface of other objects");
1178 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
1179 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1181 prop= RNA_def_property(srna, "use_snap_project_self", PROP_BOOLEAN, PROP_NONE);
1182 RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT_NO_SELF);
1183 RNA_def_property_ui_text(prop, "Project to Self", "Project into its self (editmode)");
1184 RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
1185 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1188 prop = RNA_def_property(srna, "use_grease_pencil_sessions", PROP_BOOLEAN, PROP_NONE);
1189 RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINTSESSIONS_ON);
1190 RNA_def_property_ui_text(prop, "Use Sketching Sessions", "Allow drawing multiple strokes at a time with Grease Pencil");
1191 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); // xxx: need toolbar to be redrawn...
1194 prop= RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
1195 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
1196 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
1197 RNA_def_property_ui_icon(prop, ICON_REC, 0);
1199 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
1200 RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
1201 RNA_def_property_enum_items(prop, auto_key_items);
1202 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
1204 prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
1205 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
1206 RNA_def_property_ui_text(prop, "Layered", "Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking");
1208 prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
1209 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
1210 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set only");
1211 RNA_def_property_ui_icon(prop, ICON_KEY_HLT, 0); // XXX: we need a dedicated icon
1214 prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
1215 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
1216 RNA_def_property_enum_items(prop, uv_select_mode_items);
1217 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
1218 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1220 prop= RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
1221 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
1222 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
1223 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1224 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1226 prop= RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
1227 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
1228 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
1229 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1232 prop= RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
1233 RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
1234 RNA_def_property_array(prop, 3);
1235 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
1236 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
1237 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
1239 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
1240 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
1241 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
1243 /* use with MESH_OT_select_shortest_path */
1244 prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
1245 RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
1246 RNA_def_property_enum_items(prop, edge_tag_items);
1247 RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
1249 prop= RNA_def_property(srna, "edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
1250 RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1);
1251 RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edges seam re-calculates UV unwrap");
1254 prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
1255 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
1256 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
1257 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1259 prop= RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
1260 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
1261 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
1263 prop= RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
1264 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
1265 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
1267 prop= RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
1268 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
1269 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
1271 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
1272 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1273 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
1275 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
1276 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1277 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
1279 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
1280 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
1281 RNA_def_property_flag(prop, PROP_EDITABLE);
1282 RNA_def_property_struct_type(prop, "Object");
1283 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
1284 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
1286 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
1287 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
1288 RNA_def_property_range(prop, 1, 255);
1289 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
1290 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1292 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
1293 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
1294 RNA_def_property_range(prop, 0.00001, 1.0);
1295 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
1296 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
1297 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1299 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
1300 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
1301 RNA_def_property_range(prop, 0.00001, 100000.0);
1302 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1303 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
1304 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1306 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
1307 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
1308 RNA_def_property_enum_items(prop, retarget_roll_items);
1309 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
1311 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
1312 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
1313 RNA_def_property_enum_items(prop, sketch_convert_items);
1314 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
1315 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1317 /* Sculpt/Paint Unified Size and Strength */
1319 prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
1320 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
1321 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius", "Instead of per brush radius, the radius is shared across brushes");
1323 prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
1324 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
1325 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength", "Instead of per brush strength, the strength is shared across brushes");
1329 static void rna_def_unit_settings(BlenderRNA *brna)
1334 static EnumPropertyItem unit_systems[] = {
1335 {USER_UNIT_NONE, "NONE", 0, "None", ""},
1336 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
1337 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
1338 {0, NULL, 0, NULL, NULL}};
1340 static EnumPropertyItem rotation_units[] = {
1341 {0, "DEGREES", 0, "Degrees", "Use degrees for measuring rotation"},
1342 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
1343 {0, NULL, 0, NULL, NULL}};
1345 srna= RNA_def_struct(brna, "UnitSettings", NULL);
1346 RNA_def_struct_ui_text(srna, "Unit Settings", "");
1349 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
1350 RNA_def_property_enum_items(prop, unit_systems);
1351 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
1352 RNA_def_property_update(prop, NC_WINDOW, NULL);
1354 prop= RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
1355 RNA_def_property_enum_items(prop, rotation_units);
1356 RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
1357 RNA_def_property_update(prop, NC_WINDOW, NULL);
1359 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
1360 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
1361 RNA_def_property_range(prop, 0.00001, 100000.0);
1362 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1363 RNA_def_property_update(prop, NC_WINDOW, NULL);
1365 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
1366 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
1367 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs");
1368 RNA_def_property_update(prop, NC_WINDOW, NULL);
1371 void rna_def_render_layer_common(StructRNA *srna, int scene)
1375 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1376 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
1377 else RNA_def_property_string_sdna(prop, NULL, "name");
1378 RNA_def_property_ui_text(prop, "Name", "Render layer name");
1379 RNA_def_struct_name_property(srna, prop);
1380 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1381 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1383 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
1384 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
1385 RNA_def_property_struct_type(prop, "Material");
1386 RNA_def_property_flag(prop, PROP_EDITABLE);
1387 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
1388 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1389 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1391 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
1392 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
1393 RNA_def_property_struct_type(prop, "Group");
1394 RNA_def_property_flag(prop, PROP_EDITABLE);
1395 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
1396 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1397 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1400 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1401 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1402 RNA_def_property_array(prop, 20);
1403 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
1404 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
1405 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
1406 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1407 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1409 prop= RNA_def_property(srna, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
1410 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
1411 RNA_def_property_array(prop, 20);
1412 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers");
1413 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1414 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1417 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
1418 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
1419 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
1420 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1421 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1423 prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
1424 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
1425 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
1426 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1427 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1429 prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
1430 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
1431 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
1432 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1433 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1435 prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
1436 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
1437 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
1438 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1439 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1441 prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
1442 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
1443 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
1444 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1445 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1447 prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
1448 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
1449 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
1450 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1451 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1453 prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
1454 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
1455 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
1456 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1457 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1459 prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
1460 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
1461 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
1462 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1463 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1465 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
1466 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
1467 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
1468 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1469 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1471 prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
1472 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
1473 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
1474 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1475 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1478 prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
1479 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
1480 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
1481 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1482 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1484 prop= RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
1485 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
1486 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
1487 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1488 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1490 prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
1491 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
1492 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
1493 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1494 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1496 prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
1497 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
1498 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
1499 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1500 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1502 prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
1503 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
1504 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
1505 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1506 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1508 prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
1509 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
1510 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
1511 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1512 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1514 prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
1515 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
1516 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
1517 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1518 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1520 prop= RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
1521 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXMA);
1522 RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
1523 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1524 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1526 prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
1527 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
1528 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
1529 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1530 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1532 prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
1533 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
1534 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
1535 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1536 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1538 prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
1539 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
1540 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
1541 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1542 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1544 prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
1545 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
1546 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
1547 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1548 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1550 prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1551 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
1552 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
1553 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1554 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1556 prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
1557 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
1558 RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
1559 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1560 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1562 prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
1563 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
1564 RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
1565 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1566 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1568 prop= RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
1569 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
1570 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
1571 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1572 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1574 prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
1575 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
1576 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
1577 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1578 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1580 prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
1581 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
1582 RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
1583 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1584 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1586 prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
1587 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
1588 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
1589 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1590 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1591 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1593 prop= RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
1594 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
1595 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
1596 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
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, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1601 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
1602 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
1603 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1604 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1605 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1607 prop= RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
1608 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
1609 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
1610 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1611 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1612 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1614 prop= RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
1615 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
1616 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
1617 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1618 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1619 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1621 prop= RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
1622 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
1623 RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
1624 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1625 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1626 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1628 prop= RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
1629 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
1630 RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
1631 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1632 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1633 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1635 prop= RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
1636 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
1637 RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
1638 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
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);
1643 static void rna_def_scene_game_data(BlenderRNA *brna)
1648 static EnumPropertyItem framing_types_items[] ={
1649 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
1650 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1651 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1652 {0, NULL, 0, NULL, NULL}};
1654 static EnumPropertyItem dome_modes_items[] ={
1655 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1656 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1657 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1658 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1659 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1660 {0, NULL, 0, NULL, NULL}};
1662 static EnumPropertyItem stereo_modes_items[] ={
1663 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1664 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1665 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1666 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1667 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1668 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1669 {0, NULL, 0, NULL, NULL}};
1671 static EnumPropertyItem stereo_items[] ={
1672 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
1673 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
1674 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
1675 {0, NULL, 0, NULL, NULL}};
1677 static EnumPropertyItem physics_engine_items[] = {
1678 {WOPHY_NONE, "NONE", 0, "None", "Don't use a physics engine"},
1679 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1680 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1681 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1682 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1683 {WOPHY_BULLET, "BULLET", 0, "Bullet", "Use the Bullet physics engine"},
1684 {0, NULL, 0, NULL, NULL}};
1686 static EnumPropertyItem material_items[] ={
1687 {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials"},
1688 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
1689 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
1690 {0, NULL, 0, NULL, NULL}};
1692 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1693 RNA_def_struct_sdna(srna, "GameData");
1694 RNA_def_struct_nested(brna, srna, "Scene");
1695 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
1697 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1698 RNA_def_property_int_sdna(prop, NULL, "xplay");
1699 RNA_def_property_range(prop, 4, 10000);
1700 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
1701 RNA_def_property_update(prop, NC_SCENE, NULL);
1703 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1704 RNA_def_property_int_sdna(prop, NULL, "yplay");
1705 RNA_def_property_range(prop, 4, 10000);
1706 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
1707 RNA_def_property_update(prop, NC_SCENE, NULL);
1709 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
1710 RNA_def_property_int_sdna(prop, NULL, "depth");
1711 RNA_def_property_range(prop, 8, 32);
1712 RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
1713 RNA_def_property_update(prop, NC_SCENE, NULL);
1715 // Do we need it here ? (since we already have it in World
1716 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1717 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1718 RNA_def_property_range(prop, 4, 2000);
1719 RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display");
1720 RNA_def_property_update(prop, NC_SCENE, NULL);
1722 prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
1723 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1724 RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
1725 RNA_def_property_update(prop, NC_SCENE, NULL);
1728 prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
1729 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1730 RNA_def_property_enum_items(prop, framing_types_items);
1731 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
1732 RNA_def_property_update(prop, NC_SCENE, NULL);
1734 prop= RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
1735 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1736 RNA_def_property_range(prop, 0.0f, 1.0f);
1737 RNA_def_property_array(prop, 3);
1738 RNA_def_property_ui_text(prop, "Framing Color", "Set color of the bars");
1739 RNA_def_property_update(prop, NC_SCENE, NULL);
1742 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1743 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1744 RNA_def_property_enum_items(prop, stereo_items);
1745 RNA_def_property_ui_text(prop, "Stereo Options", "");
1746 RNA_def_property_update(prop, NC_SCENE, NULL);
1748 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1749 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1750 RNA_def_property_enum_items(prop, stereo_modes_items);
1751 RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
1752 RNA_def_property_update(prop, NC_SCENE, NULL);
1754 prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
1755 RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
1756 RNA_def_property_range(prop, 0.01, 5.0);
1757 RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
1758 RNA_def_property_update(prop, NC_SCENE, NULL);
1761 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1762 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1763 RNA_def_property_enum_items(prop, dome_modes_items);
1764 RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
1765 RNA_def_property_update(prop, NC_SCENE, NULL);
1767 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1768 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1769 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1770 RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
1771 RNA_def_property_update(prop, NC_SCENE, NULL);
1773 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1774 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1775 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1776 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1777 RNA_def_property_update(prop, NC_SCENE, NULL);
1779 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1780 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1781 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1782 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1783 RNA_def_property_update(prop, NC_SCENE, NULL);
1785 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1786 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1787 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1788 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1789 RNA_def_property_update(prop, NC_SCENE, NULL);
1791 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
1792 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
1793 RNA_def_property_struct_type(prop, "Text");
1794 RNA_def_property_flag(prop, PROP_EDITABLE);
1795 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
1796 RNA_def_property_update(prop, NC_SCENE, NULL);
1799 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
1800 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
1801 RNA_def_property_enum_items(prop, physics_engine_items);
1802 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
1803 RNA_def_property_update(prop, NC_SCENE, NULL);
1805 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
1806 RNA_def_property_float_sdna(prop, NULL, "gravity");
1807 RNA_def_property_ui_range(prop, 0.0, 25.0, 1, 2);
1808 RNA_def_property_range(prop, 0.0, 10000.0);
1809 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
1810 RNA_def_property_update(prop, NC_SCENE, NULL);
1812 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_INT, PROP_NONE);
1813 RNA_def_property_int_sdna(prop, NULL, "occlusionRes");
1814 RNA_def_property_range(prop, 128.0, 1024.0);
1815 RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
1816 RNA_def_property_update(prop, NC_SCENE, NULL);
1818 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1819 RNA_def_property_int_sdna(prop, NULL, "ticrate");
1820 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
1821 RNA_def_property_range(prop, 1, 250);
1822 RNA_def_property_ui_text(prop, "Frames Per Second", "The nominal number of game frames per second. Physics fixed timestep = 1/fps, independently of actual frame rate");
1823 RNA_def_property_update(prop, NC_SCENE, NULL);
1825 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
1826 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
1827 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1828 RNA_def_property_range(prop, 1, 5);
1829 RNA_def_property_ui_text(prop, "Max Logic Steps", "Sets the maximum number of logic frame per game frame if graphics slows down the game, higher value allows better synchronization with physics");
1830 RNA_def_property_update(prop, NC_SCENE, NULL);
1832 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
1833 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
1834 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1835 RNA_def_property_range(prop, 1, 5);
1836 RNA_def_property_ui_text(prop, "Max Physics Steps", "Sets the maximum number of physics step per game frame if graphics slows down the game, higher value allows physics to keep up with realtime");
1837 RNA_def_property_update(prop, NC_SCENE, NULL);
1839 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
1840 RNA_def_property_int_sdna(prop, NULL, "physubstep");
1841 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1842 RNA_def_property_range(prop, 1, 5);
1843 RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
1844 RNA_def_property_update(prop, NC_SCENE, NULL);
1847 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
1848 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
1849 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
1851 // not used // deprecated !!!!!!!!!!!!!
1852 prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
1853 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
1854 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
1856 // not used // deprecated !!!!!!!!!!!!!
1857 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
1858 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
1859 RNA_def_property_range(prop, 0.0, 1000.0);
1860 RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
1863 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
1864 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
1865 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
1867 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
1868 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
1869 RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs");
1871 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
1872 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
1873 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
1875 prop= RNA_def_property(srna, "show_mouse", PROP_BOOLEAN, PROP_NONE);
1876 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_MOUSE);
1877 RNA_def_property_ui_text(prop, "Show Mouse", "Start player with a visible mouse cursor");
1879 prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
1880 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
1881 RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
1883 prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
1884 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
1885 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
1887 prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
1888 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
1889 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
1891 prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
1892 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
1893 RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
1895 prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
1896 RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
1897 RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
1900 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
1901 RNA_def_property_enum_sdna(prop, NULL, "matmode");
1902 RNA_def_property_enum_items(prop, material_items);
1903 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
1904 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1906 prop= RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
1907 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
1908 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
1909 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1911 prop= RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
1912 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
1913 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
1914 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1916 prop= RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
1917 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
1918 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
1919 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1921 prop= RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
1922 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
1923 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
1924 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1926 prop= RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
1927 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
1928 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
1929 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1931 prop= RNA_def_property(srna, "use_glsl_color_management", PROP_BOOLEAN, PROP_NONE);
1932 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_COLOR_MANAGEMENT);
1933 RNA_def_property_ui_text(prop, "GLSL Color Management", "Use color management for GLSL rendering");
1934 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1936 prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
1937 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
1938 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
1939 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1942 static void rna_def_scene_render_layer(BlenderRNA *brna)
1946 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
1947 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
1948 RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
1950 rna_def_render_layer_common(srna, 1);
1954 static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
1959 // FunctionRNA *func;
1960 // PropertyRNA *parm;
1962 RNA_def_property_srna(cprop, "RenderLayers");
1963 srna= RNA_def_struct(brna, "RenderLayers", NULL);
1964 RNA_def_struct_sdna(srna, "RenderData");
1965 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
1967 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
1968 RNA_def_property_int_sdna(prop, NULL, "actlay");
1969 RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
1970 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
1971 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1973 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
1974 RNA_def_property_struct_type(prop, "SceneRenderLayer");
1975 RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get", "rna_RenderSettings_active_layer_set", NULL, NULL);
1976 RNA_def_property_flag(prop, PROP_EDITABLE);
1977 RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
1978 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1982 static void rna_def_scene_render_data(BlenderRNA *brna)
1987 static EnumPropertyItem pixel_filter_items[] ={
1988 {R_FILTER_BOX, "BOX", 0, "Box", "Use a box filter for anti-aliasing"},
1989 {R_FILTER_TENT, "TENT", 0, "Tent", "Use a tent filter for anti-aliasing"},
1990 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", "Use a quadratic filter for anti-aliasing"},
1991 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", "Use a cubic filter for anti-aliasing"},
1992 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", "Use a Catmull-Rom filter for anti-aliasing"},
1993 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", "Use a Gaussian filter for anti-aliasing"},
1994 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", "Use a Mitchell-Netravali filter for anti-aliasing"},
1995 {0, NULL, 0, NULL, NULL}};
1997 static EnumPropertyItem alpha_mode_items[] ={
1998 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
1999 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
2000 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
2001 {0, NULL, 0, NULL, NULL}};
2003 static EnumPropertyItem color_mode_items[] ={
2004 {R_PLANESBW, "BW", 0, "BW", "Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)"},
2005 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
2006 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
2007 {0, NULL, 0, NULL, NULL}};
2009 static EnumPropertyItem display_mode_items[] ={
2010 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
2011 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
2012 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
2013 {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes, optionally showing result"},
2014 {0, NULL, 0, NULL, NULL}};
2017 static EnumPropertyItem bake_mode_items[] ={
2018 {RE_BAKE_ALL, "FULL", 0, "Full Render", "Bake everything"},
2019 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"},
2020 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", "Bake shadows"},
2021 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"},
2022 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", "Bake textures"},
2023 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"},
2024 {RE_BAKE_EMIT, "EMIT", 0, "Emission", "Bake Emit values (glow)"},
2025 {RE_BAKE_ALPHA, "ALPHA", 0, "Alpha", "Bake Alpha values (transparency)"},
2026 {RE_BAKE_MIRROR_INTENSITY, "MIRROR_INTENSITY", 0, "Mirror Intensity", "Bake Mirror values"},
2027 {RE_BAKE_MIRROR_COLOR, "MIRROR_COLOR", 0, "Mirror Colors", "Bake Mirror colors"},
2028 {RE_BAKE_SPEC_INTENSITY, "SPEC_INTENSITY", 0, "Specular Intensity", "Bake Specular values"},
2029 {RE_BAKE_SPEC_COLOR, "SPEC_COLOR", 0, "Specular Colors", "Bake Specular colors"},
2030 {0, NULL, 0, NULL, NULL}};
2032 static EnumPropertyItem bake_normal_space_items[] ={
2033 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", "Bake the normals in camera space"},
2034 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", "Bake the normals in world space"},
2035 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"},
2036 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"},
2037 {0, NULL, 0, NULL, NULL}};
2039 static EnumPropertyItem bake_qyad_split_items[] ={
2040 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
2041 {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
2042 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
2043 {0, NULL, 0, NULL, NULL}};
2045 static EnumPropertyItem octree_resolution_items[] = {
2046 {64, "64", 0, "64", ""},
2047 {128, "128", 0, "128", ""},
2048 {256, "256", 0, "256", ""},
2049 {512, "512", 0, "512", ""},
2050 {0, NULL, 0, NULL, NULL}};
2052 static EnumPropertyItem raytrace_structure_items[] = {
2053 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", "Automatically select acceleration structure"},
2054 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"},
2055 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
2056 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", "Use vBVH"},
2057 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", "Use SIMD SVBVH"},
2058 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", "Use SIMD QBVH"},
2059 {0, NULL, 0, NULL, NULL}
2062 static EnumPropertyItem fixed_oversample_items[] = {
2063 {5, "5", 0, "5", ""},
2064 {8, "8", 0, "8", ""},
2065 {11, "11", 0, "11", ""},
2066 {16, "16", 0, "16", ""},
2067 {0, NULL, 0, NULL, NULL}};
2069 static EnumPropertyItem field_order_items[] = {
2070 {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"},
2071 {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"},
2072 {0, NULL, 0, NULL, NULL}};
2074 static EnumPropertyItem threads_mode_items[] = {
2075 {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
2076 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
2077 {0, NULL, 0, NULL, NULL}};
2080 static EnumPropertyItem exr_codec_items[] = {
2081 {0, "NONE", 0, "None", ""},
2082 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
2083 {2, "ZIP", 0, "ZIP (lossless)", ""},
2084 {3, "PIZ", 0, "PIZ (lossless)", ""},
2085 {4, "RLE", 0, "RLE (lossless)", ""},
2086 {0, NULL, 0, NULL, NULL}};
2089 #ifdef WITH_OPENJPEG
2090 static EnumPropertyItem jp2_preset_items[] = {
2091 {0, "NO_PRESET", 0, "No Preset", ""},
2092 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
2093 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
2094 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
2095 {4, "CINE_SCOPE_24FPS", 0, "Cine-Scope 24fps 2048x858", ""},
2096 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
2097 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
2098 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
2099 {0, NULL, 0, NULL, NULL}};
2101 static EnumPropertyItem jp2_depth_items[] = {
2102 {8, "8", 0, "8", "8 bit color channels"},
2103 {12, "12", 0, "12", "12 bit color channels"},
2104 {16, "16", 0, "16", "16 bit color channels"},
2105 {0, NULL, 0, NULL, NULL}};
2108 #ifdef WITH_QUICKTIME
2109 static EnumPropertyItem quicktime_codec_type_items[] = {
2110 {0, "codec", 0, "codec", ""},
2111 {0, NULL, 0, NULL, NULL}};
2114 static EnumPropertyItem quicktime_audio_samplerate_items[] = {
2115 {22050, "22050", 0, "22kHz", ""},
2116 {44100, "44100", 0, "44.1kHz", ""},
2117 {48000, "48000", 0, "48kHz", ""},
2118 {88200, "88200", 0, "88.2kHz", ""},
2119 {96000, "96000", 0, "96kHz", ""},
2120 {192000, "192000", 0, "192kHz", ""},
2121 {0, NULL, 0, NULL, NULL}};
2123 static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
2124 {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
2125 {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
2126 {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
2127 {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
2128 {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
2129 {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
2130 {0, NULL, 0, NULL, NULL}};
2132 static EnumPropertyItem quicktime_audio_bitrate_items[] = {
2133 {64000, "64000", 0, "64kbps", ""},
2134 {112000, "112000", 0, "112kpbs", ""},
2135 {128000, "128000", 0, "128kbps", ""},
2136 {192000, "192000", 0, "192kbps", ""},
2137 {256000, "256000", 0, "256kbps", ""},
2138 {320000, "320000", 0, "320kbps", ""},
2139 {0, NULL, 0, NULL, NULL}};
2144 static EnumPropertyItem ffmpeg_format_items[] = {
2145 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
2146 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
2147 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
2148 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
2149 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
2150 {FFMPEG_DV, "DV", 0, "DV", ""},
2151 {FFMPEG_H264, "H264", 0, "H.264", ""},
2152 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
2153 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
2154 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
2155 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
2156 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
2157 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
2158 {0, NULL, 0, NULL, NULL}};
2160 static EnumPropertyItem ffmpeg_codec_items[] = {
2161 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2162 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
2163 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
2164 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
2165 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
2166 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
2167 {CODEC_ID_H264, "H264", 0, "H.264", ""},
2168 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
2169 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
2170 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
2171 {0, NULL, 0, NULL, NULL}};
2173 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
2174 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2175 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
2176 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
2177 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
2178 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
2179 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
2180 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
2181 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
2182 {0, NULL, 0, NULL, NULL}};
2185 static EnumPropertyItem engine_items[] = {
2186 {0, "BLENDER_RENDER", 0, "Blender Render", "Use the Blender internal rendering engine for rendering"},
2187 {0, NULL, 0, NULL, NULL}};
2189 srna= RNA_def_struct(brna, "RenderSettings", NULL);
2190 RNA_def_struct_sdna(srna, "RenderData");
2191 RNA_def_struct_nested(brna, srna, "Scene");
2192 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
2193 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
2195 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
2196 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
2197 RNA_def_property_enum_items(prop, color_mode_items);
2198 RNA_def_property_ui_text(prop, "Color Mode", "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, AND RGBA for saving red, green, blue + alpha channels");
2199 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2201 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
2202 RNA_def_property_int_sdna(prop, NULL, "xsch");
2203 RNA_def_property_range(prop, 4, 10000);
2204 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
2205 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2207 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
2208 RNA_def_property_int_sdna(prop, NULL, "ysch");
2209 RNA_def_property_range(prop, 4, 10000);
2210 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
2211 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2213 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
2214 RNA_def_property_int_sdna(prop, NULL, "size");
2215 RNA_def_property_range(prop, 1, SHRT_MAX);
2216 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
2217 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
2218 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2220 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
2221 RNA_def_property_int_sdna(prop, NULL, "xparts");
2222 RNA_def_property_range(prop, 1, 512);
2223 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
2224 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2226 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
2227 RNA_def_property_int_sdna(prop, NULL, "yparts");
2228 RNA_def_property_range(prop, 1, 512);
2229 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
2230 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2232 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
2233 RNA_def_property_float_sdna(prop, NULL, "xasp");
2234 RNA_def_property_range(prop, 1.0f, 200.0f);
2235 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
2236 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2238 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
2239 RNA_def_property_float_sdna(prop, NULL, "yasp");
2240 RNA_def_property_range(prop, 1.0f, 200.0f);
2241 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
2242 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2244 /* JPEG and AVI JPEG */
2246 prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
2247 RNA_def_property_int_sdna(prop, NULL, "quality");
2248 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
2249 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, Compression for PNG's");
2250 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2254 prop= RNA_def_property(srna, "use_tiff_16bit", PROP_BOOLEAN, PROP_NONE);
2255 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
2256 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
2257 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2259 /* Cineon and DPX */
2261 prop= RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
2262 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
2263 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
2264 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2266 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
2267 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
2268 RNA_def_property_range(prop, 0, 1024);
2269 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
2270 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2272 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
2273 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
2274 RNA_def_property_range(prop, 0, 1024);
2275 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
2276 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2278 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
2279 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
2280 RNA_def_property_range(prop, 0.0f, 10.0f);
2281 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
2282 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2287 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
2288 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
2289 RNA_def_property_enum_items(prop, exr_codec_items);
2290 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
2291 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2293 prop= RNA_def_property(srna, "use_exr_half", PROP_BOOLEAN, PROP_NONE);
2294 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
2295 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
2296 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2298 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
2299 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
2300 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int z-buffer)");
2301 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2303 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
2304 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
2305 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
2306 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2309 #ifdef WITH_OPENJPEG
2312 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
2313 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
2314 RNA_def_property_enum_items(prop, jp2_preset_items);
2315 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_preset_set", NULL);
2316 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
2317 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2319 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
2320 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
2321 RNA_def_property_enum_items(prop, jp2_depth_items);
2322 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_depth_set", NULL);
2323 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
2324 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2326 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
2327 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
2328 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
2329 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2332 #ifdef WITH_QUICKTIME
2335 prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
2336 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
2337 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2338 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
2339 "rna_RenderSettings_qtcodecsettings_codecType_set",
2340 "rna_RenderSettings_qtcodecsettings_codecType_itemf");
2341 RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
2342 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2344 prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
2345 RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
2346 RNA_def_property_range(prop, 0, 100);
2347 RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
2348 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2351 prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE);
2352 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType");
2353 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2354 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
2355 "rna_RenderSettings_qtcodecsettings_audiocodecType_set",
2356 "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
2357 RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
2358 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2360 prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE);
2361 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate");
2362 RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
2363 RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
2364 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2366 prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE);
2367 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth");
2368 RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
2369 RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
2370 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2372 prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
2373 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
2374 RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
2375 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2377 prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
2378 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
2379 RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
2380 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2382 prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE);
2383 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate");
2384 RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
2385 RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
2386 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2393 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
2394 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
2395 RNA_def_property_enum_items(prop, ffmpeg_format_items);
2396 RNA_def_property_ui_text(prop, "Format", "Output file format");
2397 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2399 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
2400 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
2401 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
2402 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
2403 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2405 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
2406 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
2407 RNA_def_property_range(prop, 1, 14000);
2408 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
2409 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2411 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
2412 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
2413 RNA_def_property_range(prop, 0, 9000);
2414 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
2415 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2417 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
2418 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
2419 RNA_def_property_range(prop, 1, 14000);
2420 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
2421 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2423 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
2424 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
2425 RNA_def_property_range(prop, 0, 100000000);
2426 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
2427 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2429 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
2430 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
2431 RNA_def_property_range(prop, 0, 100);
2432 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
2433 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2435 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
2436 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
2437 RNA_def_property_range(prop, 0, 2000);
2438 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
2439 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2441 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
2442 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
2443 RNA_def_property_range(prop, 0, 16384);
2444 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
2445 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2447 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
2448 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
2449 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
2450 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2453 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
2454 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
2455 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
2456 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
2457 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2459 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
2460 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
2461 RNA_def_property_range(prop, 32, 384);
2462 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
2463 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2465 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
2466 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
2467 RNA_def_property_range(prop, 8000, 192000);
2468 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
2469 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2471 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
2472 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
2473 RNA_def_property_range(prop, 0.0f, 1.0f);
2474 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
2475 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2479 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2480 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
2481 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2482 RNA_def_property_range(prop, 1, 120);
2483 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
2484 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2486 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
2487 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
2488 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2489 RNA_def_property_range(prop, 0.1f, 120.0f);
2490 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
2491 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2494 prop= RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
2495 RNA_def_property_int_sdna(prop, NULL, "framapto");
2496 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2497 RNA_def_property_range(prop, 1, 900);
2498 RNA_def_property_ui_text(prop, "Frame Map Old", "Specify old mapping value in frames");
2499 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
2501 prop= RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
2502 RNA_def_property_int_sdna(prop, NULL, "images");
2503 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2504 RNA_def_property_range(prop, 1, 900);
2505 RNA_def_property_ui_text(prop, "Frame Map New", "Specify how many frames the Map Old will last");
2506 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
2509 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
2510 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
2511 RNA_def_property_range(prop, 0.0f, 2.0f);
2512 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding");
2513 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2515 prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
2516 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
2517 RNA_def_property_enum_items(prop, pixel_filter_items);
2518 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
2519 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2521 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
2522 RNA_def_property_float_sdna(prop, NULL, "gauss");
2523 RNA_def_property_range(prop, 0.5f, 1.5f);
2524 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
2525 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2527 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2528 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
2529 RNA_def_property_enum_items(prop, alpha_mode_items);
2530 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2531 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2533 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
2534 RNA_def_property_enum_sdna(prop, NULL, "ocres");
2535 RNA_def_property_enum_items(prop, octree_resolution_items);
2536 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes");
2537 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2539 prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
2540 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
2541 RNA_def_property_enum_items(prop, raytrace_structure_items);
2542 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
2543 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2545 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
2546 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
2547 RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates");
2548 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2550 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
2551 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
2552 RNA_def_property_ui_text(prop, "Use Local Coords", "Vertex coordinates are stored localy on each primitive. Increases memory usage, but may have impact on speed");
2553 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2555 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2556 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
2557 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
2558 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2560 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
2561 RNA_def_property_enum_sdna(prop, NULL, "osa");
2562 RNA_def_property_enum_items(prop, fixed_oversample_items);
2563 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
2564 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2566 prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
2567 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
2568 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
2569 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2571 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
2572 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2573 RNA_def_property_enum_items(prop, field_order_items);
2574 RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines get rendered first, to create smooth motion for TV output");
2575 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2577 prop= RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
2578 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
2579 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
2580 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2582 /* rendering features */
2583 prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
2584 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
2585 RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
2586 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2588 prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
2589 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
2590 RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
2591 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2593 prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
2594 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
2595 RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
2596 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2598 prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
2599 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
2600 RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
2601 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2603 prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
2604 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
2605 RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
2606 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2608 prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
2609 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
2610 RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
2611 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2613 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
2614 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
2615 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
2616 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2618 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
2619 RNA_def_property_int_sdna(prop, NULL, "edgeint");
2620 RNA_def_property_range(prop, 0, 255);
2621 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
2622 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2624 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
2625 RNA_def_property_float_sdna(prop, NULL, "edgeR");
2626 RNA_def_property_array(prop, 3);
2627 RNA_def_property_ui_text(prop, "Edge Color", "Edge color");
2628 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2631 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
2632 RNA_def_property_int_sdna(prop, NULL, "threads");
2633 RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
2634 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
2635 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
2636 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2638 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
2639 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2640 RNA_def_property_enum_items(prop, threads_mode_items);
2641 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
2642 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2645 prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
2646 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
2647 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
2648 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2650 prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
2651 RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
2652 RNA_def_property_range(prop, 1, 32);
2653 RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
2654 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2656 prop= RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
2657 RNA_def_property_float_sdna(prop, NULL, "blurfac");
2658 RNA_def_property_range(prop, 0.01f, 10.0f);
2659 RNA_def_property_ui_range(prop, 0.01, 2.0f, 1, 0);
2660 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
2661 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2664 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
2665 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
2666 RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size. Note, this disables save_buffers and full_sample");
2667 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2669 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
2670 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
2671 RNA_def_property_range(prop, 0.0f, 1.0f);
2672 RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border");
2673 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2675 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
2676 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
2677 RNA_def_property_range(prop, 0.0f, 1.0f);
2678 RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
2679 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2681 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
2682 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
2683 RNA_def_property_range(prop, 0.0f, 1.0f);
2684 RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
2685 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2687 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
2688 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
2689 RNA_def_property_range(prop, 0.0f, 1.0f);
2690 RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
2691 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2693 prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
2694 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
2695 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
2696 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2698 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
2699 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
2700 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
2701 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2703 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2704 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2705 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
2706 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2708 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
2709 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
2710 RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled");
2711 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2713 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
2714 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
2715 RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist");
2716 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2718 prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
2719 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
2720 RNA_def_property_ui_text(prop, "Color Management", "Use linear workflow - gamma corrected imaging pipeline");
2721 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_RenderSettings_color_management_update");
2724 prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
2725 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
2726 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
2727 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2729 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
2730 RNA_def_property_enum_sdna(prop, NULL, "imtype");
2731 RNA_def_property_enum_items(prop, image_type_items);
2732 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
2733 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
2734 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2736 prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
2737 RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
2738 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
2739 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2741 prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
2742 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
2743 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2744 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
2746 prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
2747 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2748 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing");
2749 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2751 prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
2752 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
2753 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
2754 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2756 prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
2757 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
2758 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
2759 RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, required for Full Sample)");
2760 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2762 prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
2763 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
2764 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
2765 RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing");
2766 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2768 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2769 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
2770 RNA_def_property_enum_items(prop, display_mode_items);
2771 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
2772 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2774 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
2775 RNA_def_property_string_sdna(prop, NULL, "pic");
2776 RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers");
2777 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2781 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
2782 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
2783 RNA_def_property_enum_items(prop, bake_mode_items);
2784 RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
2786 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
2787 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
2788 RNA_def_property_enum_items(prop, bake_normal_space_items);
2789 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
2791 prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
2792 RNA_def_property_enum_items(prop, bake_qyad_split_items);
2793 RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
2795 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
2796 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
2797 RNA_def_property_enum_items(prop, fixed_oversample_items);
2798 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
2800 prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
2801 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
2802 RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
2804 prop= RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
2805 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
2806 RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings");
2808 prop= RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
2809 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
2810 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
2812 prop= RNA_def_property(srna, "use_bake_antialiasing", PROP_BOOLEAN, PROP_NONE);
2813 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
2814 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
2816 prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
2817 RNA_def_property_int_sdna(prop, NULL, "bake_filter");
2818 RNA_def_property_range(prop, 0, 32);
2819 RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
2821 prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
2822 RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
2823 RNA_def_property_range(prop, 0.0, 1000.0);
2824 RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
2826 prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
2827 RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
2828 RNA_def_property_range(prop, 0.0, 1000.0);
2829 RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
2831 prop= RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE);
2832 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_MULTIRES);
2833 RNA_def_property_ui_text(prop, "Bake from Multires", "Bake directly from multires object");
2835 prop= RNA_def_property(srna, "use_bake_lores_mesh", PROP_BOOLEAN, PROP_NONE);
2836 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_LORES_MESH);
2837 RNA_def_property_ui_text(prop, "Low Resolution Mesh", "Calculate heights against unsubdivided low resolution mesh");
2841 prop= RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
2842 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
2843 RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
2844 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2846 prop= RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
2847 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
2848 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
2849 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2851 prop= RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
2852 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
2853 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
2854 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2856 prop= RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
2857 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
2858 RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
2859 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2861 prop= RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
2862 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERALENS);
2863 RNA_def_property_ui_text(prop, "Stamp Lens", "Include the name of the active cameras lens in image metadata");
2864 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2866 prop= RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
2867 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
2868 RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
2869 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2871 prop= RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
2872 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
2873 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
2874 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2876 prop= RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
2877 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
2878 RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
2879 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2881 prop= RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
2882 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
2883 RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
2884 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2886 prop= RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
2887 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
2888 RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
2889 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2891 prop= RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
2892 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
2893 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
2894 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2896 prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
2897 RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
2898 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
2899 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2901 prop= RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
2902 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
2903 RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
2904 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2906 prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
2907 RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
2908 RNA_def_property_range(prop, 8, 64);
2909 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
2910 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2912 prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
2913 RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
2914 RNA_def_property_array(prop, 4);
2915 RNA_def_property_range(prop,0.0,1.0);
2916 RNA_def_property_ui_text(prop, "Stamp Text Color", "Color to use for stamp text");
2917 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2919 prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
2920 RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
2921 RNA_def_property_array(prop, 4);
2922 RNA_def_property_range(prop,0.0,1.0);
2923 RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
2924 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2926 /* sequencer draw options */
2928 prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
2929 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV);
2930 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2932 prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
2933 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND);
2934 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2937 prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
2938 RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
2939 RNA_def_property_enum_items(prop, viewport_shade_items);
2940 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2942 prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
2943 RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
2944 RNA_def_property_enum_items(prop, viewport_shade_items);
2945 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2949 prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
2950 RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
2951 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2952 RNA_def_property_ui_text(prop, "Render Layers", "");
2953 rna_def_render_layers(brna, prop);
2956 prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
2957 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
2958 RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
2959 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
2960 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2963 prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
2964 RNA_def_property_enum_items(prop, engine_items);
2965 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set", "rna_RenderSettings_engine_itemf");
2966 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
2967 RNA_def_property_update(prop, NC_WINDOW, NULL);
2969 prop= RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
2970 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
2971 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2972 RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
2974 prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
2975 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
2976 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2977 RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine");
2980 prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
2981 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
2982 RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
2983 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
2985 prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
2986 RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
2987 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
2988 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
2989 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2991 prop= RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
2992 RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
2993 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
2994 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2996 prop= RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
2997 RNA_def_property_int_sdna(prop, NULL, "simplify_shadowsamples");
2998 RNA_def_property_ui_range(prop, 1, 16, 1, 0);
2999 RNA_def_property_ui_text(prop, "Simplify Shadow Samples", "Global maximum shadow samples");
3000 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
3002 prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
3003 RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
3004 RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor");
3005 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
3007 prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
3008 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
3009 RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated");
3012 RNA_api_scene_render(srna);
3016 static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
3024 RNA_def_property_srna(cprop, "SceneObjects");
3025 srna= RNA_def_struct(brna, "SceneObjects", NULL);
3026 RNA_def_struct_sdna(srna, "Scene");
3027 RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
3029 func= RNA_def_function(srna, "link", "rna_Scene_object_link");
3030 RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after.");
3031 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
3032 parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
3033 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3034 parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
3035 RNA_def_function_return(func, parm);
3037 func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
3038 RNA_def_function_ui_description(func, "Unlink object from scene.");
3039 RNA_def_function_flag(func, FUNC_USE_REPORTS);
3040 parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
3041 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3043 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3044 RNA_def_property_struct_type(prop, "Object");
3045 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL, NULL);
3046 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
3047 RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene");
3048 /* Could call: ED_base_object_activate(C, scene->basact);
3049 * but would be a bad level call and it seems the notifier is enough */
3050 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
3055 static void rna_def_scene_bases(BlenderRNA *brna, PropertyRNA *cprop)
3060 // FunctionRNA *func;
3061 // PropertyRNA *parm;
3063 RNA_def_property_srna(cprop, "SceneBases");
3064 srna= RNA_def_struct(brna, "SceneBases", NULL);
3065 RNA_def_struct_sdna(srna, "Scene");
3066 RNA_def_struct_ui_text(srna, "Scene Bases", "Collection of scene bases");
3068 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3069 RNA_def_property_struct_type(prop, "ObjectBase");
3070 RNA_def_property_pointer_sdna(prop, NULL, "basact");
3071 RNA_def_property_flag(prop, PROP_EDITABLE);
3072 RNA_def_property_ui_text(prop, "Active Base", "Active object base in the scene");
3073 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
3076 /* scene.timeline_markers */
3077 static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
3084 RNA_def_property_srna(cprop, "TimelineMarkers");
3085 srna= RNA_def_struct(brna, "TimelineMarkers", NULL);
3086 RNA_def_struct_sdna(srna, "Scene");
3087 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
3089 func= RNA_def_function(srna, "new", "rna_TimeLine_add");
3090 RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
3091 parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
3092 RNA_def_property_flag(parm, PROP_REQUIRED);
3094 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
3095 RNA_def_function_return(func, parm);
3098 func= RNA_def_function(srna, "remove", "rna_TimeLine_remove");
3099 RNA_def_function_ui_description(func, "Remove a timeline marker.");
3100 RNA_def_function_flag(func, FUNC_USE_REPORTS);
3101 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
3102 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3105 /* scene.keying_sets */
3106 static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
3114 RNA_def_property_srna(cprop, "KeyingSets");
3115 srna= RNA_def_struct(brna, "KeyingSets", NULL);
3116 RNA_def_struct_sdna(srna, "Scene");
3117 RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");