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", ""},
104 //{R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, // XXX not yet implemented
105 {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""},
106 {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""},
107 {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""},
109 {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""},
111 {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""},
112 {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", ""},
113 {0, "", 0, " ", NULL},
115 {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""},
116 {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", ""},
119 {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""},
120 {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""},
123 {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", ""},
126 {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""},
128 {0, "", 0, "Movie", NULL},
130 {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""}, // XXX Missing codec menu
132 {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", ""},
133 {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", ""},
134 {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
136 {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
137 {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", ""},
138 {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
140 #ifdef WITH_QUICKTIME
142 {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", ""},
144 {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", ""},
148 {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""},
150 {0, NULL, 0, NULL, NULL}};
154 #include "DNA_anim_types.h"
155 #include "DNA_node_types.h"
156 #include "DNA_object_types.h"
157 #include "DNA_mesh_types.h"
159 #include "RNA_access.h"
161 #include "MEM_guardedalloc.h"
163 #include "BLI_threads.h"
164 #include "BLI_editVert.h"
165 #include "BLI_blenlib.h"
167 #include "BKE_context.h"
168 #include "BKE_global.h"
169 #include "BKE_image.h"
170 #include "BKE_main.h"
171 #include "BKE_node.h"
172 #include "BKE_pointcache.h"
173 #include "BKE_scene.h"
174 #include "BKE_depsgraph.h"
175 #include "BKE_image.h"
176 #include "BKE_mesh.h"
177 #include "BKE_sound.h"
178 #include "BKE_screen.h"
179 #include "BKE_animsys.h"
185 #include "ED_view3d.h"
187 #include "ED_keyframing.h"
189 #include "RE_pipeline.h"
191 static int rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
193 Scene *scene= (Scene*)ptr->data;
196 for(base= scene->base.first; base; base= base->next) {
197 if(strncmp(base->object->id.name+2, key, sizeof(base->object->id.name)-2)==0) {
198 *r_ptr= rna_pointer_inherit_refine(ptr, &RNA_ObjectBase, base);
206 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
208 ListBaseIterator *internal= iter->internal;
210 /* we are actually iterating a Base list, so override get */
211 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
214 static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
216 Scene *scene_act= CTX_data_scene(C);
219 if (object_in_scene(ob, scene)) {
220 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
224 base= scene_add_base(scene, ob);
227 /* this is similar to what object_add_type and add_object do */
228 base->lay= scene->lay;
230 /* when linking to an inactive scene dont touch the layer */
231 if(scene == scene_act)
234 ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
236 /* slows down importers too much, run scene.update() */
237 /* DAG_scene_sort(G.main, scene); */
239 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
244 static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
246 Base *base= object_in_scene(ob, scene);
248 BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'.", ob->id.name+2, scene->id.name+2);
251 if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
252 BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink.", ob->id.name+2);
255 if(scene->basact==base) {
259 BLI_remlink(&scene->base, base);
264 /* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
265 DAG_scene_sort(G.main, scene);
266 DAG_ids_flush_update(G.main, 0);
268 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
271 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
273 ToolSettings *ts = (ToolSettings*)ptr->data;
274 if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
275 ts->skgen_template = value.data;
277 ts->skgen_template = NULL;
280 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
282 Scene *scene= (Scene*)ptr->data;
283 return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
286 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
288 Scene *scene= (Scene*)ptr->data;
290 scene->basact= object_in_scene((Object*)value.data, scene);
295 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
297 Scene *scene= (Scene*)ptr->data;
298 Scene *set= (Scene*)value.data;
301 for(nested_set= set; nested_set; nested_set= nested_set->set) {
302 if(nested_set==scene)
309 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
311 Scene *scene= (Scene*)ptr->data;
313 scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
316 static void rna_Scene_view3d_update(Main *bmain, Scene *unused, PointerRNA *ptr)
318 Scene *scene= (Scene*)ptr->data;
320 BKE_screen_view3d_main_sync(&bmain->screen, scene);
323 static void rna_Scene_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
325 rna_Scene_view3d_update(bmain, scene, ptr);
326 DAG_on_visible_update(bmain, FALSE);
329 static void rna_Scene_framelen_update(Main *bmain, Scene *scene, PointerRNA *ptr)
331 scene->r.framelen= (float)scene->r.framapto/(float)scene->r.images;
335 static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
337 Scene *data= (Scene*)ptr->data;
339 /* if negative frames aren't allowed, then we can't use them */
340 FRAMENUMBER_MIN_CLAMP(value);
344 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
346 Scene *data= (Scene*)ptr->data;
347 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
348 CLAMP(value, MINFRAME, data->r.efra);
352 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
354 Scene *data= (Scene*)ptr->data;
355 CLAMP(value, data->r.sfra, MAXFRAME);
359 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
361 Scene *data= (Scene*)ptr->data;
364 /* copy range from scene if not set before */
365 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
366 data->r.psfra= data->r.sfra;
367 data->r.pefra= data->r.efra;
370 data->r.flag |= SCER_PRV_RANGE;
373 data->r.flag &= ~SCER_PRV_RANGE;
377 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
379 Scene *data= (Scene*)ptr->data;
381 /* check if enabled already */
382 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
383 /* set end of preview range to end frame, then clamp as per normal */
384 // TODO: or just refuse to set instead?
385 data->r.pefra= data->r.efra;
388 /* now set normally */
389 CLAMP(value, MINAFRAME, data->r.pefra);
390 data->r.psfra= value;
393 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
395 Scene *data= (Scene*)ptr->data;
397 /* check if enabled already */
398 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
399 /* set start of preview range to start frame, then clamp as per normal */
400 // TODO: or just refuse to set instead?
401 data->r.psfra= data->r.sfra;
404 /* now set normally */
405 CLAMP(value, data->r.psfra, MAXFRAME);
406 data->r.pefra= value;
409 static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
411 //Scene *scene= ptr->id.data;
412 //ED_update_for_newframe(C);
416 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
418 Scene *scene= (Scene *)ptr->data;
419 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
422 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
424 Scene *scene= (Scene *)ptr->data;
425 KeyingSet *ks= (KeyingSet*)value.data;
427 scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
430 /* get KeyingSet index stuff for list of Keying Sets editing UI
431 * - active_keyingset-1 since 0 is reserved for 'none'
432 * - don't clamp, otherwise can never set builtins types as active...
434 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
436 Scene *scene= (Scene *)ptr->data;
437 return scene->active_keyingset-1;
440 /* get KeyingSet index stuff for list of Keying Sets editing UI
441 * - value+1 since 0 is reserved for 'none'
443 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
445 Scene *scene= (Scene *)ptr->data;
446 scene->active_keyingset= value+1;
449 // XXX: evil... builtin_keyingsets is defined in keyingsets.c!
450 // TODO: make API function to retrieve this...
451 extern ListBase builtin_keyingsets;
453 static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
455 Scene *scene= (Scene*)ptr->data;
457 /* start going over the scene KeyingSets first, while we still have pointer to it
458 * but only if we have any Keying Sets to use...
460 if (scene->keyingsets.first)
461 rna_iterator_listbase_begin(iter, &scene->keyingsets, NULL);
463 rna_iterator_listbase_begin(iter, &builtin_keyingsets, NULL);
466 static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
468 ListBaseIterator *internal= iter->internal;
469 KeyingSet *ks= (KeyingSet*)internal->link;
471 /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
472 if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
473 internal->link= (Link*)builtin_keyingsets.first;
475 internal->link= (Link*)ks->next;
477 iter->valid= (internal->link != NULL);
481 static char *rna_RenderSettings_path(PointerRNA *ptr)
483 return BLI_sprintfN("render");
486 static int rna_RenderSettings_threads_get(PointerRNA *ptr)
488 RenderData *rd= (RenderData*)ptr->data;
490 if(rd->mode & R_FIXED_THREADS)
493 return BLI_system_thread_count();
496 static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
498 RenderData *rd= (RenderData*)ptr->data;
499 return BKE_imtype_is_movie(rd->imtype);
502 static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
504 RenderData *rd= (RenderData*)ptr->data;
505 if(rd->mode & R_BORDER)
508 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
511 static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
513 RenderData *rd= (RenderData*)ptr->data;
515 return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
518 static void rna_RenderSettings_file_format_set(PointerRNA *ptr, int value)
520 RenderData *rd= (RenderData*)ptr->data;
524 ffmpeg_verify_image_type(rd);
526 #ifdef WITH_QUICKTIME
527 quicktime_verify_image_type(rd);
531 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
533 RenderData *rd= (RenderData*)ptr->data;
536 BKE_add_image_extension(ext, rd->imtype);
540 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
542 RenderData *rd= (RenderData*)ptr->data;
543 BKE_add_image_extension(str, rd->imtype);
546 void rna_RenderSettings_jpeg2k_preset_update(RenderData *rd)
548 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
550 switch(rd->jp2_depth) {
552 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
553 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
556 switch(rd->jp2_preset) {
557 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
558 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
559 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
560 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
561 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
562 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
563 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
568 static void rna_RenderSettings_jpeg2k_preset_set(PointerRNA *ptr, int value)
570 RenderData *rd= (RenderData*)ptr->data;
571 rd->jp2_preset= value;
572 rna_RenderSettings_jpeg2k_preset_update(rd);
575 static void rna_RenderSettings_jpeg2k_depth_set(PointerRNA *ptr, int value)
577 RenderData *rd= (RenderData*)ptr->data;
578 rd->jp2_depth= value;
579 rna_RenderSettings_jpeg2k_preset_update(rd);
583 #ifdef WITH_QUICKTIME
584 static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
586 RenderData *rd= (RenderData*)ptr->data;
588 return quicktime_rnatmpvalue_from_videocodectype(rd->qtcodecsettings.codecType);
591 static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
593 RenderData *rd= (RenderData*)ptr->data;
595 rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
598 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, int *free)
600 EnumPropertyItem *item= NULL;
601 EnumPropertyItem tmp = {0, "", 0, "", ""};
602 QuicktimeCodecTypeDesc *codecTypeDesc;
606 for(i=0;i<quicktime_get_num_videocodecs();i++) {
607 codecTypeDesc = quicktime_get_videocodecType_desc(i);
608 if (!codecTypeDesc) break;
610 tmp.value= codecTypeDesc->rnatmpvalue;
611 *((int*)id) = codecTypeDesc->codecType;
614 tmp.name= codecTypeDesc->codecName;
615 RNA_enum_item_add(&item, &totitem, &tmp);
618 RNA_enum_item_end(&item, &totitem);
625 static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
627 RenderData *rd= (RenderData*)ptr->data;
629 return quicktime_rnatmpvalue_from_audiocodectype(rd->qtcodecsettings.audiocodecType);
632 static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
634 RenderData *rd= (RenderData*)ptr->data;
636 rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
639 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr, int *free)
641 EnumPropertyItem *item= NULL;
642 EnumPropertyItem tmp = {0, "", 0, "", ""};
643 QuicktimeCodecTypeDesc *codecTypeDesc;
646 for(i=0;i<quicktime_get_num_audiocodecs();i++) {
647 codecTypeDesc = quicktime_get_audiocodecType_desc(i);
648 if (!codecTypeDesc) break;
650 tmp.value= codecTypeDesc->rnatmpvalue;
651 tmp.identifier= codecTypeDesc->codecName;
652 tmp.name= codecTypeDesc->codecName;
653 RNA_enum_item_add(&item, &totitem, &tmp);
656 RNA_enum_item_end(&item, &totitem);
664 static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
666 RenderData *rd= (RenderData*)ptr->data;
670 static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
672 RenderData *rd= (RenderData*)ptr->data;
676 static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
678 RenderData *rd= (RenderData*)ptr->data;
681 *max= BLI_countlist(&rd->layers)-1;
685 static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
687 RenderData *rd= (RenderData*)ptr->data;
688 SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
690 return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
693 static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
695 RenderData *rd= (RenderData*)ptr->data;
696 SceneRenderLayer *srl= (SceneRenderLayer*)value.data;
698 rd->actlay = BLI_findindex(&rd->layers, srl);
701 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
703 RenderData *rd= (RenderData*)ptr->data;
704 RenderEngineType *type= BLI_findlink(&R_engines, value);
707 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
710 static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *C, PointerRNA *ptr, int *free)
712 RenderEngineType *type;
713 EnumPropertyItem *item= NULL;
714 EnumPropertyItem tmp = {0, "", 0, "", ""};
717 for(type=R_engines.first; type; type=type->next, a++) {
719 tmp.identifier= type->idname;
720 tmp.name= type->name;
721 RNA_enum_item_add(&item, &totitem, &tmp);
724 RNA_enum_item_end(&item, &totitem);
730 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
732 RenderData *rd= (RenderData*)ptr->data;
733 RenderEngineType *type;
736 for(type=R_engines.first; type; type=type->next, a++)
737 if(strcmp(type->idname, rd->engine) == 0)
743 static void rna_Scene_glsl_update(Main *bmain, Scene *unused, PointerRNA *ptr)
745 Scene *scene= (Scene*)ptr->id.data;
747 DAG_id_tag_update(&scene->id, 0);
750 static void rna_RenderSettings_color_management_update(Main *bmain, Scene *unused, PointerRNA *ptr)
752 /* reset image nodes */
753 Scene *scene= (Scene*)ptr->id.data;
754 bNodeTree *ntree=scene->nodetree;
757 if(ntree && scene->use_nodes) {
758 /* XXX images are freed here, stop render and preview threads, until Image is threadsafe */
759 WM_jobs_stop_all(bmain->wm.first);
761 for (node=ntree->nodes.first; node; node=node->next) {
762 if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
763 ED_node_changed_update(&scene->id, node);
764 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
766 if (node->type == CMP_NODE_IMAGE)
767 BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
772 rna_Scene_glsl_update(bmain, unused, ptr);
775 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
777 Scene *scene= (Scene*)ptr->id.data;
778 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
780 BLI_strncpy(rl->name, value, sizeof(rl->name));
782 if(scene->nodetree) {
784 int index= BLI_findindex(&scene->r.layers, rl);
786 for(node= scene->nodetree->nodes.first; node; node= node->next) {
787 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
788 if(node->custom1==index)
789 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
795 static int rna_RenderSettings_multiple_engines_get(PointerRNA *ptr)
797 return (BLI_countlist(&R_engines) > 1);
800 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
802 RenderData *rd= (RenderData*)ptr->data;
803 RenderEngineType *type;
805 for(type=R_engines.first; type; type=type->next)
806 if(strcmp(type->idname, rd->engine) == 0)
807 return (type->flag & RE_GAME);
812 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
814 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
815 rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL);
818 static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *unused, PointerRNA *ptr)
820 Scene *scene= (Scene*)ptr->id.data;
823 ntreeCompositForceHidden(scene->nodetree, scene);
826 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
828 Scene *scene= (Scene*)ptr->data;
830 scene->use_nodes= value;
831 if(scene->use_nodes && scene->nodetree==NULL)
832 ED_node_composit_default(scene);
835 static void rna_Physics_update(Main *bmain, Scene *unused, PointerRNA *ptr)
837 Scene *scene= (Scene*)ptr->id.data;
840 for(base = scene->base.first; base; base=base->next)
841 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
844 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
846 Scene *scene= (Scene*)ptr->id.data;
847 ToolSettings *ts = (ToolSettings*)ptr->data;
848 int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
851 ts->selectmode = flag;
854 Mesh *me= get_mesh(scene->basact->object);
855 if(me && me->edit_mesh && me->edit_mesh->selectmode != flag) {
856 me->edit_mesh->selectmode= flag;
857 EM_selectmode_set(me->edit_mesh);
863 static void rna_Scene_editmesh_select_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
868 me= get_mesh(scene->basact->object);
869 if(me && me->edit_mesh==NULL)
873 WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
874 WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
877 static void object_simplify_update(Object *ob)
880 ParticleSystem *psys;
882 for(md=ob->modifiers.first; md; md=md->next)
883 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
884 ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
886 for(psys=ob->particlesystem.first; psys; psys=psys->next)
887 psys->recalc |= PSYS_RECALC_CHILD;
892 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
893 object_simplify_update(gob->ob);
897 static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
902 for(SETLOOPER(scene, sce_iter, base))
903 object_simplify_update(base->object);
905 DAG_ids_flush_update(bmain, 0);
906 WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
909 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
911 if(scene->r.mode & R_SIMPLIFY)
912 rna_Scene_use_simplify_update(bmain, scene, ptr);
915 static int rna_Scene_use_audio_get(PointerRNA *ptr)
917 Scene *scene= (Scene*)ptr->data;
918 return scene->audio.flag & AUDIO_MUTE;
921 static void rna_Scene_use_audio_set(PointerRNA *ptr, int value)
923 Scene *scene= (Scene*)ptr->data;
926 scene->audio.flag |= AUDIO_MUTE;
928 scene->audio.flag &= ~AUDIO_MUTE;
930 sound_mute_scene(scene, value);
933 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
935 Scene *scene= (Scene*)ptr->data;
936 if(scene->audio.flag & AUDIO_SYNC)
938 return scene->flag & SCE_FRAME_DROP;
941 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
943 Scene *scene= (Scene*)ptr->data;
945 if(value == AUDIO_SYNC)
946 scene->audio.flag |= AUDIO_SYNC;
947 else if(value == SCE_FRAME_DROP)
949 scene->audio.flag &= ~AUDIO_SYNC;
950 scene->flag |= SCE_FRAME_DROP;
954 scene->audio.flag &= ~AUDIO_SYNC;
955 scene->flag &= ~SCE_FRAME_DROP;
959 static int rna_GameSettings_auto_start_get(PointerRNA *ptr)
961 if (G.fileflags & G_FILE_AUTOPLAY)
967 static void rna_GameSettings_auto_start_set(PointerRNA *ptr, int value)
970 G.fileflags |= G_FILE_AUTOPLAY;
972 G.fileflags &= ~G_FILE_AUTOPLAY;
976 static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[])
978 TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
979 marker->flag= SELECT;
981 BLI_strncpy(marker->name, name, sizeof(marker->name));
982 BLI_addtail(&scene->markers, marker);
986 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker)
988 /* try to remove the F-Curve from the action */
989 if (!BLI_remlink_safe(&scene->markers, marker)) {
990 BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in action '%s'", marker->name, scene->id.name+2);
994 /* XXX, invalidates PyObject */
998 static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, const char name[])
1000 KeyingSet *ks= NULL;
1002 /* call the API func, and set the active keyingset index */
1003 ks= BKE_keyingset_add(&sce->keyingsets, name, KEYINGSET_ABSOLUTE, 0);
1006 sce->active_keyingset= BLI_countlist(&sce->keyingsets);
1010 BKE_report(reports, RPT_ERROR, "Keying Set could not be added.");
1017 static void rna_def_transform_orientation(BlenderRNA *brna)
1022 const int matrix_dimsize[]= {3, 3};
1024 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
1026 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
1027 RNA_def_property_float_sdna(prop, NULL, "mat");
1028 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
1029 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1031 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1032 RNA_def_property_string_sdna(prop, NULL, "name");
1033 RNA_def_struct_name_property(srna, prop);
1034 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1037 static void rna_def_tool_settings(BlenderRNA *brna)
1042 static EnumPropertyItem uv_select_mode_items[] = {
1043 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
1044 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
1045 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
1046 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
1047 {0, NULL, 0, NULL, NULL}};
1049 static EnumPropertyItem auto_key_items[] = {
1050 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
1051 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
1052 {0, NULL, 0, NULL, NULL}};
1054 static EnumPropertyItem retarget_roll_items[] = {
1055 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
1056 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
1057 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
1058 {0, NULL, 0, NULL, NULL}};
1060 static EnumPropertyItem sketch_convert_items[] = {
1061 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
1062 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
1063 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts"},
1064 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
1065 {0, NULL, 0, NULL, NULL}};
1067 static EnumPropertyItem edge_tag_items[] = {
1068 {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
1069 {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
1070 {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
1071 {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
1072 {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
1073 {0, NULL, 0, NULL, NULL}};
1075 srna= RNA_def_struct(brna, "ToolSettings", NULL);
1076 RNA_def_struct_ui_text(srna, "Tool Settings", "");
1078 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
1079 RNA_def_property_struct_type(prop, "Sculpt");
1080 RNA_def_property_ui_text(prop, "Sculpt", "");
1082 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
1083 RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
1084 RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
1085 "Ensure all bone-deforming vertex groups add up to 1.0 while "
1088 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
1089 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
1090 RNA_def_property_ui_text(prop, "Vertex Paint", "");
1092 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
1093 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
1094 RNA_def_property_ui_text(prop, "Weight Paint", "");
1096 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
1097 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
1098 RNA_def_property_ui_text(prop, "Image Paint", "");
1100 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
1101 RNA_def_property_pointer_sdna(prop, NULL, "particle");
1102 RNA_def_property_ui_text(prop, "Particle Edit", "");
1105 prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
1106 RNA_def_property_enum_sdna(prop, NULL, "proportional");
1107 RNA_def_property_enum_items(prop, proportional_editing_items);
1108 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional Editing mode, allows transforms with distance fall-off");
1109 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1111 prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
1112 RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
1113 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing object mode");
1114 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
1115 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1117 prop= RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
1118 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
1119 RNA_def_property_enum_items(prop, proportional_falloff_items);
1120 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
1121 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1123 prop= RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
1124 RNA_def_property_float_sdna(prop, NULL, "proportional_size");
1125 RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle");
1126 RNA_def_property_range(prop, 0.00001, 5000.0);
1128 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
1129 RNA_def_property_float_sdna(prop, NULL, "normalsize");
1130 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
1131 RNA_def_property_range(prop, 0.00001, 1000.0);
1132 RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
1133 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
1135 prop= RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
1136 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
1137 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
1139 prop= RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
1140 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
1141 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
1142 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
1143 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1145 prop= RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
1146 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
1147 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
1148 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
1149 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1151 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
1152 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
1153 RNA_def_property_enum_items(prop, snap_element_items);
1154 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
1155 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1157 prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
1158 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
1159 RNA_def_property_enum_items(prop, snap_target_items);
1160 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
1161 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1163 prop= RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
1164 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
1165 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
1166 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
1167 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1169 prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
1170 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
1171 RNA_def_property_ui_text(prop, "Project Individual Elements", "Project individual elements on the surface of other objects");
1172 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
1173 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1176 prop = RNA_def_property(srna, "use_grease_pencil_sessions", PROP_BOOLEAN, PROP_NONE);
1177 RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINTSESSIONS_ON);
1178 RNA_def_property_ui_text(prop, "Use Sketching Sessions", "Allow drawing multiple strokes at a time with Grease Pencil");
1179 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); // xxx: need toolbar to be redrawn...
1182 prop= RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
1183 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
1184 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
1185 RNA_def_property_ui_icon(prop, ICON_REC, 0);
1187 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
1188 RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
1189 RNA_def_property_enum_items(prop, auto_key_items);
1190 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
1192 prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
1193 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
1194 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");
1196 prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
1197 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
1198 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set only");
1199 RNA_def_property_ui_icon(prop, ICON_KEY_HLT, 0); // XXX: we need a dedicated icon
1202 prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
1203 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
1204 RNA_def_property_enum_items(prop, uv_select_mode_items);
1205 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
1206 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1208 prop= RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
1209 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
1210 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
1211 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1212 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1214 prop= RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
1215 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
1216 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
1217 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1220 prop= RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
1221 RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
1222 RNA_def_property_array(prop, 3);
1223 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
1224 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
1225 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
1227 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
1228 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
1229 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
1231 /* use with MESH_OT_select_shortest_path */
1232 prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
1233 RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
1234 RNA_def_property_enum_items(prop, edge_tag_items);
1235 RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
1237 prop= RNA_def_property(srna, "edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
1238 RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1);
1239 RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edges seam re-calculates UV unwrap");
1242 prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
1243 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
1244 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
1245 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1247 prop= RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
1248 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
1249 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
1251 prop= RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
1252 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
1253 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
1255 prop= RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
1256 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
1257 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
1259 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
1260 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1261 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
1263 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
1264 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1265 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
1267 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
1268 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
1269 RNA_def_property_flag(prop, PROP_EDITABLE);
1270 RNA_def_property_struct_type(prop, "Object");
1271 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
1272 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
1274 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
1275 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
1276 RNA_def_property_range(prop, 1, 255);
1277 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
1278 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1280 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
1281 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
1282 RNA_def_property_range(prop, 0.00001, 1.0);
1283 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
1284 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
1285 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1287 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
1288 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
1289 RNA_def_property_range(prop, 0.00001, 100000.0);
1290 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1291 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
1292 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1294 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
1295 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
1296 RNA_def_property_enum_items(prop, retarget_roll_items);
1297 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
1299 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
1300 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
1301 RNA_def_property_enum_items(prop, sketch_convert_items);
1302 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
1303 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1305 /* Sculpt/Paint Unified Size and Strength */
1307 prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
1308 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
1309 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius", "Instead of per brush radius, the radius is shared across brushes");
1311 prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
1312 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
1313 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength", "Instead of per brush strength, the strength is shared across brushes");
1317 static void rna_def_unit_settings(BlenderRNA *brna)
1322 static EnumPropertyItem unit_systems[] = {
1323 {USER_UNIT_NONE, "NONE", 0, "None", ""},
1324 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
1325 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
1326 {0, NULL, 0, NULL, NULL}};
1328 static EnumPropertyItem rotation_units[] = {
1329 {0, "DEGREES", 0, "Degrees", ""},
1330 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
1331 {0, NULL, 0, NULL, NULL}};
1333 srna= RNA_def_struct(brna, "UnitSettings", NULL);
1334 RNA_def_struct_ui_text(srna, "Unit Settings", "");
1337 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
1338 RNA_def_property_enum_items(prop, unit_systems);
1339 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
1340 RNA_def_property_update(prop, NC_WINDOW, NULL);
1342 prop= RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
1343 RNA_def_property_enum_items(prop, rotation_units);
1344 RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
1345 RNA_def_property_update(prop, NC_WINDOW, NULL);
1347 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
1348 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
1349 RNA_def_property_range(prop, 0.00001, 100000.0);
1350 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1351 RNA_def_property_update(prop, NC_WINDOW, NULL);
1353 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
1354 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
1355 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs");
1356 RNA_def_property_update(prop, NC_WINDOW, NULL);
1359 void rna_def_render_layer_common(StructRNA *srna, int scene)
1363 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1364 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
1365 else RNA_def_property_string_sdna(prop, NULL, "name");
1366 RNA_def_property_ui_text(prop, "Name", "Render layer name");
1367 RNA_def_struct_name_property(srna, prop);
1368 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1369 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1371 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
1372 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
1373 RNA_def_property_struct_type(prop, "Material");
1374 RNA_def_property_flag(prop, PROP_EDITABLE);
1375 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
1376 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1377 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1379 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
1380 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
1381 RNA_def_property_struct_type(prop, "Group");
1382 RNA_def_property_flag(prop, PROP_EDITABLE);
1383 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
1384 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1385 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1388 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1389 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1390 RNA_def_property_array(prop, 20);
1391 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
1392 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
1393 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
1394 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1395 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1397 prop= RNA_def_property(srna, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
1398 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
1399 RNA_def_property_array(prop, 20);
1400 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers");
1401 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1402 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1405 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
1406 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
1407 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
1408 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1409 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1411 prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
1412 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
1413 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
1414 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1415 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1417 prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
1418 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
1419 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
1420 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1421 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1423 prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
1424 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
1425 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
1426 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1427 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1429 prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
1430 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
1431 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
1432 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1433 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1435 prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
1436 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
1437 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
1438 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1439 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1441 prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
1442 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
1443 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
1444 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1445 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1447 prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
1448 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
1449 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
1450 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1451 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1453 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
1454 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
1455 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
1456 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1457 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1459 prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
1460 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
1461 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
1462 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1463 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1466 prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
1467 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
1468 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
1469 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1470 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1472 prop= RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
1473 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
1474 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
1475 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1476 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1478 prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
1479 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
1480 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
1481 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1482 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1484 prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
1485 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
1486 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
1487 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1488 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1490 prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
1491 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
1492 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
1493 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1494 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1496 prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
1497 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
1498 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
1499 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1500 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1502 prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
1503 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
1504 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
1505 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1506 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1508 prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
1509 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
1510 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
1511 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1512 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1514 prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
1515 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
1516 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
1517 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1518 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1520 prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
1521 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
1522 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
1523 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1524 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1526 prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
1527 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
1528 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
1529 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1530 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1532 prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1533 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
1534 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
1535 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1536 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1538 prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
1539 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
1540 RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
1541 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1542 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1544 prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
1545 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
1546 RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
1547 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1548 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1550 prop= RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
1551 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
1552 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
1553 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1554 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1556 prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
1557 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
1558 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
1559 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1560 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1562 prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
1563 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
1564 RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
1565 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1566 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1568 prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
1569 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
1570 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
1571 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1572 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1573 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1575 prop= RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
1576 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
1577 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
1578 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1579 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1580 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1582 prop= RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1583 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
1584 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
1585 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1586 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1587 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1589 prop= RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
1590 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
1591 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
1592 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1593 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1594 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1596 prop= RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
1597 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
1598 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
1599 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1600 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1601 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1603 prop= RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
1604 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
1605 RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
1606 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1607 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1608 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1610 prop= RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
1611 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
1612 RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
1613 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1614 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1615 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1617 prop= RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
1618 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
1619 RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
1620 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1621 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1622 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1625 static void rna_def_scene_game_data(BlenderRNA *brna)
1630 static EnumPropertyItem framing_types_items[] ={
1631 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
1632 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1633 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1634 {0, NULL, 0, NULL, NULL}};
1636 static EnumPropertyItem dome_modes_items[] ={
1637 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1638 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1639 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1640 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1641 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1642 {0, NULL, 0, NULL, NULL}};
1644 static EnumPropertyItem stereo_modes_items[] ={
1645 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1646 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1647 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1648 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1649 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1650 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1651 {0, NULL, 0, NULL, NULL}};
1653 static EnumPropertyItem stereo_items[] ={
1654 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
1655 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
1656 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
1657 {0, NULL, 0, NULL, NULL}};
1659 static EnumPropertyItem physics_engine_items[] = {
1660 {WOPHY_NONE, "NONE", 0, "None", ""},
1661 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1662 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1663 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1664 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1665 {WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
1666 {0, NULL, 0, NULL, NULL}};
1668 static EnumPropertyItem material_items[] ={
1669 {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials"},
1670 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
1671 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
1672 {0, NULL, 0, NULL, NULL}};
1674 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1675 RNA_def_struct_sdna(srna, "GameData");
1676 RNA_def_struct_nested(brna, srna, "Scene");
1677 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
1679 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1680 RNA_def_property_int_sdna(prop, NULL, "xplay");
1681 RNA_def_property_range(prop, 4, 10000);
1682 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
1683 RNA_def_property_update(prop, NC_SCENE, NULL);
1685 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1686 RNA_def_property_int_sdna(prop, NULL, "yplay");
1687 RNA_def_property_range(prop, 4, 10000);
1688 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
1689 RNA_def_property_update(prop, NC_SCENE, NULL);
1691 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
1692 RNA_def_property_int_sdna(prop, NULL, "depth");
1693 RNA_def_property_range(prop, 8, 32);
1694 RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
1695 RNA_def_property_update(prop, NC_SCENE, NULL);
1697 // Do we need it here ? (since we already have it in World
1698 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1699 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1700 RNA_def_property_range(prop, 4, 2000);
1701 RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display");
1702 RNA_def_property_update(prop, NC_SCENE, NULL);
1704 prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
1705 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1706 RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
1707 RNA_def_property_update(prop, NC_SCENE, NULL);
1710 prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
1711 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1712 RNA_def_property_enum_items(prop, framing_types_items);
1713 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
1714 RNA_def_property_update(prop, NC_SCENE, NULL);
1716 prop= RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
1717 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1718 RNA_def_property_range(prop, 0.0f, 1.0f);
1719 RNA_def_property_array(prop, 3);
1720 RNA_def_property_ui_text(prop, "Framing Color", "Set color of the bars");
1721 RNA_def_property_update(prop, NC_SCENE, NULL);
1724 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1725 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1726 RNA_def_property_enum_items(prop, stereo_items);
1727 RNA_def_property_ui_text(prop, "Stereo Options", "");
1728 RNA_def_property_update(prop, NC_SCENE, NULL);
1730 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1731 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1732 RNA_def_property_enum_items(prop, stereo_modes_items);
1733 RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
1734 RNA_def_property_update(prop, NC_SCENE, NULL);
1736 prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
1737 RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
1738 RNA_def_property_range(prop, 0.01, 5.0);
1739 RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
1740 RNA_def_property_update(prop, NC_SCENE, NULL);
1743 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1744 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1745 RNA_def_property_enum_items(prop, dome_modes_items);
1746 RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
1747 RNA_def_property_update(prop, NC_SCENE, NULL);
1749 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1750 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1751 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1752 RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
1753 RNA_def_property_update(prop, NC_SCENE, NULL);
1755 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1756 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1757 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1758 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1759 RNA_def_property_update(prop, NC_SCENE, NULL);
1761 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1762 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1763 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1764 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1765 RNA_def_property_update(prop, NC_SCENE, NULL);
1767 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1768 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1769 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1770 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1771 RNA_def_property_update(prop, NC_SCENE, NULL);
1773 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
1774 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
1775 RNA_def_property_struct_type(prop, "Text");
1776 RNA_def_property_flag(prop, PROP_EDITABLE);
1777 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
1778 RNA_def_property_update(prop, NC_SCENE, NULL);
1781 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
1782 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
1783 RNA_def_property_enum_items(prop, physics_engine_items);
1784 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
1785 RNA_def_property_update(prop, NC_SCENE, NULL);
1787 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
1788 RNA_def_property_float_sdna(prop, NULL, "gravity");
1789 RNA_def_property_range(prop, 0.0, 25.0);
1790 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
1791 RNA_def_property_update(prop, NC_SCENE, NULL);
1793 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_INT, PROP_NONE);
1794 RNA_def_property_int_sdna(prop, NULL, "occlusionRes");
1795 RNA_def_property_range(prop, 128.0, 1024.0);
1796 RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
1797 RNA_def_property_update(prop, NC_SCENE, NULL);
1799 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1800 RNA_def_property_int_sdna(prop, NULL, "ticrate");
1801 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
1802 RNA_def_property_range(prop, 1, 250);
1803 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");
1804 RNA_def_property_update(prop, NC_SCENE, NULL);
1806 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
1807 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
1808 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1809 RNA_def_property_range(prop, 1, 5);
1810 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");
1811 RNA_def_property_update(prop, NC_SCENE, NULL);
1813 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
1814 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
1815 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1816 RNA_def_property_range(prop, 1, 5);
1817 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");
1818 RNA_def_property_update(prop, NC_SCENE, NULL);
1820 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
1821 RNA_def_property_int_sdna(prop, NULL, "physubstep");
1822 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1823 RNA_def_property_range(prop, 1, 5);
1824 RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
1825 RNA_def_property_update(prop, NC_SCENE, NULL);
1828 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
1829 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
1830 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
1832 // not used // deprecated !!!!!!!!!!!!!
1833 prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
1834 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
1835 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
1837 // not used // deprecated !!!!!!!!!!!!!
1838 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
1839 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
1840 RNA_def_property_range(prop, 0.0, 1000.0);
1841 RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
1844 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
1845 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
1846 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
1848 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
1849 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
1850 RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs");
1852 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
1853 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
1854 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
1856 prop= RNA_def_property(srna, "show_mouse", PROP_BOOLEAN, PROP_NONE);
1857 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_MOUSE);
1858 RNA_def_property_ui_text(prop, "Show Mouse", "Start player with a visible mouse cursor");
1860 prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
1861 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
1862 RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
1864 prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
1865 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
1866 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
1868 prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
1869 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
1870 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
1872 prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
1873 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
1874 RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
1876 prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
1877 RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
1878 RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
1881 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
1882 RNA_def_property_enum_sdna(prop, NULL, "matmode");
1883 RNA_def_property_enum_items(prop, material_items);
1884 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
1885 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1887 prop= RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
1888 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
1889 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
1890 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1892 prop= RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
1893 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
1894 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
1895 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1897 prop= RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
1898 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
1899 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
1900 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1902 prop= RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
1903 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
1904 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
1905 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1907 prop= RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
1908 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
1909 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
1910 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1912 prop= RNA_def_property(srna, "use_glsl_color_management", PROP_BOOLEAN, PROP_NONE);
1913 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_COLOR_MANAGEMENT);
1914 RNA_def_property_ui_text(prop, "GLSL Color Management", "Use color management for GLSL rendering");
1915 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1917 prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
1918 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
1919 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
1920 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1923 static void rna_def_scene_render_layer(BlenderRNA *brna)
1927 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
1928 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
1929 RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
1931 rna_def_render_layer_common(srna, 1);
1935 static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
1940 // FunctionRNA *func;
1941 // PropertyRNA *parm;
1943 RNA_def_property_srna(cprop, "RenderLayers");
1944 srna= RNA_def_struct(brna, "RenderLayers", NULL);
1945 RNA_def_struct_sdna(srna, "RenderData");
1946 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
1948 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
1949 RNA_def_property_int_sdna(prop, NULL, "actlay");
1950 RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
1951 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
1952 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1954 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
1955 RNA_def_property_struct_type(prop, "SceneRenderLayer");
1956 RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get", "rna_RenderSettings_active_layer_set", NULL, NULL);
1957 RNA_def_property_flag(prop, PROP_EDITABLE);
1958 RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
1959 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1963 static void rna_def_scene_render_data(BlenderRNA *brna)
1968 static EnumPropertyItem pixel_filter_items[] ={
1969 {R_FILTER_BOX, "BOX", 0, "Box", ""},
1970 {R_FILTER_TENT, "TENT", 0, "Tent", ""},
1971 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""},
1972 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""},
1973 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""},
1974 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""},
1975 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""},
1976 {0, NULL, 0, NULL, NULL}};
1978 static EnumPropertyItem alpha_mode_items[] ={
1979 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
1980 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
1981 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
1982 {0, NULL, 0, NULL, NULL}};
1984 static EnumPropertyItem color_mode_items[] ={
1985 {R_PLANESBW, "BW", 0, "BW", "Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)"},
1986 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
1987 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
1988 {0, NULL, 0, NULL, NULL}};
1990 static EnumPropertyItem display_mode_items[] ={
1991 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
1992 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
1993 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
1994 {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes, optionally showing result"},
1995 {0, NULL, 0, NULL, NULL}};
1998 static EnumPropertyItem bake_mode_items[] ={
1999 {RE_BAKE_ALL, "FULL", 0, "Full Render", ""},
2000 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""},
2001 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""},
2002 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""},
2003 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""},
2004 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""},
2005 {0, NULL, 0, NULL, NULL}};
2007 static EnumPropertyItem bake_normal_space_items[] ={
2008 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""},
2009 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""},
2010 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""},
2011 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
2012 {0, NULL, 0, NULL, NULL}};
2014 static EnumPropertyItem bake_qyad_split_items[] ={
2015 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
2016 {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
2017 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
2018 {0, NULL, 0, NULL, NULL}};
2020 static EnumPropertyItem octree_resolution_items[] = {
2021 {64, "64", 0, "64", ""},
2022 {128, "128", 0, "128", ""},
2023 {256, "256", 0, "256", ""},
2024 {512, "512", 0, "512", ""},
2025 {0, NULL, 0, NULL, NULL}};
2027 static EnumPropertyItem raytrace_structure_items[] = {
2028 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""},
2029 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"},
2030 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
2031 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""},
2032 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""},
2033 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""},
2034 {0, NULL, 0, NULL, NULL}
2037 static EnumPropertyItem fixed_oversample_items[] = {
2038 {5, "5", 0, "5", ""},
2039 {8, "8", 0, "8", ""},
2040 {11, "11", 0, "11", ""},
2041 {16, "16", 0, "16", ""},
2042 {0, NULL, 0, NULL, NULL}};
2044 static EnumPropertyItem field_order_items[] = {
2045 {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"},
2046 {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"},
2047 {0, NULL, 0, NULL, NULL}};
2049 static EnumPropertyItem threads_mode_items[] = {
2050 {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
2051 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
2052 {0, NULL, 0, NULL, NULL}};
2055 static EnumPropertyItem exr_codec_items[] = {
2056 {0, "NONE", 0, "None", ""},
2057 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
2058 {2, "ZIP", 0, "ZIP (lossless)", ""},
2059 {3, "PIZ", 0, "PIZ (lossless)", ""},
2060 {4, "RLE", 0, "RLE (lossless)", ""},
2061 {0, NULL, 0, NULL, NULL}};
2064 #ifdef WITH_OPENJPEG
2065 static EnumPropertyItem jp2_preset_items[] = {
2066 {0, "NO_PRESET", 0, "No Preset", ""},
2067 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
2068 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
2069 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
2070 {4, "CINE_SCOPE_24FPS", 0, "Cine-Scope 24fps 2048x858", ""},
2071 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
2072 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
2073 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
2074 {0, NULL, 0, NULL, NULL}};
2076 static EnumPropertyItem jp2_depth_items[] = {
2077 {8, "8", 0, "8", "8 bit color channels"},
2078 {12, "12", 0, "12", "12 bit color channels"},
2079 {16, "16", 0, "16", "16 bit color channels"},
2080 {0, NULL, 0, NULL, NULL}};
2083 #ifdef WITH_QUICKTIME
2084 static EnumPropertyItem quicktime_codec_type_items[] = {
2085 {0, "codec", 0, "codec", ""},
2086 {0, NULL, 0, NULL, NULL}};
2089 static EnumPropertyItem quicktime_audio_samplerate_items[] = {
2090 {22050, "22050", 0, "22kHz", ""},
2091 {44100, "44100", 0, "44.1kHz", ""},
2092 {48000, "48000", 0, "48kHz", ""},
2093 {88200, "88200", 0, "88.2kHz", ""},
2094 {96000, "96000", 0, "96kHz", ""},
2095 {192000, "192000", 0, "192kHz", ""},
2096 {0, NULL, 0, NULL, NULL}};
2098 static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
2099 {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
2100 {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
2101 {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
2102 {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
2103 {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
2104 {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
2105 {0, NULL, 0, NULL, NULL}};
2107 static EnumPropertyItem quicktime_audio_bitrate_items[] = {
2108 {64000, "64000", 0, "64kbps", ""},
2109 {112000, "112000", 0, "112kpbs", ""},
2110 {128000, "128000", 0, "128kbps", ""},
2111 {192000, "192000", 0, "192kbps", ""},
2112 {256000, "256000", 0, "256kbps", ""},
2113 {320000, "320000", 0, "320kbps", ""},
2114 {0, NULL, 0, NULL, NULL}};
2119 static EnumPropertyItem ffmpeg_format_items[] = {
2120 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
2121 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
2122 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
2123 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
2124 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
2125 {FFMPEG_DV, "DV", 0, "DV", ""},
2126 {FFMPEG_H264, "H264", 0, "H.264", ""},
2127 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
2128 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
2129 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
2130 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
2131 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
2132 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
2133 {0, NULL, 0, NULL, NULL}};
2135 static EnumPropertyItem ffmpeg_codec_items[] = {
2136 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2137 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
2138 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
2139 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
2140 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
2141 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
2142 {CODEC_ID_H264, "H264", 0, "H.264", ""},
2143 {CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
2144 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
2145 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
2146 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
2147 {0, NULL, 0, NULL, NULL}};
2149 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
2150 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2151 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
2152 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
2153 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
2154 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
2155 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
2156 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
2157 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
2158 {0, NULL, 0, NULL, NULL}};
2161 static EnumPropertyItem engine_items[] = {
2162 {0, "BLENDER_RENDER", 0, "Blender Render", ""},
2163 {0, NULL, 0, NULL, NULL}};
2165 srna= RNA_def_struct(brna, "RenderSettings", NULL);
2166 RNA_def_struct_sdna(srna, "RenderData");
2167 RNA_def_struct_nested(brna, srna, "Scene");
2168 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
2169 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
2171 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
2172 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
2173 RNA_def_property_enum_items(prop, color_mode_items);
2174 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");
2175 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2177 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
2178 RNA_def_property_int_sdna(prop, NULL, "xsch");
2179 RNA_def_property_range(prop, 4, 10000);
2180 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
2181 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2183 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
2184 RNA_def_property_int_sdna(prop, NULL, "ysch");
2185 RNA_def_property_range(prop, 4, 10000);
2186 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
2187 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2189 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
2190 RNA_def_property_int_sdna(prop, NULL, "size");
2191 RNA_def_property_range(prop, 1, SHRT_MAX);
2192 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
2193 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
2194 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2196 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
2197 RNA_def_property_int_sdna(prop, NULL, "xparts");
2198 RNA_def_property_range(prop, 1, 512);
2199 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
2200 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2202 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
2203 RNA_def_property_int_sdna(prop, NULL, "yparts");
2204 RNA_def_property_range(prop, 1, 512);
2205 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
2206 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2208 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
2209 RNA_def_property_float_sdna(prop, NULL, "xasp");
2210 RNA_def_property_range(prop, 1.0f, 200.0f);
2211 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
2212 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2214 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
2215 RNA_def_property_float_sdna(prop, NULL, "yasp");
2216 RNA_def_property_range(prop, 1.0f, 200.0f);
2217 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
2218 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2220 /* JPEG and AVI JPEG */
2222 prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
2223 RNA_def_property_int_sdna(prop, NULL, "quality");
2224 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
2225 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, Compression for PNG's");
2226 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2230 prop= RNA_def_property(srna, "use_tiff_16bit", PROP_BOOLEAN, PROP_NONE);
2231 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
2232 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
2233 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2235 /* Cineon and DPX */
2237 prop= RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
2238 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
2239 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
2240 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2242 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
2243 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
2244 RNA_def_property_range(prop, 0, 1024);
2245 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
2246 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2248 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
2249 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
2250 RNA_def_property_range(prop, 0, 1024);
2251 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
2252 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2254 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
2255 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
2256 RNA_def_property_range(prop, 0.0f, 10.0f);
2257 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
2258 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2263 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
2264 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
2265 RNA_def_property_enum_items(prop, exr_codec_items);
2266 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
2267 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2269 prop= RNA_def_property(srna, "use_exr_half", PROP_BOOLEAN, PROP_NONE);
2270 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
2271 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
2272 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2274 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
2275 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
2276 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int z-buffer)");
2277 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2279 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
2280 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
2281 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
2282 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2285 #ifdef WITH_OPENJPEG
2288 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
2289 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
2290 RNA_def_property_enum_items(prop, jp2_preset_items);
2291 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_preset_set", NULL);
2292 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
2293 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2295 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
2296 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
2297 RNA_def_property_enum_items(prop, jp2_depth_items);
2298 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_depth_set", NULL);
2299 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
2300 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2302 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
2303 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
2304 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
2305 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2308 #ifdef WITH_QUICKTIME
2311 prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
2312 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
2313 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2314 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
2315 "rna_RenderSettings_qtcodecsettings_codecType_set",
2316 "rna_RenderSettings_qtcodecsettings_codecType_itemf");
2317 RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
2318 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2320 prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
2321 RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
2322 RNA_def_property_range(prop, 0, 100);
2323 RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
2324 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2327 prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE);
2328 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType");
2329 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2330 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
2331 "rna_RenderSettings_qtcodecsettings_audiocodecType_set",
2332 "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
2333 RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
2334 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2336 prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE);
2337 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate");
2338 RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
2339 RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
2340 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2342 prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE);
2343 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth");
2344 RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
2345 RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
2346 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2348 prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
2349 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
2350 RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
2351 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2353 prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
2354 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
2355 RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
2356 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2358 prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE);
2359 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate");
2360 RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
2361 RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
2362 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2369 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
2370 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
2371 RNA_def_property_enum_items(prop, ffmpeg_format_items);
2372 RNA_def_property_ui_text(prop, "Format", "Output file format");
2373 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2375 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
2376 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
2377 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
2378 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
2379 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2381 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
2382 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
2383 RNA_def_property_range(prop, 1, 14000);
2384 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
2385 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2387 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
2388 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
2389 RNA_def_property_range(prop, 0, 9000);
2390 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
2391 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2393 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
2394 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
2395 RNA_def_property_range(prop, 1, 14000);
2396 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
2397 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2399 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
2400 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
2401 RNA_def_property_range(prop, 0, 100000000);
2402 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
2403 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2405 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
2406 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
2407 RNA_def_property_range(prop, 0, 100);
2408 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
2409 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2411 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
2412 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
2413 RNA_def_property_range(prop, 0, 2000);
2414 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
2415 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2417 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
2418 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
2419 RNA_def_property_range(prop, 0, 16384);
2420 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
2421 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2423 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
2424 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
2425 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
2426 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2429 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
2430 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
2431 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
2432 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
2433 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2435 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
2436 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
2437 RNA_def_property_range(prop, 32, 384);
2438 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
2439 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2441 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
2442 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
2443 RNA_def_property_range(prop, 8000, 192000);
2444 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
2445 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2447 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
2448 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
2449 RNA_def_property_range(prop, 0.0f, 1.0f);
2450 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
2451 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2455 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2456 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
2457 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2458 RNA_def_property_range(prop, 1, 120);
2459 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
2460 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2462 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
2463 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
2464 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2465 RNA_def_property_range(prop, 0.1f, 120.0f);
2466 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
2467 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2470 prop= RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
2471 RNA_def_property_int_sdna(prop, NULL, "framapto");
2472 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2473 RNA_def_property_range(prop, 1, 900);
2474 RNA_def_property_ui_text(prop, "Frame Map Old", "Specify old mapping value in frames");
2475 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
2477 prop= RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
2478 RNA_def_property_int_sdna(prop, NULL, "images");
2479 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2480 RNA_def_property_range(prop, 1, 900);
2481 RNA_def_property_ui_text(prop, "Frame Map New", "Specify how many frames the Map Old will last");
2482 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
2485 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
2486 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
2487 RNA_def_property_range(prop, 0.0f, 2.0f);
2488 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding");
2489 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2491 prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
2492 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
2493 RNA_def_property_enum_items(prop, pixel_filter_items);
2494 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
2495 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2497 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
2498 RNA_def_property_float_sdna(prop, NULL, "gauss");
2499 RNA_def_property_range(prop, 0.5f, 1.5f);
2500 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
2501 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2503 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2504 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
2505 RNA_def_property_enum_items(prop, alpha_mode_items);
2506 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2507 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2509 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
2510 RNA_def_property_enum_sdna(prop, NULL, "ocres");
2511 RNA_def_property_enum_items(prop, octree_resolution_items);
2512 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes");
2513 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2515 prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
2516 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
2517 RNA_def_property_enum_items(prop, raytrace_structure_items);
2518 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
2519 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2521 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
2522 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
2523 RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates");
2524 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2526 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
2527 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
2528 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");
2529 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2531 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2532 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
2533 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
2534 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2536 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
2537 RNA_def_property_enum_sdna(prop, NULL, "osa");
2538 RNA_def_property_enum_items(prop, fixed_oversample_items);
2539 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
2540 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2542 prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
2543 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
2544 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
2545 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2547 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
2548 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2549 RNA_def_property_enum_items(prop, field_order_items);
2550 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");
2551 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2553 prop= RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
2554 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
2555 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
2556 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2558 /* rendering features */
2559 prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
2560 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
2561 RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
2562 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2564 prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
2565 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
2566 RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
2567 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2569 prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
2570 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
2571 RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
2572 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2574 prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
2575 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
2576 RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
2577 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2579 prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
2580 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
2581 RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
2582 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2584 prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
2585 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
2586 RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
2587 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2589 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
2590 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
2591 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
2592 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2594 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
2595 RNA_def_property_int_sdna(prop, NULL, "edgeint");
2596 RNA_def_property_range(prop, 0, 255);
2597 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
2598 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2600 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
2601 RNA_def_property_float_sdna(prop, NULL, "edgeR");
2602 RNA_def_property_array(prop, 3);
2603 RNA_def_property_ui_text(prop, "Edge Color", "");
2604 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2607 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
2608 RNA_def_property_int_sdna(prop, NULL, "threads");
2609 RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
2610 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
2611 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
2612 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2614 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
2615 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2616 RNA_def_property_enum_items(prop, threads_mode_items);
2617 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
2618 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2621 prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
2622 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
2623 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
2624 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2626 prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
2627 RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
2628 RNA_def_property_range(prop, 1, 32);
2629 RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
2630 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2632 prop= RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
2633 RNA_def_property_float_sdna(prop, NULL, "blurfac");
2634 RNA_def_property_range(prop, 0.01f, 10.0f);
2635 RNA_def_property_ui_range(prop, 0.01, 2.0f, 1, 0);
2636 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
2637 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2640 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
2641 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
2642 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");
2643 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2645 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
2646 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
2647 RNA_def_property_range(prop, 0.0f, 1.0f);
2648 RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border");
2649 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2651 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
2652 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
2653 RNA_def_property_range(prop, 0.0f, 1.0f);
2654 RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
2655 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2657 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
2658 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
2659 RNA_def_property_range(prop, 0.0f, 1.0f);
2660 RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
2661 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2663 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
2664 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
2665 RNA_def_property_range(prop, 0.0f, 1.0f);
2666 RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
2667 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2669 prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
2670 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
2671 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
2672 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2674 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
2675 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
2676 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
2677 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2679 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2680 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2681 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
2682 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2684 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
2685 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
2686 RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled");
2687 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2689 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
2690 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
2691 RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist");
2692 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2694 prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
2695 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
2696 RNA_def_property_ui_text(prop, "Color Management", "Use linear workflow - gamma corrected imaging pipeline");
2697 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_RenderSettings_color_management_update");
2700 prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
2701 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
2702 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
2703 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2705 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
2706 RNA_def_property_enum_sdna(prop, NULL, "imtype");
2707 RNA_def_property_enum_items(prop, image_type_items);
2708 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
2709 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
2710 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2712 prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
2713 RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
2714 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
2715 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2717 prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
2718 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
2719 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2720 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
2722 prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
2723 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2724 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing");
2725 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2727 prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
2728 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
2729 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
2730 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2732 prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
2733 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
2734 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
2735 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)");
2736 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2738 prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
2739 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
2740 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
2741 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");
2742 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2744 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2745 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
2746 RNA_def_property_enum_items(prop, display_mode_items);
2747 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
2748 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2750 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
2751 RNA_def_property_string_sdna(prop, NULL, "pic");
2752 RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers");
2753 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2757 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
2758 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
2759 RNA_def_property_enum_items(prop, bake_mode_items);
2760 RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
2762 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
2763 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
2764 RNA_def_property_enum_items(prop, bake_normal_space_items);
2765 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
2767 prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
2768 RNA_def_property_enum_items(prop, bake_qyad_split_items);
2769 RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
2771 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
2772 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
2773 RNA_def_property_enum_items(prop, fixed_oversample_items);
2774 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
2776 prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
2777 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
2778 RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
2780 prop= RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
2781 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
2782 RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings");
2784 prop= RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
2785 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
2786 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
2788 prop= RNA_def_property(srna, "use_bake_antialiasing", PROP_BOOLEAN, PROP_NONE);
2789 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
2790 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
2792 prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
2793 RNA_def_property_int_sdna(prop, NULL, "bake_filter");
2794 RNA_def_property_range(prop, 0, 32);
2795 RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
2797 prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
2798 RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
2799 RNA_def_property_range(prop, 0.0, 1000.0);
2800 RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
2802 prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
2803 RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
2804 RNA_def_property_range(prop, 0.0, 1000.0);
2805 RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
2809 prop= RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
2810 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
2811 RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
2812 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2814 prop= RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
2815 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
2816 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
2817 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2819 prop= RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
2820 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
2821 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
2822 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2824 prop= RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
2825 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
2826 RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
2827 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2829 prop= RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
2830 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERALENS);
2831 RNA_def_property_ui_text(prop, "Stamp Lens", "Include the name of the active cameras lens in image metadata");
2832 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2834 prop= RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
2835 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
2836 RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
2837 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2839 prop= RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
2840 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
2841 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
2842 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2844 prop= RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
2845 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
2846 RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
2847 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2849 prop= RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
2850 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
2851 RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
2852 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2854 prop= RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
2855 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
2856 RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
2857 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2859 prop= RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
2860 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
2861 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
2862 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2864 prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
2865 RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
2866 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
2867 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2869 prop= RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
2870 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
2871 RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
2872 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2874 prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
2875 RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
2876 RNA_def_property_range(prop, 8, 64);
2877 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
2878 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2880 prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
2881 RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
2882 RNA_def_property_array(prop, 4);
2883 RNA_def_property_range(prop,0.0,1.0);
2884 RNA_def_property_ui_text(prop, "Stamp Text Color", "Color to use for stamp text");
2885 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2887 prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
2888 RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
2889 RNA_def_property_array(prop, 4);
2890 RNA_def_property_range(prop,0.0,1.0);
2891 RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
2892 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2894 /* sequencer draw options */
2896 prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
2897 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV);
2898 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2900 prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
2901 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND);
2902 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2905 prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
2906 RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
2907 RNA_def_property_enum_items(prop, viewport_shade_items);
2908 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2910 prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
2911 RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
2912 RNA_def_property_enum_items(prop, viewport_shade_items);
2913 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2917 prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
2918 RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
2919 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2920 RNA_def_property_ui_text(prop, "Render Layers", "");
2921 rna_def_render_layers(brna, prop);
2924 prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
2925 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
2926 RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
2927 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
2928 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2931 prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
2932 RNA_def_property_enum_items(prop, engine_items);
2933 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set", "rna_RenderSettings_engine_itemf");
2934 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
2935 RNA_def_property_update(prop, NC_WINDOW, NULL);
2937 prop= RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
2938 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
2939 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2940 RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
2942 prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
2943 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
2944 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2945 RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine");
2948 prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
2949 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
2950 RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
2951 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
2953 prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
2954 RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
2955 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
2956 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
2957 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2959 prop= RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
2960 RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
2961 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
2962 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2964 prop= RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
2965 RNA_def_property_int_sdna(prop, NULL, "simplify_shadowsamples");
2966 RNA_def_property_ui_range(prop, 1, 16, 1, 0);
2967 RNA_def_property_ui_text(prop, "Simplify Shadow Samples", "Global maximum shadow samples");
2968 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2970 prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
2971 RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
2972 RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor");
2973 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2975 prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
2976 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
2977 RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated");
2980 RNA_api_scene_render(srna);
2984 static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
2992 RNA_def_property_srna(cprop, "SceneObjects");
2993 srna= RNA_def_struct(brna, "SceneObjects", NULL);
2994 RNA_def_struct_sdna(srna, "Scene");
2995 RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
2997 func= RNA_def_function(srna, "link", "rna_Scene_object_link");
2998 RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after.");
2999 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
3000 parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
3001 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3002 parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
3003 RNA_def_function_return(func, parm);
3005 func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
3006 RNA_def_function_ui_description(func, "Unlink object from scene.");
3007 RNA_def_function_flag(func, FUNC_USE_REPORTS);
3008 parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
3009 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3011 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3012 RNA_def_property_struct_type(prop, "Object");
3013 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL, NULL);
3014 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
3015 RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene");
3016 /* Could call: ED_base_object_activate(C, scene->basact);
3017 * but would be a bad level call and it seems the notifier is enough */
3018 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
3023 static void rna_def_scene_bases(BlenderRNA *brna, PropertyRNA *cprop)
3028 // FunctionRNA *func;
3029 // PropertyRNA *parm;
3031 RNA_def_property_srna(cprop, "SceneBases");
3032 srna= RNA_def_struct(brna, "SceneBases", NULL);
3033 RNA_def_struct_sdna(srna, "Scene");
3034 RNA_def_struct_ui_text(srna, "Scene Bases", "Collection of scene bases");
3036 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3037 RNA_def_property_struct_type(prop, "ObjectBase");
3038 RNA_def_property_pointer_sdna(prop, NULL, "basact");
3039 RNA_def_property_flag(prop, PROP_EDITABLE);
3040 RNA_def_property_ui_text(prop, "Active Base", "Active object base in the scene");
3041 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
3044 /* scene.timeline_markers */
3045 static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
3052 RNA_def_property_srna(cprop, "TimelineMarkers");
3053 srna= RNA_def_struct(brna, "TimelineMarkers", NULL);
3054 RNA_def_struct_sdna(srna, "Scene");
3055 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
3057 func= RNA_def_function(srna, "new", "rna_TimeLine_add");
3058 RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
3059 parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
3060 RNA_def_property_flag(parm, PROP_REQUIRED);
3062 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
3063 RNA_def_function_return(func, parm);
3066 func= RNA_def_function(srna, "remove", "rna_TimeLine_remove");
3067 RNA_def_function_ui_description(func, "Remove a timeline marker.");
3068 RNA_def_function_flag(func, FUNC_USE_REPORTS);
3069 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
3070 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3073 /* scene.keying_sets */
3074 static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
3082 RNA_def_property_srna(cprop, "KeyingSets");
3083 srna= RNA_def_struct(brna, "KeyingSets", NULL);
3084 RNA_def_struct_sdna(srna, "Scene");
3085 RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
3087 /* Add Keying Set */
3088 func= RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
3089 RNA_def_function_ui_description(func, "Add a new Keying Set to Scene.");
3090 RNA_def_function_flag(func, FUNC_USE_REPORTS);
3092 RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
3094 /* returns the new KeyingSet */
3095 parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set.");
3096 RNA_def_function_return(func, parm);
3098 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3099 RNA_def_property_struct_type(prop, "KeyingSet");
3100 RNA_def_property_flag(prop, PROP_EDITABLE);
3101 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
3102 RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
3103 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3105 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
3106 RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
3107 RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
3108 RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
3109 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3112 static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
3117 RNA_def_property_srna(cprop, "KeyingSetsAll");
3118 srna= RNA_def_struct(brna, "KeyingSetsAll", NULL);
3119 RNA_def_struct_sdna(srna, "Scene");
3120 RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
3122 /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
3124 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3125 RNA_def_property_struct_type(prop, "KeyingSet");
3126 RNA_def_property_flag(prop, PROP_EDITABLE);
3127 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
3128 RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
3129 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3131 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
3132 RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
3133 RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
3134 RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
3135 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3138 void RNA_def_scene(BlenderRNA *brna)
3144 static EnumPropertyItem audio_distance_model_items[] = {
3145 {0, "NONE", 0, "None", "No distance attenuation"},
3146 {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
3147 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
3148 {3, "LINEAR", 0, "Linear", "Linear distance model"},
3149 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
3150 {5, "EXPONENT", 0, "Exponent", "Exponent distance model"},
3151 {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping"},
3152 {0, NULL, 0, NULL, NULL}};
3154 static EnumPropertyItem sync_mode_items[] = {
3155 {0, "NONE", 0, "No Sync", "Do not sync, play every frame"},
3156 {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
3157 {AUDIO_SYNC, "AUDIO_SYNC", 0, "AV-sync", "Sync to audio playback, dropping frames"},
3158 {0, NULL, 0, NULL, NULL}};
3160 /* Struct definition */
3161 srna= RNA_def_struct(brna, "Scene", "ID");
3162 RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings");
3163 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
3164 RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
3166 /* Global Settings */
3167 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
3168 RNA_def_property_flag(prop, PROP_EDITABLE);
3169 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
3170 RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene");
3171 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_view3d_update");
3173 prop= RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
3174 RNA_def_property_pointer_sdna(prop, NULL, "set");
3175 RNA_def_property_struct_type(prop, "Scene");
3176 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
3177 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL, NULL);
3178 RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
3179 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
3181 prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
3182 RNA_def_property_flag(prop, PROP_EDITABLE);
3183 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
3184 RNA_def_property_update(prop, NC_SCENE|ND_WORLD, NULL);
3186 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
3187 RNA_def_property_float_sdna(prop, NULL, "cursor");
3188 RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location");
3189 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
3190 RNA_def_property_update(prop, NC_WINDOW, NULL);
3193 prop= RNA_def_property(srna, "object_bases", PROP_COLLECTION, PROP_NONE);
3194 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
3195 RNA_def_property_struct_type(prop, "ObjectBase");
3196 RNA_def_property_ui_text(prop, "Bases", "");