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 for Bake Options */
44 #include "RE_pipeline.h"
47 #include "quicktime_export.h"
48 #include "AUD_C-API.h"
52 #include "BKE_writeffmpeg.h"
53 #include <libavcodec/avcodec.h>
54 #include <libavformat/avformat.h>
60 #include "BLI_threads.h"
62 EnumPropertyItem snap_target_items[] = {
63 {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
64 {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target"},
65 {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
66 {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
67 {0, NULL, 0, NULL, NULL}};
69 EnumPropertyItem proportional_falloff_items[] ={
70 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
71 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
72 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
73 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
74 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", ""},
75 {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", ""},
76 {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
77 {0, NULL, 0, NULL, NULL}};
80 EnumPropertyItem proportional_editing_items[] = {
81 {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"},
82 {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"},
83 {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", "Proportional Editing using connected geometry only"},
84 {0, NULL, 0, NULL, NULL}};
86 /* keep for operators, not used here */
87 EnumPropertyItem mesh_select_mode_items[] = {
88 {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
89 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
90 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
91 {0, NULL, 0, NULL, NULL}};
93 EnumPropertyItem snap_element_items[] = {
94 {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid"},
95 {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
96 {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"},
97 {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces"},
98 {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"},
99 {0, NULL, 0, NULL, NULL}};
101 EnumPropertyItem image_type_items[] = {
102 {0, "", 0, "Image", NULL},
103 {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""},
105 {R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""},
107 {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""},
108 {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""},
109 {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""},
111 {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""},
113 {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""},
114 {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", ""},
115 {0, "", 0, " ", NULL},
117 {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""},
118 {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", ""},
121 {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""},
122 {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""},
125 {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", ""},
128 {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""},
130 {0, "", 0, "Movie", NULL},
132 {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""}, // XXX Missing codec menu
134 {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", ""},
135 {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", ""},
136 {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
138 {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
139 {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", ""},
140 {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
142 #ifdef WITH_QUICKTIME
144 {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", ""},
146 {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", ""},
150 {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""},
152 {0, NULL, 0, NULL, NULL}};
156 #include "DNA_anim_types.h"
157 #include "DNA_node_types.h"
158 #include "DNA_object_types.h"
159 #include "DNA_mesh_types.h"
161 #include "RNA_access.h"
163 #include "MEM_guardedalloc.h"
165 #include "BLI_threads.h"
166 #include "BLI_editVert.h"
167 #include "BLI_blenlib.h"
169 #include "BKE_context.h"
170 #include "BKE_global.h"
171 #include "BKE_image.h"
172 #include "BKE_main.h"
173 #include "BKE_node.h"
174 #include "BKE_pointcache.h"
175 #include "BKE_scene.h"
176 #include "BKE_depsgraph.h"
177 #include "BKE_image.h"
178 #include "BKE_mesh.h"
179 #include "BKE_sound.h"
180 #include "BKE_screen.h"
181 #include "BKE_animsys.h"
187 #include "ED_view3d.h"
189 #include "ED_keyframing.h"
191 #include "RE_pipeline.h"
193 static int rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
195 Scene *scene= (Scene*)ptr->data;
198 for(base= scene->base.first; base; base= base->next) {
199 if(strncmp(base->object->id.name+2, key, sizeof(base->object->id.name)-2)==0) {
200 *r_ptr= rna_pointer_inherit_refine(ptr, &RNA_ObjectBase, base);
208 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
210 ListBaseIterator *internal= iter->internal;
212 /* we are actually iterating a Base list, so override get */
213 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
216 static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
218 Scene *scene_act= CTX_data_scene(C);
221 if (object_in_scene(ob, scene)) {
222 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
226 base= scene_add_base(scene, ob);
229 /* this is similar to what object_add_type and add_object do */
230 base->lay= scene->lay;
232 /* when linking to an inactive scene dont touch the layer */
233 if(scene == scene_act)
236 ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
238 /* slows down importers too much, run scene.update() */
239 /* DAG_scene_sort(G.main, scene); */
241 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
246 static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
248 Base *base= object_in_scene(ob, scene);
250 BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'.", ob->id.name+2, scene->id.name+2);
253 if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
254 BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink.", ob->id.name+2);
257 if(scene->basact==base) {
261 BLI_remlink(&scene->base, base);
266 /* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
267 DAG_scene_sort(G.main, scene);
268 DAG_ids_flush_update(G.main, 0);
270 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
273 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
275 ToolSettings *ts = (ToolSettings*)ptr->data;
276 if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
277 ts->skgen_template = value.data;
279 ts->skgen_template = NULL;
282 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
284 Scene *scene= (Scene*)ptr->data;
285 return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
288 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
290 Scene *scene= (Scene*)ptr->data;
292 scene->basact= object_in_scene((Object*)value.data, scene);
297 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
299 Scene *scene= (Scene*)ptr->data;
300 Scene *set= (Scene*)value.data;
303 for(nested_set= set; nested_set; nested_set= nested_set->set) {
304 if(nested_set==scene)
311 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
313 Scene *scene= (Scene*)ptr->data;
315 scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
318 static void rna_Scene_view3d_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr)
320 Scene *scene= (Scene*)ptr->data;
322 BKE_screen_view3d_main_sync(&bmain->screen, scene);
325 static void rna_Scene_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
327 rna_Scene_view3d_update(bmain, scene, ptr);
328 DAG_on_visible_update(bmain, FALSE);
331 static void rna_Scene_framelen_update(Main *bmain, Scene *scene, PointerRNA *ptr)
333 scene->r.framelen= (float)scene->r.framapto/(float)scene->r.images;
337 static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
339 Scene *data= (Scene*)ptr->data;
341 /* if negative frames aren't allowed, then we can't use them */
342 FRAMENUMBER_MIN_CLAMP(value);
346 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
348 Scene *data= (Scene*)ptr->data;
349 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
350 CLAMP(value, MINFRAME, data->r.efra);
354 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
356 Scene *data= (Scene*)ptr->data;
357 CLAMP(value, data->r.sfra, MAXFRAME);
361 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
363 Scene *data= (Scene*)ptr->data;
366 /* copy range from scene if not set before */
367 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
368 data->r.psfra= data->r.sfra;
369 data->r.pefra= data->r.efra;
372 data->r.flag |= SCER_PRV_RANGE;
375 data->r.flag &= ~SCER_PRV_RANGE;
379 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
381 Scene *data= (Scene*)ptr->data;
383 /* check if enabled already */
384 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
385 /* set end of preview range to end frame, then clamp as per normal */
386 // TODO: or just refuse to set instead?
387 data->r.pefra= data->r.efra;
390 /* now set normally */
391 CLAMP(value, MINAFRAME, data->r.pefra);
392 data->r.psfra= value;
395 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
397 Scene *data= (Scene*)ptr->data;
399 /* check if enabled already */
400 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
401 /* set start of preview range to start frame, then clamp as per normal */
402 // TODO: or just refuse to set instead?
403 data->r.psfra= data->r.sfra;
406 /* now set normally */
407 CLAMP(value, data->r.psfra, MAXFRAME);
408 data->r.pefra= value;
411 static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
413 //Scene *scene= ptr->id.data;
414 //ED_update_for_newframe(C);
418 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
420 Scene *scene= (Scene *)ptr->data;
421 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
424 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
426 Scene *scene= (Scene *)ptr->data;
427 KeyingSet *ks= (KeyingSet*)value.data;
429 scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
432 /* get KeyingSet index stuff for list of Keying Sets editing UI
433 * - active_keyingset-1 since 0 is reserved for 'none'
434 * - don't clamp, otherwise can never set builtins types as active...
436 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
438 Scene *scene= (Scene *)ptr->data;
439 return scene->active_keyingset-1;
442 /* get KeyingSet index stuff for list of Keying Sets editing UI
443 * - value+1 since 0 is reserved for 'none'
445 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
447 Scene *scene= (Scene *)ptr->data;
448 scene->active_keyingset= value+1;
451 // XXX: evil... builtin_keyingsets is defined in keyingsets.c!
452 // TODO: make API function to retrieve this...
453 extern ListBase builtin_keyingsets;
455 static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
457 Scene *scene= (Scene*)ptr->data;
459 /* start going over the scene KeyingSets first, while we still have pointer to it
460 * but only if we have any Keying Sets to use...
462 if (scene->keyingsets.first)
463 rna_iterator_listbase_begin(iter, &scene->keyingsets, NULL);
465 rna_iterator_listbase_begin(iter, &builtin_keyingsets, NULL);
468 static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
470 ListBaseIterator *internal= iter->internal;
471 KeyingSet *ks= (KeyingSet*)internal->link;
473 /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
474 if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
475 internal->link= (Link*)builtin_keyingsets.first;
477 internal->link= (Link*)ks->next;
479 iter->valid= (internal->link != NULL);
483 static char *rna_RenderSettings_path(PointerRNA *ptr)
485 return BLI_sprintfN("render");
488 static int rna_RenderSettings_threads_get(PointerRNA *ptr)
490 RenderData *rd= (RenderData*)ptr->data;
492 if(rd->mode & R_FIXED_THREADS)
495 return BLI_system_thread_count();
498 static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
500 RenderData *rd= (RenderData*)ptr->data;
501 return BKE_imtype_is_movie(rd->imtype);
504 static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
506 RenderData *rd= (RenderData*)ptr->data;
507 if(rd->mode & R_BORDER)
510 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
513 static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
515 RenderData *rd= (RenderData*)ptr->data;
517 return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
520 static void rna_RenderSettings_file_format_set(PointerRNA *ptr, int value)
522 RenderData *rd= (RenderData*)ptr->data;
526 ffmpeg_verify_image_type(rd);
528 #ifdef WITH_QUICKTIME
529 quicktime_verify_image_type(rd);
533 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
535 RenderData *rd= (RenderData*)ptr->data;
538 BKE_add_image_extension(ext, rd->imtype);
542 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
544 RenderData *rd= (RenderData*)ptr->data;
545 BKE_add_image_extension(str, rd->imtype);
548 void rna_RenderSettings_jpeg2k_preset_update(RenderData *rd)
550 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
552 switch(rd->jp2_depth) {
554 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
555 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
558 switch(rd->jp2_preset) {
559 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
560 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
561 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
562 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
563 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
564 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
565 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
570 static void rna_RenderSettings_jpeg2k_preset_set(PointerRNA *ptr, int value)
572 RenderData *rd= (RenderData*)ptr->data;
573 rd->jp2_preset= value;
574 rna_RenderSettings_jpeg2k_preset_update(rd);
577 static void rna_RenderSettings_jpeg2k_depth_set(PointerRNA *ptr, int value)
579 RenderData *rd= (RenderData*)ptr->data;
580 rd->jp2_depth= value;
581 rna_RenderSettings_jpeg2k_preset_update(rd);
585 #ifdef WITH_QUICKTIME
586 static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
588 RenderData *rd= (RenderData*)ptr->data;
590 return quicktime_rnatmpvalue_from_videocodectype(rd->qtcodecsettings.codecType);
593 static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
595 RenderData *rd= (RenderData*)ptr->data;
597 rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
600 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, int *free)
602 EnumPropertyItem *item= NULL;
603 EnumPropertyItem tmp = {0, "", 0, "", ""};
604 QuicktimeCodecTypeDesc *codecTypeDesc;
608 for(i=0;i<quicktime_get_num_videocodecs();i++) {
609 codecTypeDesc = quicktime_get_videocodecType_desc(i);
610 if (!codecTypeDesc) break;
612 tmp.value= codecTypeDesc->rnatmpvalue;
613 *((int*)id) = codecTypeDesc->codecType;
616 tmp.name= codecTypeDesc->codecName;
617 RNA_enum_item_add(&item, &totitem, &tmp);
620 RNA_enum_item_end(&item, &totitem);
627 static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
629 RenderData *rd= (RenderData*)ptr->data;
631 return quicktime_rnatmpvalue_from_audiocodectype(rd->qtcodecsettings.audiocodecType);
634 static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
636 RenderData *rd= (RenderData*)ptr->data;
638 rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
641 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr, int *free)
643 EnumPropertyItem *item= NULL;
644 EnumPropertyItem tmp = {0, "", 0, "", ""};
645 QuicktimeCodecTypeDesc *codecTypeDesc;
648 for(i=0;i<quicktime_get_num_audiocodecs();i++) {
649 codecTypeDesc = quicktime_get_audiocodecType_desc(i);
650 if (!codecTypeDesc) break;
652 tmp.value= codecTypeDesc->rnatmpvalue;
653 tmp.identifier= codecTypeDesc->codecName;
654 tmp.name= codecTypeDesc->codecName;
655 RNA_enum_item_add(&item, &totitem, &tmp);
658 RNA_enum_item_end(&item, &totitem);
666 static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
668 RenderData *rd= (RenderData*)ptr->data;
672 static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
674 RenderData *rd= (RenderData*)ptr->data;
678 static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
680 RenderData *rd= (RenderData*)ptr->data;
683 *max= BLI_countlist(&rd->layers)-1;
687 static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
689 RenderData *rd= (RenderData*)ptr->data;
690 SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
692 return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
695 static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
697 RenderData *rd= (RenderData*)ptr->data;
698 SceneRenderLayer *srl= (SceneRenderLayer*)value.data;
700 rd->actlay = BLI_findindex(&rd->layers, srl);
703 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
705 RenderData *rd= (RenderData*)ptr->data;
706 RenderEngineType *type= BLI_findlink(&R_engines, value);
709 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
712 static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *C, PointerRNA *ptr, int *free)
714 RenderEngineType *type;
715 EnumPropertyItem *item= NULL;
716 EnumPropertyItem tmp = {0, "", 0, "", ""};
719 for(type=R_engines.first; type; type=type->next, a++) {
721 tmp.identifier= type->idname;
722 tmp.name= type->name;
723 RNA_enum_item_add(&item, &totitem, &tmp);
726 RNA_enum_item_end(&item, &totitem);
732 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
734 RenderData *rd= (RenderData*)ptr->data;
735 RenderEngineType *type;
738 for(type=R_engines.first; type; type=type->next, a++)
739 if(strcmp(type->idname, rd->engine) == 0)
745 static void rna_Scene_glsl_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr)
747 Scene *scene= (Scene*)ptr->id.data;
749 DAG_id_tag_update(&scene->id, 0);
752 static void rna_RenderSettings_color_management_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr)
754 /* reset image nodes */
755 Scene *scene= (Scene*)ptr->id.data;
756 bNodeTree *ntree=scene->nodetree;
759 if(ntree && scene->use_nodes) {
760 /* XXX images are freed here, stop render and preview threads, until Image is threadsafe */
761 WM_jobs_stop_all(bmain->wm.first);
763 for (node=ntree->nodes.first; node; node=node->next) {
764 if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
765 ED_node_changed_update(&scene->id, node);
766 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
768 if (node->type == CMP_NODE_IMAGE)
769 BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
774 rna_Scene_glsl_update(bmain, scene, ptr);
777 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
779 Scene *scene= (Scene*)ptr->id.data;
780 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
782 BLI_strncpy(rl->name, value, sizeof(rl->name));
784 if(scene->nodetree) {
786 int index= BLI_findindex(&scene->r.layers, rl);
788 for(node= scene->nodetree->nodes.first; node; node= node->next) {
789 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
790 if(node->custom1==index)
791 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
797 static int rna_RenderSettings_multiple_engines_get(PointerRNA *ptr)
799 return (BLI_countlist(&R_engines) > 1);
802 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
804 RenderData *rd= (RenderData*)ptr->data;
805 RenderEngineType *type;
807 for(type=R_engines.first; type; type=type->next)
808 if(strcmp(type->idname, rd->engine) == 0)
809 return (type->flag & RE_GAME);
814 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
816 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
817 rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL);
820 static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr)
822 Scene *scene= (Scene*)ptr->id.data;
825 ntreeCompositForceHidden(scene->nodetree, scene);
828 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
830 Scene *scene= (Scene*)ptr->data;
832 scene->use_nodes= value;
833 if(scene->use_nodes && scene->nodetree==NULL)
834 ED_node_composit_default(scene);
837 static void rna_Physics_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr)
839 Scene *scene= (Scene*)ptr->id.data;
842 for(base = scene->base.first; base; base=base->next)
843 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
846 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
848 Scene *scene= (Scene*)ptr->id.data;
849 ToolSettings *ts = (ToolSettings*)ptr->data;
850 int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
853 ts->selectmode = flag;
856 Mesh *me= get_mesh(scene->basact->object);
857 if(me && me->edit_mesh && me->edit_mesh->selectmode != flag) {
858 me->edit_mesh->selectmode= flag;
859 EM_selectmode_set(me->edit_mesh);
865 static void rna_Scene_editmesh_select_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
870 me= get_mesh(scene->basact->object);
871 if(me && me->edit_mesh==NULL)
875 WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
876 WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
879 static void object_simplify_update(Object *ob)
882 ParticleSystem *psys;
884 for(md=ob->modifiers.first; md; md=md->next)
885 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
886 ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
888 for(psys=ob->particlesystem.first; psys; psys=psys->next)
889 psys->recalc |= PSYS_RECALC_CHILD;
894 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
895 object_simplify_update(gob->ob);
899 static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
904 for(SETLOOPER(scene, sce_iter, base))
905 object_simplify_update(base->object);
907 DAG_ids_flush_update(bmain, 0);
908 WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
911 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
913 if(scene->r.mode & R_SIMPLIFY)
914 rna_Scene_use_simplify_update(bmain, scene, ptr);
917 static int rna_Scene_use_audio_get(PointerRNA *ptr)
919 Scene *scene= (Scene*)ptr->data;
920 return scene->audio.flag & AUDIO_MUTE;
923 static void rna_Scene_use_audio_set(PointerRNA *ptr, int value)
925 Scene *scene= (Scene*)ptr->data;
928 scene->audio.flag |= AUDIO_MUTE;
930 scene->audio.flag &= ~AUDIO_MUTE;
932 sound_mute_scene(scene, value);
935 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
937 Scene *scene= (Scene*)ptr->data;
938 if(scene->audio.flag & AUDIO_SYNC)
940 return scene->flag & SCE_FRAME_DROP;
943 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
945 Scene *scene= (Scene*)ptr->data;
947 if(value == AUDIO_SYNC)
948 scene->audio.flag |= AUDIO_SYNC;
949 else if(value == SCE_FRAME_DROP)
951 scene->audio.flag &= ~AUDIO_SYNC;
952 scene->flag |= SCE_FRAME_DROP;
956 scene->audio.flag &= ~AUDIO_SYNC;
957 scene->flag &= ~SCE_FRAME_DROP;
961 static int rna_GameSettings_auto_start_get(PointerRNA *ptr)
963 if (G.fileflags & G_FILE_AUTOPLAY)
969 static void rna_GameSettings_auto_start_set(PointerRNA *ptr, int value)
972 G.fileflags |= G_FILE_AUTOPLAY;
974 G.fileflags &= ~G_FILE_AUTOPLAY;
978 static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[])
980 TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
981 marker->flag= SELECT;
983 BLI_strncpy(marker->name, name, sizeof(marker->name));
984 BLI_addtail(&scene->markers, marker);
988 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker)
990 /* try to remove the F-Curve from the action */
991 if (!BLI_remlink_safe(&scene->markers, marker)) {
992 BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in action '%s'", marker->name, scene->id.name+2);
996 /* XXX, invalidates PyObject */
1000 static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, const char name[])
1002 KeyingSet *ks= NULL;
1004 /* call the API func, and set the active keyingset index */
1005 ks= BKE_keyingset_add(&sce->keyingsets, name, KEYINGSET_ABSOLUTE, 0);
1008 sce->active_keyingset= BLI_countlist(&sce->keyingsets);
1012 BKE_report(reports, RPT_ERROR, "Keying Set could not be added.");
1019 static void rna_def_transform_orientation(BlenderRNA *brna)
1024 const int matrix_dimsize[]= {3, 3};
1026 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
1028 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
1029 RNA_def_property_float_sdna(prop, NULL, "mat");
1030 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
1031 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1033 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1034 RNA_def_property_string_sdna(prop, NULL, "name");
1035 RNA_def_struct_name_property(srna, prop);
1036 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1039 static void rna_def_tool_settings(BlenderRNA *brna)
1044 static EnumPropertyItem uv_select_mode_items[] = {
1045 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
1046 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
1047 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
1048 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
1049 {0, NULL, 0, NULL, NULL}};
1051 static EnumPropertyItem auto_key_items[] = {
1052 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
1053 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
1054 {0, NULL, 0, NULL, NULL}};
1056 static EnumPropertyItem retarget_roll_items[] = {
1057 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
1058 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
1059 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
1060 {0, NULL, 0, NULL, NULL}};
1062 static EnumPropertyItem sketch_convert_items[] = {
1063 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
1064 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
1065 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts"},
1066 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
1067 {0, NULL, 0, NULL, NULL}};
1069 static EnumPropertyItem edge_tag_items[] = {
1070 {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
1071 {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
1072 {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
1073 {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
1074 {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
1075 {0, NULL, 0, NULL, NULL}};
1077 srna= RNA_def_struct(brna, "ToolSettings", NULL);
1078 RNA_def_struct_ui_text(srna, "Tool Settings", "");
1080 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
1081 RNA_def_property_struct_type(prop, "Sculpt");
1082 RNA_def_property_ui_text(prop, "Sculpt", "");
1084 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
1085 RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
1086 RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
1087 "Ensure all bone-deforming vertex groups add up to 1.0 while "
1090 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
1091 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
1092 RNA_def_property_ui_text(prop, "Vertex Paint", "");
1094 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
1095 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
1096 RNA_def_property_ui_text(prop, "Weight Paint", "");
1098 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
1099 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
1100 RNA_def_property_ui_text(prop, "Image Paint", "");
1102 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
1103 RNA_def_property_pointer_sdna(prop, NULL, "particle");
1104 RNA_def_property_ui_text(prop, "Particle Edit", "");
1107 prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
1108 RNA_def_property_enum_sdna(prop, NULL, "proportional");
1109 RNA_def_property_enum_items(prop, proportional_editing_items);
1110 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional Editing mode, allows transforms with distance fall-off");
1111 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1113 prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
1114 RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
1115 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing object mode");
1116 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
1117 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1119 prop= RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
1120 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
1121 RNA_def_property_enum_items(prop, proportional_falloff_items);
1122 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
1123 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1125 prop= RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
1126 RNA_def_property_float_sdna(prop, NULL, "proportional_size");
1127 RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle");
1128 RNA_def_property_range(prop, 0.00001, 5000.0);
1130 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
1131 RNA_def_property_float_sdna(prop, NULL, "normalsize");
1132 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
1133 RNA_def_property_range(prop, 0.00001, 1000.0);
1134 RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
1135 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
1137 prop= RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
1138 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
1139 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
1141 prop= RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
1142 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
1143 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
1144 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
1145 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1147 prop= RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
1148 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
1149 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
1150 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
1151 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1153 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
1154 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
1155 RNA_def_property_enum_items(prop, snap_element_items);
1156 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
1157 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1159 prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
1160 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
1161 RNA_def_property_enum_items(prop, snap_target_items);
1162 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
1163 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1165 prop= RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
1166 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
1167 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
1168 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
1169 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1171 prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
1172 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
1173 RNA_def_property_ui_text(prop, "Project Individual Elements", "Project individual elements on the surface of other objects");
1174 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
1175 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1178 prop = RNA_def_property(srna, "use_grease_pencil_sessions", PROP_BOOLEAN, PROP_NONE);
1179 RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINTSESSIONS_ON);
1180 RNA_def_property_ui_text(prop, "Use Sketching Sessions", "Allow drawing multiple strokes at a time with Grease Pencil");
1181 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); // xxx: need toolbar to be redrawn...
1184 prop= RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
1185 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
1186 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
1187 RNA_def_property_ui_icon(prop, ICON_REC, 0);
1189 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
1190 RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
1191 RNA_def_property_enum_items(prop, auto_key_items);
1192 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
1194 prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
1195 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
1196 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");
1198 prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
1199 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
1200 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set only");
1201 RNA_def_property_ui_icon(prop, ICON_KEY_HLT, 0); // XXX: we need a dedicated icon
1204 prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
1205 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
1206 RNA_def_property_enum_items(prop, uv_select_mode_items);
1207 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
1208 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1210 prop= RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
1211 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
1212 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
1213 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1214 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1216 prop= RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
1217 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
1218 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
1219 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1222 prop= RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
1223 RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
1224 RNA_def_property_array(prop, 3);
1225 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
1226 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
1227 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
1229 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
1230 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
1231 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
1233 /* use with MESH_OT_select_shortest_path */
1234 prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
1235 RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
1236 RNA_def_property_enum_items(prop, edge_tag_items);
1237 RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
1239 prop= RNA_def_property(srna, "edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
1240 RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1);
1241 RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edges seam re-calculates UV unwrap");
1244 prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
1245 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
1246 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
1247 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1249 prop= RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
1250 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
1251 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
1253 prop= RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
1254 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
1255 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
1257 prop= RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
1258 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
1259 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
1261 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
1262 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1263 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
1265 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
1266 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1267 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
1269 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
1270 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
1271 RNA_def_property_flag(prop, PROP_EDITABLE);
1272 RNA_def_property_struct_type(prop, "Object");
1273 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
1274 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
1276 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
1277 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
1278 RNA_def_property_range(prop, 1, 255);
1279 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
1280 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1282 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
1283 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
1284 RNA_def_property_range(prop, 0.00001, 1.0);
1285 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
1286 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
1287 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1289 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
1290 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
1291 RNA_def_property_range(prop, 0.00001, 100000.0);
1292 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1293 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
1294 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1296 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
1297 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
1298 RNA_def_property_enum_items(prop, retarget_roll_items);
1299 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
1301 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
1302 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
1303 RNA_def_property_enum_items(prop, sketch_convert_items);
1304 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
1305 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1307 /* Sculpt/Paint Unified Size and Strength */
1309 prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
1310 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
1311 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius", "Instead of per brush radius, the radius is shared across brushes");
1313 prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
1314 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
1315 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength", "Instead of per brush strength, the strength is shared across brushes");
1319 static void rna_def_unit_settings(BlenderRNA *brna)
1324 static EnumPropertyItem unit_systems[] = {
1325 {USER_UNIT_NONE, "NONE", 0, "None", ""},
1326 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
1327 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
1328 {0, NULL, 0, NULL, NULL}};
1330 static EnumPropertyItem rotation_units[] = {
1331 {0, "DEGREES", 0, "Degrees", ""},
1332 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
1333 {0, NULL, 0, NULL, NULL}};
1335 srna= RNA_def_struct(brna, "UnitSettings", NULL);
1336 RNA_def_struct_ui_text(srna, "Unit Settings", "");
1339 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
1340 RNA_def_property_enum_items(prop, unit_systems);
1341 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
1342 RNA_def_property_update(prop, NC_WINDOW, NULL);
1344 prop= RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
1345 RNA_def_property_enum_items(prop, rotation_units);
1346 RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
1347 RNA_def_property_update(prop, NC_WINDOW, NULL);
1349 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
1350 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
1351 RNA_def_property_range(prop, 0.00001, 100000.0);
1352 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1353 RNA_def_property_update(prop, NC_WINDOW, NULL);
1355 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
1356 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
1357 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs");
1358 RNA_def_property_update(prop, NC_WINDOW, NULL);
1361 void rna_def_render_layer_common(StructRNA *srna, int scene)
1365 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1366 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
1367 else RNA_def_property_string_sdna(prop, NULL, "name");
1368 RNA_def_property_ui_text(prop, "Name", "Render layer name");
1369 RNA_def_struct_name_property(srna, prop);
1370 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1371 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1373 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
1374 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
1375 RNA_def_property_struct_type(prop, "Material");
1376 RNA_def_property_flag(prop, PROP_EDITABLE);
1377 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
1378 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1379 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1381 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
1382 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
1383 RNA_def_property_struct_type(prop, "Group");
1384 RNA_def_property_flag(prop, PROP_EDITABLE);
1385 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
1386 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1387 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1390 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1391 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1392 RNA_def_property_array(prop, 20);
1393 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
1394 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
1395 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
1396 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1397 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1399 prop= RNA_def_property(srna, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
1400 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
1401 RNA_def_property_array(prop, 20);
1402 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers");
1403 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1404 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1407 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
1408 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
1409 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
1410 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1411 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1413 prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
1414 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
1415 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
1416 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1417 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1419 prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
1420 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
1421 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
1422 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1423 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1425 prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
1426 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
1427 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
1428 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1429 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1431 prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
1432 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
1433 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
1434 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1435 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1437 prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
1438 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
1439 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
1440 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1441 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1443 prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
1444 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
1445 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
1446 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1447 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1449 prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
1450 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
1451 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
1452 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1453 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1455 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
1456 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
1457 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
1458 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1459 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1461 prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
1462 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
1463 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
1464 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1465 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1468 prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
1469 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
1470 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
1471 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1472 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1474 prop= RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
1475 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
1476 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
1477 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1478 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1480 prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
1481 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
1482 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
1483 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1484 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1486 prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
1487 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
1488 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
1489 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1490 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1492 prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
1493 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
1494 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
1495 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1496 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1498 prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
1499 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
1500 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
1501 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1502 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1504 prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
1505 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
1506 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
1507 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1508 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1510 prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
1511 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
1512 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
1513 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1514 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1516 prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
1517 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
1518 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
1519 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1520 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1522 prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
1523 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
1524 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
1525 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1526 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1528 prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
1529 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
1530 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
1531 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1532 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1534 prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1535 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
1536 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
1537 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1538 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1540 prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
1541 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
1542 RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
1543 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1544 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1546 prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
1547 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
1548 RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
1549 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1550 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1552 prop= RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
1553 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
1554 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
1555 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1556 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1558 prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
1559 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
1560 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
1561 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1562 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1564 prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
1565 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
1566 RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
1567 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1568 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1570 prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
1571 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
1572 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
1573 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1574 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1575 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1577 prop= RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
1578 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
1579 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
1580 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1581 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1582 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1584 prop= RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1585 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
1586 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
1587 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1588 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1589 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1591 prop= RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
1592 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
1593 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
1594 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1595 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1596 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1598 prop= RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
1599 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
1600 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
1601 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1602 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1603 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1605 prop= RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
1606 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
1607 RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
1608 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1609 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1610 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1612 prop= RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
1613 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
1614 RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
1615 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1616 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1617 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1619 prop= RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
1620 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
1621 RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
1622 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1623 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1624 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1627 static void rna_def_scene_game_data(BlenderRNA *brna)
1632 static EnumPropertyItem framing_types_items[] ={
1633 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
1634 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1635 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1636 {0, NULL, 0, NULL, NULL}};
1638 static EnumPropertyItem dome_modes_items[] ={
1639 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1640 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1641 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1642 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1643 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1644 {0, NULL, 0, NULL, NULL}};
1646 static EnumPropertyItem stereo_modes_items[] ={
1647 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1648 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1649 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1650 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1651 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1652 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1653 {0, NULL, 0, NULL, NULL}};
1655 static EnumPropertyItem stereo_items[] ={
1656 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
1657 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
1658 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
1659 {0, NULL, 0, NULL, NULL}};
1661 static EnumPropertyItem physics_engine_items[] = {
1662 {WOPHY_NONE, "NONE", 0, "None", ""},
1663 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1664 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1665 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1666 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1667 {WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
1668 {0, NULL, 0, NULL, NULL}};
1670 static EnumPropertyItem material_items[] ={
1671 {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials"},
1672 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
1673 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
1674 {0, NULL, 0, NULL, NULL}};
1676 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1677 RNA_def_struct_sdna(srna, "GameData");
1678 RNA_def_struct_nested(brna, srna, "Scene");
1679 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
1681 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1682 RNA_def_property_int_sdna(prop, NULL, "xplay");
1683 RNA_def_property_range(prop, 4, 10000);
1684 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
1685 RNA_def_property_update(prop, NC_SCENE, NULL);
1687 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1688 RNA_def_property_int_sdna(prop, NULL, "yplay");
1689 RNA_def_property_range(prop, 4, 10000);
1690 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
1691 RNA_def_property_update(prop, NC_SCENE, NULL);
1693 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
1694 RNA_def_property_int_sdna(prop, NULL, "depth");
1695 RNA_def_property_range(prop, 8, 32);
1696 RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
1697 RNA_def_property_update(prop, NC_SCENE, NULL);
1699 // Do we need it here ? (since we already have it in World
1700 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1701 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1702 RNA_def_property_range(prop, 4, 2000);
1703 RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display");
1704 RNA_def_property_update(prop, NC_SCENE, NULL);
1706 prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
1707 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1708 RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
1709 RNA_def_property_update(prop, NC_SCENE, NULL);
1712 prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
1713 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1714 RNA_def_property_enum_items(prop, framing_types_items);
1715 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
1716 RNA_def_property_update(prop, NC_SCENE, NULL);
1718 prop= RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
1719 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1720 RNA_def_property_range(prop, 0.0f, 1.0f);
1721 RNA_def_property_array(prop, 3);
1722 RNA_def_property_ui_text(prop, "Framing Color", "Set color of the bars");
1723 RNA_def_property_update(prop, NC_SCENE, NULL);
1726 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1727 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1728 RNA_def_property_enum_items(prop, stereo_items);
1729 RNA_def_property_ui_text(prop, "Stereo Options", "");
1730 RNA_def_property_update(prop, NC_SCENE, NULL);
1732 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1733 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1734 RNA_def_property_enum_items(prop, stereo_modes_items);
1735 RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
1736 RNA_def_property_update(prop, NC_SCENE, NULL);
1738 prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
1739 RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
1740 RNA_def_property_range(prop, 0.01, 5.0);
1741 RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
1742 RNA_def_property_update(prop, NC_SCENE, NULL);
1745 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1746 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1747 RNA_def_property_enum_items(prop, dome_modes_items);
1748 RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
1749 RNA_def_property_update(prop, NC_SCENE, NULL);
1751 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1752 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1753 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1754 RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
1755 RNA_def_property_update(prop, NC_SCENE, NULL);
1757 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1758 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1759 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1760 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1761 RNA_def_property_update(prop, NC_SCENE, NULL);
1763 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1764 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1765 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1766 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1767 RNA_def_property_update(prop, NC_SCENE, NULL);
1769 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1770 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1771 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1772 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1773 RNA_def_property_update(prop, NC_SCENE, NULL);
1775 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
1776 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
1777 RNA_def_property_struct_type(prop, "Text");
1778 RNA_def_property_flag(prop, PROP_EDITABLE);
1779 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
1780 RNA_def_property_update(prop, NC_SCENE, NULL);
1783 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
1784 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
1785 RNA_def_property_enum_items(prop, physics_engine_items);
1786 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
1787 RNA_def_property_update(prop, NC_SCENE, NULL);
1789 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
1790 RNA_def_property_float_sdna(prop, NULL, "gravity");
1791 RNA_def_property_ui_range(prop, 0.0, 25.0, 1, 2);
1792 RNA_def_property_range(prop, 0.0, 10000.0);
1793 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
1794 RNA_def_property_update(prop, NC_SCENE, NULL);
1796 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_INT, PROP_NONE);
1797 RNA_def_property_int_sdna(prop, NULL, "occlusionRes");
1798 RNA_def_property_range(prop, 128.0, 1024.0);
1799 RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
1800 RNA_def_property_update(prop, NC_SCENE, NULL);
1802 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1803 RNA_def_property_int_sdna(prop, NULL, "ticrate");
1804 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
1805 RNA_def_property_range(prop, 1, 250);
1806 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");
1807 RNA_def_property_update(prop, NC_SCENE, NULL);
1809 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
1810 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
1811 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1812 RNA_def_property_range(prop, 1, 5);
1813 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");
1814 RNA_def_property_update(prop, NC_SCENE, NULL);
1816 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
1817 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
1818 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1819 RNA_def_property_range(prop, 1, 5);
1820 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");
1821 RNA_def_property_update(prop, NC_SCENE, NULL);
1823 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
1824 RNA_def_property_int_sdna(prop, NULL, "physubstep");
1825 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1826 RNA_def_property_range(prop, 1, 5);
1827 RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
1828 RNA_def_property_update(prop, NC_SCENE, NULL);
1831 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
1832 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
1833 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
1835 // not used // deprecated !!!!!!!!!!!!!
1836 prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
1837 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
1838 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
1840 // not used // deprecated !!!!!!!!!!!!!
1841 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
1842 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
1843 RNA_def_property_range(prop, 0.0, 1000.0);
1844 RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
1847 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
1848 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
1849 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
1851 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
1852 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
1853 RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs");
1855 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
1856 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
1857 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
1859 prop= RNA_def_property(srna, "show_mouse", PROP_BOOLEAN, PROP_NONE);
1860 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_MOUSE);
1861 RNA_def_property_ui_text(prop, "Show Mouse", "Start player with a visible mouse cursor");
1863 prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
1864 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
1865 RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
1867 prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
1868 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
1869 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
1871 prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
1872 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
1873 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
1875 prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
1876 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
1877 RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
1879 prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
1880 RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
1881 RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
1884 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
1885 RNA_def_property_enum_sdna(prop, NULL, "matmode");
1886 RNA_def_property_enum_items(prop, material_items);
1887 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
1888 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1890 prop= RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
1891 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
1892 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
1893 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1895 prop= RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
1896 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
1897 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
1898 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1900 prop= RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
1901 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
1902 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
1903 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1905 prop= RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
1906 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
1907 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
1908 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1910 prop= RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
1911 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
1912 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
1913 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1915 prop= RNA_def_property(srna, "use_glsl_color_management", PROP_BOOLEAN, PROP_NONE);
1916 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_COLOR_MANAGEMENT);
1917 RNA_def_property_ui_text(prop, "GLSL Color Management", "Use color management for GLSL rendering");
1918 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1920 prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
1921 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
1922 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
1923 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1926 static void rna_def_scene_render_layer(BlenderRNA *brna)
1930 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
1931 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
1932 RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
1934 rna_def_render_layer_common(srna, 1);
1938 static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
1943 // FunctionRNA *func;
1944 // PropertyRNA *parm;
1946 RNA_def_property_srna(cprop, "RenderLayers");
1947 srna= RNA_def_struct(brna, "RenderLayers", NULL);
1948 RNA_def_struct_sdna(srna, "RenderData");
1949 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
1951 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
1952 RNA_def_property_int_sdna(prop, NULL, "actlay");
1953 RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
1954 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
1955 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1957 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
1958 RNA_def_property_struct_type(prop, "SceneRenderLayer");
1959 RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get", "rna_RenderSettings_active_layer_set", NULL, NULL);
1960 RNA_def_property_flag(prop, PROP_EDITABLE);
1961 RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
1962 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1966 static void rna_def_scene_render_data(BlenderRNA *brna)
1971 static EnumPropertyItem pixel_filter_items[] ={
1972 {R_FILTER_BOX, "BOX", 0, "Box", ""},
1973 {R_FILTER_TENT, "TENT", 0, "Tent", ""},
1974 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""},
1975 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""},
1976 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""},
1977 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""},
1978 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""},
1979 {0, NULL, 0, NULL, NULL}};
1981 static EnumPropertyItem alpha_mode_items[] ={
1982 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
1983 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
1984 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
1985 {0, NULL, 0, NULL, NULL}};
1987 static EnumPropertyItem color_mode_items[] ={
1988 {R_PLANESBW, "BW", 0, "BW", "Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)"},
1989 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
1990 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
1991 {0, NULL, 0, NULL, NULL}};
1993 static EnumPropertyItem display_mode_items[] ={
1994 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
1995 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
1996 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
1997 {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes, optionally showing result"},
1998 {0, NULL, 0, NULL, NULL}};
2001 static EnumPropertyItem bake_mode_items[] ={
2002 {RE_BAKE_ALL, "FULL", 0, "Full Render", ""},
2003 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""},
2004 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""},
2005 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""},
2006 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""},
2007 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""},
2008 {0, NULL, 0, NULL, NULL}};
2010 static EnumPropertyItem bake_normal_space_items[] ={
2011 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""},
2012 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""},
2013 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""},
2014 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
2015 {0, NULL, 0, NULL, NULL}};
2017 static EnumPropertyItem bake_qyad_split_items[] ={
2018 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
2019 {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
2020 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
2021 {0, NULL, 0, NULL, NULL}};
2023 static EnumPropertyItem octree_resolution_items[] = {
2024 {64, "64", 0, "64", ""},
2025 {128, "128", 0, "128", ""},
2026 {256, "256", 0, "256", ""},
2027 {512, "512", 0, "512", ""},
2028 {0, NULL, 0, NULL, NULL}};
2030 static EnumPropertyItem raytrace_structure_items[] = {
2031 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""},
2032 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"},
2033 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
2034 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""},
2035 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""},
2036 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""},
2037 {0, NULL, 0, NULL, NULL}
2040 static EnumPropertyItem fixed_oversample_items[] = {
2041 {5, "5", 0, "5", ""},
2042 {8, "8", 0, "8", ""},
2043 {11, "11", 0, "11", ""},
2044 {16, "16", 0, "16", ""},
2045 {0, NULL, 0, NULL, NULL}};
2047 static EnumPropertyItem field_order_items[] = {
2048 {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"},
2049 {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"},
2050 {0, NULL, 0, NULL, NULL}};
2052 static EnumPropertyItem threads_mode_items[] = {
2053 {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
2054 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
2055 {0, NULL, 0, NULL, NULL}};
2058 static EnumPropertyItem exr_codec_items[] = {
2059 {0, "NONE", 0, "None", ""},
2060 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
2061 {2, "ZIP", 0, "ZIP (lossless)", ""},
2062 {3, "PIZ", 0, "PIZ (lossless)", ""},
2063 {4, "RLE", 0, "RLE (lossless)", ""},
2064 {0, NULL, 0, NULL, NULL}};
2067 #ifdef WITH_OPENJPEG
2068 static EnumPropertyItem jp2_preset_items[] = {
2069 {0, "NO_PRESET", 0, "No Preset", ""},
2070 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
2071 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
2072 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
2073 {4, "CINE_SCOPE_24FPS", 0, "Cine-Scope 24fps 2048x858", ""},
2074 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
2075 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
2076 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
2077 {0, NULL, 0, NULL, NULL}};
2079 static EnumPropertyItem jp2_depth_items[] = {
2080 {8, "8", 0, "8", "8 bit color channels"},
2081 {12, "12", 0, "12", "12 bit color channels"},
2082 {16, "16", 0, "16", "16 bit color channels"},
2083 {0, NULL, 0, NULL, NULL}};
2086 #ifdef WITH_QUICKTIME
2087 static EnumPropertyItem quicktime_codec_type_items[] = {
2088 {0, "codec", 0, "codec", ""},
2089 {0, NULL, 0, NULL, NULL}};
2092 static EnumPropertyItem quicktime_audio_samplerate_items[] = {
2093 {22050, "22050", 0, "22kHz", ""},
2094 {44100, "44100", 0, "44.1kHz", ""},
2095 {48000, "48000", 0, "48kHz", ""},
2096 {88200, "88200", 0, "88.2kHz", ""},
2097 {96000, "96000", 0, "96kHz", ""},
2098 {192000, "192000", 0, "192kHz", ""},
2099 {0, NULL, 0, NULL, NULL}};
2101 static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
2102 {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
2103 {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
2104 {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
2105 {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
2106 {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
2107 {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
2108 {0, NULL, 0, NULL, NULL}};
2110 static EnumPropertyItem quicktime_audio_bitrate_items[] = {
2111 {64000, "64000", 0, "64kbps", ""},
2112 {112000, "112000", 0, "112kpbs", ""},
2113 {128000, "128000", 0, "128kbps", ""},
2114 {192000, "192000", 0, "192kbps", ""},
2115 {256000, "256000", 0, "256kbps", ""},
2116 {320000, "320000", 0, "320kbps", ""},
2117 {0, NULL, 0, NULL, NULL}};
2122 static EnumPropertyItem ffmpeg_format_items[] = {
2123 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
2124 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
2125 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
2126 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
2127 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
2128 {FFMPEG_DV, "DV", 0, "DV", ""},
2129 {FFMPEG_H264, "H264", 0, "H.264", ""},
2130 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
2131 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
2132 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
2133 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
2134 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
2135 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
2136 {0, NULL, 0, NULL, NULL}};
2138 static EnumPropertyItem ffmpeg_codec_items[] = {
2139 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2140 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
2141 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
2142 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
2143 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
2144 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
2145 {CODEC_ID_H264, "H264", 0, "H.264", ""},
2146 {CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
2147 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
2148 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
2149 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
2150 {0, NULL, 0, NULL, NULL}};
2152 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
2153 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2154 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
2155 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
2156 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
2157 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
2158 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
2159 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
2160 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
2161 {0, NULL, 0, NULL, NULL}};
2164 static EnumPropertyItem engine_items[] = {
2165 {0, "BLENDER_RENDER", 0, "Blender Render", ""},
2166 {0, NULL, 0, NULL, NULL}};
2168 srna= RNA_def_struct(brna, "RenderSettings", NULL);
2169 RNA_def_struct_sdna(srna, "RenderData");
2170 RNA_def_struct_nested(brna, srna, "Scene");
2171 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
2172 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
2174 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
2175 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
2176 RNA_def_property_enum_items(prop, color_mode_items);
2177 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");
2178 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2180 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
2181 RNA_def_property_int_sdna(prop, NULL, "xsch");
2182 RNA_def_property_range(prop, 4, 10000);
2183 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
2184 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2186 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
2187 RNA_def_property_int_sdna(prop, NULL, "ysch");
2188 RNA_def_property_range(prop, 4, 10000);
2189 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
2190 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2192 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
2193 RNA_def_property_int_sdna(prop, NULL, "size");
2194 RNA_def_property_range(prop, 1, SHRT_MAX);
2195 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
2196 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
2197 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2199 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
2200 RNA_def_property_int_sdna(prop, NULL, "xparts");
2201 RNA_def_property_range(prop, 1, 512);
2202 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
2203 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2205 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
2206 RNA_def_property_int_sdna(prop, NULL, "yparts");
2207 RNA_def_property_range(prop, 1, 512);
2208 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
2209 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2211 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
2212 RNA_def_property_float_sdna(prop, NULL, "xasp");
2213 RNA_def_property_range(prop, 1.0f, 200.0f);
2214 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
2215 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2217 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
2218 RNA_def_property_float_sdna(prop, NULL, "yasp");
2219 RNA_def_property_range(prop, 1.0f, 200.0f);
2220 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
2221 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2223 /* JPEG and AVI JPEG */
2225 prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
2226 RNA_def_property_int_sdna(prop, NULL, "quality");
2227 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
2228 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, Compression for PNG's");
2229 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2233 prop= RNA_def_property(srna, "use_tiff_16bit", PROP_BOOLEAN, PROP_NONE);
2234 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
2235 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
2236 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2238 /* Cineon and DPX */
2240 prop= RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
2241 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
2242 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
2243 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2245 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
2246 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
2247 RNA_def_property_range(prop, 0, 1024);
2248 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
2249 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2251 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
2252 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
2253 RNA_def_property_range(prop, 0, 1024);
2254 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
2255 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2257 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
2258 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
2259 RNA_def_property_range(prop, 0.0f, 10.0f);
2260 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
2261 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2266 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
2267 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
2268 RNA_def_property_enum_items(prop, exr_codec_items);
2269 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
2270 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2272 prop= RNA_def_property(srna, "use_exr_half", PROP_BOOLEAN, PROP_NONE);
2273 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
2274 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
2275 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2277 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
2278 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
2279 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int z-buffer)");
2280 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2282 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
2283 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
2284 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
2285 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2288 #ifdef WITH_OPENJPEG
2291 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
2292 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
2293 RNA_def_property_enum_items(prop, jp2_preset_items);
2294 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_preset_set", NULL);
2295 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
2296 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2298 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
2299 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
2300 RNA_def_property_enum_items(prop, jp2_depth_items);
2301 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_depth_set", NULL);
2302 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
2303 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2305 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
2306 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
2307 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
2308 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2311 #ifdef WITH_QUICKTIME
2314 prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
2315 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
2316 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2317 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
2318 "rna_RenderSettings_qtcodecsettings_codecType_set",
2319 "rna_RenderSettings_qtcodecsettings_codecType_itemf");
2320 RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
2321 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2323 prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
2324 RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
2325 RNA_def_property_range(prop, 0, 100);
2326 RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
2327 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2330 prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE);
2331 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType");
2332 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2333 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
2334 "rna_RenderSettings_qtcodecsettings_audiocodecType_set",
2335 "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
2336 RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
2337 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2339 prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE);
2340 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate");
2341 RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
2342 RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
2343 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2345 prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE);
2346 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth");
2347 RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
2348 RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
2349 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2351 prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
2352 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
2353 RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
2354 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2356 prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
2357 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
2358 RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
2359 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2361 prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE);
2362 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate");
2363 RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
2364 RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
2365 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2372 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
2373 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
2374 RNA_def_property_enum_items(prop, ffmpeg_format_items);
2375 RNA_def_property_ui_text(prop, "Format", "Output file format");
2376 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2378 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
2379 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
2380 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
2381 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
2382 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2384 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
2385 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
2386 RNA_def_property_range(prop, 1, 14000);
2387 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
2388 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2390 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
2391 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
2392 RNA_def_property_range(prop, 0, 9000);
2393 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
2394 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2396 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
2397 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
2398 RNA_def_property_range(prop, 1, 14000);
2399 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
2400 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2402 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
2403 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
2404 RNA_def_property_range(prop, 0, 100000000);
2405 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
2406 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2408 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
2409 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
2410 RNA_def_property_range(prop, 0, 100);
2411 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
2412 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2414 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
2415 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
2416 RNA_def_property_range(prop, 0, 2000);
2417 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
2418 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2420 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
2421 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
2422 RNA_def_property_range(prop, 0, 16384);
2423 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
2424 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2426 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
2427 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
2428 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
2429 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2432 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
2433 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
2434 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
2435 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
2436 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2438 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
2439 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
2440 RNA_def_property_range(prop, 32, 384);
2441 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
2442 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2444 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
2445 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
2446 RNA_def_property_range(prop, 8000, 192000);
2447 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
2448 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2450 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
2451 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
2452 RNA_def_property_range(prop, 0.0f, 1.0f);
2453 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
2454 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2458 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2459 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
2460 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2461 RNA_def_property_range(prop, 1, 120);
2462 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
2463 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2465 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
2466 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
2467 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2468 RNA_def_property_range(prop, 0.1f, 120.0f);
2469 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
2470 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2473 prop= RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
2474 RNA_def_property_int_sdna(prop, NULL, "framapto");
2475 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2476 RNA_def_property_range(prop, 1, 900);
2477 RNA_def_property_ui_text(prop, "Frame Map Old", "Specify old mapping value in frames");
2478 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
2480 prop= RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
2481 RNA_def_property_int_sdna(prop, NULL, "images");
2482 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2483 RNA_def_property_range(prop, 1, 900);
2484 RNA_def_property_ui_text(prop, "Frame Map New", "Specify how many frames the Map Old will last");
2485 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
2488 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
2489 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
2490 RNA_def_property_range(prop, 0.0f, 2.0f);
2491 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding");
2492 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2494 prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
2495 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
2496 RNA_def_property_enum_items(prop, pixel_filter_items);
2497 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
2498 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2500 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
2501 RNA_def_property_float_sdna(prop, NULL, "gauss");
2502 RNA_def_property_range(prop, 0.5f, 1.5f);
2503 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
2504 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2506 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2507 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
2508 RNA_def_property_enum_items(prop, alpha_mode_items);
2509 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2510 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2512 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
2513 RNA_def_property_enum_sdna(prop, NULL, "ocres");
2514 RNA_def_property_enum_items(prop, octree_resolution_items);
2515 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes");
2516 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2518 prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
2519 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
2520 RNA_def_property_enum_items(prop, raytrace_structure_items);
2521 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
2522 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2524 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
2525 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
2526 RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates");
2527 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2529 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
2530 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
2531 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");
2532 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2534 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2535 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
2536 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
2537 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2539 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
2540 RNA_def_property_enum_sdna(prop, NULL, "osa");
2541 RNA_def_property_enum_items(prop, fixed_oversample_items);
2542 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
2543 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2545 prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
2546 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
2547 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
2548 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2550 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
2551 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2552 RNA_def_property_enum_items(prop, field_order_items);
2553 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");
2554 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2556 prop= RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
2557 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
2558 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
2559 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2561 /* rendering features */
2562 prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
2563 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
2564 RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
2565 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2567 prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
2568 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
2569 RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
2570 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2572 prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
2573 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
2574 RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
2575 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2577 prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
2578 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
2579 RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
2580 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2582 prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
2583 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
2584 RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
2585 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2587 prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
2588 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
2589 RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
2590 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2592 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
2593 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
2594 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
2595 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2597 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
2598 RNA_def_property_int_sdna(prop, NULL, "edgeint");
2599 RNA_def_property_range(prop, 0, 255);
2600 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
2601 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2603 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
2604 RNA_def_property_float_sdna(prop, NULL, "edgeR");
2605 RNA_def_property_array(prop, 3);
2606 RNA_def_property_ui_text(prop, "Edge Color", "");
2607 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2610 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
2611 RNA_def_property_int_sdna(prop, NULL, "threads");
2612 RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
2613 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
2614 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
2615 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2617 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
2618 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2619 RNA_def_property_enum_items(prop, threads_mode_items);
2620 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
2621 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2624 prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
2625 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
2626 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
2627 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2629 prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
2630 RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
2631 RNA_def_property_range(prop, 1, 32);
2632 RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
2633 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2635 prop= RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
2636 RNA_def_property_float_sdna(prop, NULL, "blurfac");
2637 RNA_def_property_range(prop, 0.01f, 10.0f);
2638 RNA_def_property_ui_range(prop, 0.01, 2.0f, 1, 0);
2639 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
2640 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2643 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
2644 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
2645 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");
2646 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2648 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
2649 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
2650 RNA_def_property_range(prop, 0.0f, 1.0f);
2651 RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border");
2652 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2654 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
2655 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
2656 RNA_def_property_range(prop, 0.0f, 1.0f);
2657 RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
2658 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2660 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
2661 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
2662 RNA_def_property_range(prop, 0.0f, 1.0f);
2663 RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
2664 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2666 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
2667 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
2668 RNA_def_property_range(prop, 0.0f, 1.0f);
2669 RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
2670 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2672 prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
2673 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
2674 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
2675 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2677 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
2678 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
2679 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
2680 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2682 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2683 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2684 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
2685 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2687 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
2688 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
2689 RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled");
2690 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2692 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
2693 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
2694 RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist");
2695 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2697 prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
2698 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
2699 RNA_def_property_ui_text(prop, "Color Management", "Use linear workflow - gamma corrected imaging pipeline");
2700 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_RenderSettings_color_management_update");
2703 prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
2704 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
2705 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
2706 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2708 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
2709 RNA_def_property_enum_sdna(prop, NULL, "imtype");
2710 RNA_def_property_enum_items(prop, image_type_items);
2711 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
2712 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
2713 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2715 prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
2716 RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
2717 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
2718 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2720 prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
2721 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
2722 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2723 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
2725 prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
2726 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2727 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing");
2728 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2730 prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
2731 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
2732 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
2733 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2735 prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
2736 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
2737 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
2738 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)");
2739 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2741 prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
2742 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
2743 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
2744 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");
2745 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2747 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2748 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
2749 RNA_def_property_enum_items(prop, display_mode_items);
2750 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
2751 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2753 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
2754 RNA_def_property_string_sdna(prop, NULL, "pic");
2755 RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers");
2756 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2760 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
2761 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
2762 RNA_def_property_enum_items(prop, bake_mode_items);
2763 RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
2765 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
2766 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
2767 RNA_def_property_enum_items(prop, bake_normal_space_items);
2768 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
2770 prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
2771 RNA_def_property_enum_items(prop, bake_qyad_split_items);
2772 RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
2774 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
2775 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
2776 RNA_def_property_enum_items(prop, fixed_oversample_items);
2777 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
2779 prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
2780 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
2781 RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
2783 prop= RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
2784 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
2785 RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings");
2787 prop= RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
2788 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
2789 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
2791 prop= RNA_def_property(srna, "use_bake_antialiasing", PROP_BOOLEAN, PROP_NONE);
2792 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
2793 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
2795 prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
2796 RNA_def_property_int_sdna(prop, NULL, "bake_filter");
2797 RNA_def_property_range(prop, 0, 32);
2798 RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
2800 prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
2801 RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
2802 RNA_def_property_range(prop, 0.0, 1000.0);
2803 RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
2805 prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
2806 RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
2807 RNA_def_property_range(prop, 0.0, 1000.0);
2808 RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
2812 prop= RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
2813 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
2814 RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
2815 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2817 prop= RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
2818 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
2819 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
2820 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2822 prop= RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
2823 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
2824 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
2825 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2827 prop= RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
2828 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
2829 RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
2830 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2832 prop= RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
2833 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERALENS);
2834 RNA_def_property_ui_text(prop, "Stamp Lens", "Include the name of the active cameras lens in image metadata");
2835 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2837 prop= RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
2838 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
2839 RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
2840 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2842 prop= RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
2843 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
2844 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
2845 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2847 prop= RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
2848 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
2849 RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
2850 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2852 prop= RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
2853 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
2854 RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
2855 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2857 prop= RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
2858 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
2859 RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
2860 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2862 prop= RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
2863 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
2864 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
2865 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2867 prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
2868 RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
2869 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
2870 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2872 prop= RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
2873 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
2874 RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
2875 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2877 prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
2878 RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
2879 RNA_def_property_range(prop, 8, 64);
2880 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
2881 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2883 prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
2884 RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
2885 RNA_def_property_array(prop, 4);
2886 RNA_def_property_range(prop,0.0,1.0);
2887 RNA_def_property_ui_text(prop, "Stamp Text Color", "Color to use for stamp text");
2888 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2890 prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
2891 RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
2892 RNA_def_property_array(prop, 4);
2893 RNA_def_property_range(prop,0.0,1.0);
2894 RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
2895 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2897 /* sequencer draw options */
2899 prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
2900 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV);
2901 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2903 prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
2904 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND);
2905 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2908 prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
2909 RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
2910 RNA_def_property_enum_items(prop, viewport_shade_items);
2911 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2913 prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
2914 RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
2915 RNA_def_property_enum_items(prop, viewport_shade_items);
2916 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2920 prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
2921 RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
2922 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2923 RNA_def_property_ui_text(prop, "Render Layers", "");
2924 rna_def_render_layers(brna, prop);
2927 prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
2928 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
2929 RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
2930 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
2931 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2934 prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
2935 RNA_def_property_enum_items(prop, engine_items);
2936 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set", "rna_RenderSettings_engine_itemf");
2937 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
2938 RNA_def_property_update(prop, NC_WINDOW, NULL);
2940 prop= RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
2941 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
2942 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2943 RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
2945 prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
2946 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
2947 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2948 RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine");
2951 prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
2952 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
2953 RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
2954 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
2956 prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
2957 RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
2958 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
2959 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
2960 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2962 prop= RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
2963 RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
2964 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
2965 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2967 prop= RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
2968 RNA_def_property_int_sdna(prop, NULL, "simplify_shadowsamples");
2969 RNA_def_property_ui_range(prop, 1, 16, 1, 0);
2970 RNA_def_property_ui_text(prop, "Simplify Shadow Samples", "Global maximum shadow samples");
2971 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2973 prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
2974 RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
2975 RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor");
2976 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2978 prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
2979 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
2980 RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated");
2983 RNA_api_scene_render(srna);
2987 static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
2995 RNA_def_property_srna(cprop, "SceneObjects");
2996 srna= RNA_def_struct(brna, "SceneObjects", NULL);
2997 RNA_def_struct_sdna(srna, "Scene");
2998 RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
3000 func= RNA_def_function(srna, "link", "rna_Scene_object_link");
3001 RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after.");
3002 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
3003 parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
3004 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3005 parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
3006 RNA_def_function_return(func, parm);
3008 func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
3009 RNA_def_function_ui_description(func, "Unlink object from scene.");
3010 RNA_def_function_flag(func, FUNC_USE_REPORTS);
3011 parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
3012 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3014 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3015 RNA_def_property_struct_type(prop, "Object");
3016 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL, NULL);
3017 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
3018 RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene");
3019 /* Could call: ED_base_object_activate(C, scene->basact);
3020 * but would be a bad level call and it seems the notifier is enough */
3021 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
3026 static void rna_def_scene_bases(BlenderRNA *brna, PropertyRNA *cprop)
3031 // FunctionRNA *func;
3032 // PropertyRNA *parm;
3034 RNA_def_property_srna(cprop, "SceneBases");
3035 srna= RNA_def_struct(brna, "SceneBases", NULL);
3036 RNA_def_struct_sdna(srna, "Scene");
3037 RNA_def_struct_ui_text(srna, "Scene Bases", "Collection of scene bases");
3039 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3040 RNA_def_property_struct_type(prop, "ObjectBase");
3041 RNA_def_property_pointer_sdna(prop, NULL, "basact");
3042 RNA_def_property_flag(prop, PROP_EDITABLE);
3043 RNA_def_property_ui_text(prop, "Active Base", "Active object base in the scene");
3044 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
3047 /* scene.timeline_markers */
3048 static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
3055 RNA_def_property_srna(cprop, "TimelineMarkers");
3056 srna= RNA_def_struct(brna, "TimelineMarkers", NULL);
3057 RNA_def_struct_sdna(srna, "Scene");
3058 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
3060 func= RNA_def_function(srna, "new", "rna_TimeLine_add");
3061 RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
3062 parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
3063 RNA_def_property_flag(parm, PROP_REQUIRED);
3065 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
3066 RNA_def_function_return(func, parm);
3069 func= RNA_def_function(srna, "remove", "rna_TimeLine_remove");
3070 RNA_def_function_ui_description(func, "Remove a timeline marker.");
3071 RNA_def_function_flag(func, FUNC_USE_REPORTS);
3072 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
3073 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3076 /* scene.keying_sets */
3077 static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
3085 RNA_def_property_srna(cprop, "KeyingSets");
3086 srna= RNA_def_struct(brna, "KeyingSets", NULL);
3087 RNA_def_struct_sdna(srna, "Scene");
3088 RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
3090 /* Add Keying Set */
3091 func= RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
3092 RNA_def_function_ui_description(func, "Add a new Keying Set to Scene.");
3093 RNA_def_function_flag(func, FUNC_USE_REPORTS);
3095 RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
3097 /* returns the new KeyingSet */
3098 parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set.");
3099 RNA_def_function_return(func, parm);
3101 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3102 RNA_def_property_struct_type(prop, "KeyingSet");
3103 RNA_def_property_flag(prop, PROP_EDITABLE);
3104 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
3105 RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
3106 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3108 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
3109 RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
3110 RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
3111 RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
3112 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3115 static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
3120 RNA_def_property_srna(cprop, "KeyingSetsAll");
3121 srna= RNA_def_struct(brna, "KeyingSetsAll", NULL);
3122 RNA_def_struct_sdna(srna, "Scene");
3123 RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
3125 /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
3127 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3128 RNA_def_property_struct_type(prop, "KeyingSet");
3129 RNA_def_property_flag(prop, PROP_EDITABLE);