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 *****
27 #include "RNA_define.h"
28 #include "RNA_enum_types.h"
30 #include "rna_internal.h"
32 #include "DNA_group_types.h"
33 #include "DNA_modifier_types.h"
34 #include "DNA_particle_types.h"
35 #include "DNA_scene_types.h"
36 #include "DNA_userdef_types.h"
38 /* Include for Bake Options */
39 #include "RE_pipeline.h"
42 #include "quicktime_export.h"
43 #include "AUD_C-API.h"
47 #include "BKE_writeffmpeg.h"
48 #include <libavcodec/avcodec.h>
49 #include <libavformat/avformat.h>
54 #include "BLI_threads.h"
56 EnumPropertyItem snap_target_items[] = {
57 {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
58 {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target"},
59 {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
60 {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
61 {0, NULL, 0, NULL, NULL}};
63 EnumPropertyItem proportional_falloff_items[] ={
64 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
65 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
66 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
67 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
68 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", ""},
69 {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", ""},
70 {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
71 {0, NULL, 0, NULL, NULL}};
74 EnumPropertyItem proportional_editing_items[] = {
75 {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", ""},
76 {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", ""},
77 {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", ""},
78 {0, NULL, 0, NULL, NULL}};
80 /* keep for operators, not used here */
81 EnumPropertyItem mesh_select_mode_items[] = {
82 {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
83 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
84 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
85 {0, NULL, 0, NULL, NULL}};
87 EnumPropertyItem snap_element_items[] = {
88 {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid"},
89 {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
90 {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"},
91 {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces"},
92 {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"},
93 {0, NULL, 0, NULL, NULL}};
95 EnumPropertyItem image_type_items[] = {
96 {0, "", 0, "Image", NULL},
97 {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""},
98 //{R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, // XXX not yet implemented
99 {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""},
100 {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""},
101 {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""},
103 {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""},
105 {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""},
106 {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", ""},
107 {0, "", 0, " ", NULL},
109 {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""},
110 {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", ""},
113 {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""},
114 {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""},
117 {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", ""},
120 {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""},
122 {0, "", 0, "Movie", NULL},
124 {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""}, // XXX Missing codec menu
126 {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", ""},
127 {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", ""},
128 {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
130 {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
131 {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", ""},
132 {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
134 #ifdef WITH_QUICKTIME
136 {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", ""},
138 {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", ""},
142 {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""},
144 {0, NULL, 0, NULL, NULL}};
148 #include "DNA_anim_types.h"
149 #include "DNA_node_types.h"
150 #include "DNA_object_types.h"
151 #include "DNA_mesh_types.h"
153 #include "MEM_guardedalloc.h"
155 #include "BKE_context.h"
156 #include "BKE_global.h"
157 #include "BKE_image.h"
158 #include "BKE_main.h"
159 #include "BKE_node.h"
160 #include "BKE_pointcache.h"
161 #include "BKE_scene.h"
162 #include "BKE_depsgraph.h"
163 #include "BKE_image.h"
164 #include "BKE_mesh.h"
165 #include "BKE_sound.h"
166 #include "BKE_screen.h"
168 #include "BLI_threads.h"
169 #include "BLI_editVert.h"
170 #include "BLI_blenlib.h"
176 #include "ED_view3d.h"
178 #include "ED_keyframing.h"
180 #include "RE_pipeline.h"
182 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
184 ListBaseIterator *internal= iter->internal;
186 /* we are actually iterating a Base list, so override get */
187 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
190 static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
192 Scene *scene_act= CTX_data_scene(C);
195 if (object_in_scene(ob, scene)) {
196 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
200 base= scene_add_base(scene, ob);
203 /* this is similar to what object_add_type and add_object do */
204 base->lay= scene->lay;
206 /* when linking to an inactive scene dont touch the layer */
207 if(scene == scene_act)
210 ob->recalc |= OB_RECALC_ALL;
212 /* slows down importers too much, run scene.update() */
213 /* DAG_scene_sort(G.main, scene); */
215 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
220 static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
222 Base *base= object_in_scene(ob, scene);
224 BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'.", ob->id.name+2, scene->id.name+2);
227 if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
228 BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink.", ob->id.name+2);
231 if(scene->basact==base) {
235 BLI_remlink(&scene->base, base);
240 /* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
241 DAG_scene_sort(G.main, scene);
242 DAG_ids_flush_update(G.main, 0);
244 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
247 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
249 ToolSettings *ts = (ToolSettings*)ptr->data;
250 if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
251 ts->skgen_template = value.data;
253 ts->skgen_template = NULL;
256 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
258 Scene *scene= (Scene*)ptr->data;
259 return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
262 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
264 Scene *scene= (Scene*)ptr->data;
266 scene->basact= object_in_scene((Object*)value.data, scene);
271 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
273 Scene *scene= (Scene*)ptr->data;
274 Scene *set= (Scene*)value.data;
277 for(nested_set= set; nested_set; nested_set= nested_set->set) {
278 if(nested_set==scene)
285 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
287 Scene *scene= (Scene*)ptr->data;
289 scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
292 static void rna_Scene_view3d_update(Main *bmain, Scene *unused, PointerRNA *ptr)
294 Scene *scene= (Scene*)ptr->data;
296 BKE_screen_view3d_main_sync(&bmain->screen, scene);
299 static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
301 Scene *data= (Scene*)ptr->data;
303 /* if negative frames aren't allowed, then we can't use them */
304 FRAMENUMBER_MIN_CLAMP(value);
308 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
310 Scene *data= (Scene*)ptr->data;
311 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
312 CLAMP(value, MINFRAME, data->r.efra);
316 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
318 Scene *data= (Scene*)ptr->data;
319 CLAMP(value, data->r.sfra, MAXFRAME);
323 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
325 Scene *data= (Scene*)ptr->data;
328 /* copy range from scene if not set before */
329 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
330 data->r.psfra= data->r.sfra;
331 data->r.pefra= data->r.efra;
334 data->r.flag |= SCER_PRV_RANGE;
337 data->r.flag &= ~SCER_PRV_RANGE;
341 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
343 Scene *data= (Scene*)ptr->data;
345 /* check if enabled already */
346 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
347 /* set end of preview range to end frame, then clamp as per normal */
348 // TODO: or just refuse to set instead?
349 data->r.pefra= data->r.efra;
352 /* now set normally */
353 CLAMP(value, MINAFRAME, data->r.pefra);
354 data->r.psfra= value;
357 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
359 Scene *data= (Scene*)ptr->data;
361 /* check if enabled already */
362 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
363 /* set start of preview range to start frame, then clamp as per normal */
364 // TODO: or just refuse to set instead?
365 data->r.psfra= data->r.sfra;
368 /* now set normally */
369 CLAMP(value, data->r.psfra, MAXFRAME);
370 data->r.pefra= value;
373 static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
375 //Scene *scene= ptr->id.data;
376 //ED_update_for_newframe(C);
380 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
382 Scene *scene= (Scene *)ptr->data;
383 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
386 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
388 Scene *scene= (Scene *)ptr->data;
389 KeyingSet *ks= (KeyingSet*)value.data;
391 scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
394 /* get KeyingSet index stuff for list of Keying Sets editing UI
395 * - active_keyingset-1 since 0 is reserved for 'none'
396 * - don't clamp, otherwise can never set builtins types as active...
398 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
400 Scene *scene= (Scene *)ptr->data;
401 return scene->active_keyingset-1;
404 /* get KeyingSet index stuff for list of Keying Sets editing UI
405 * - value+1 since 0 is reserved for 'none'=
407 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
409 Scene *scene= (Scene *)ptr->data;
410 scene->active_keyingset= value+1;
413 // XXX: evil... builtin_keyingsets is defined in keyingsets.c!
414 // TODO: make API function to retrieve this...
415 extern ListBase builtin_keyingsets;
417 static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
419 Scene *scene= (Scene*)ptr->data;
421 /* start going over the scene KeyingSets first, while we still have pointer to it
422 * but only if we have any Keying Sets to use...
424 if (scene->keyingsets.first)
425 rna_iterator_listbase_begin(iter, &scene->keyingsets, NULL);
427 rna_iterator_listbase_begin(iter, &builtin_keyingsets, NULL);
430 static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
432 ListBaseIterator *internal= iter->internal;
433 KeyingSet *ks= (KeyingSet*)internal->link;
435 /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
436 if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
437 internal->link= (Link*)builtin_keyingsets.first;
439 internal->link= (Link*)ks->next;
441 iter->valid= (internal->link != NULL);
445 static char *rna_RenderSettings_path(PointerRNA *ptr)
447 return BLI_sprintfN("render");
450 static int rna_RenderSettings_threads_get(PointerRNA *ptr)
452 RenderData *rd= (RenderData*)ptr->data;
454 if(rd->mode & R_FIXED_THREADS)
457 return BLI_system_thread_count();
460 static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
462 RenderData *rd= (RenderData*)ptr->data;
463 return BKE_imtype_is_movie(rd->imtype);
466 static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
468 RenderData *rd= (RenderData*)ptr->data;
469 if(rd->mode & R_BORDER)
472 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
475 static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
477 RenderData *rd= (RenderData*)ptr->data;
479 return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
482 static void rna_RenderSettings_file_format_set(PointerRNA *ptr, int value)
484 RenderData *rd= (RenderData*)ptr->data;
488 ffmpeg_verify_image_type(rd);
490 #ifdef WITH_QUICKTIME
491 quicktime_verify_image_type(rd);
495 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
497 RenderData *rd= (RenderData*)ptr->data;
500 BKE_add_image_extension(ext, rd->imtype);
504 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
506 RenderData *rd= (RenderData*)ptr->data;
507 BKE_add_image_extension(str, rd->imtype);
510 void rna_RenderSettings_jpeg2k_preset_update(RenderData *rd)
512 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
514 switch(rd->jp2_depth) {
516 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
517 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
520 switch(rd->jp2_preset) {
521 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
522 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
523 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
524 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
525 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
526 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
527 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
532 static void rna_RenderSettings_jpeg2k_preset_set(PointerRNA *ptr, int value)
534 RenderData *rd= (RenderData*)ptr->data;
535 rd->jp2_preset= value;
536 rna_RenderSettings_jpeg2k_preset_update(rd);
539 static void rna_RenderSettings_jpeg2k_depth_set(PointerRNA *ptr, int value)
541 RenderData *rd= (RenderData*)ptr->data;
542 rd->jp2_depth= value;
543 rna_RenderSettings_jpeg2k_preset_update(rd);
547 #ifdef WITH_QUICKTIME
548 static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
550 RenderData *rd= (RenderData*)ptr->data;
552 return quicktime_rnatmpvalue_from_videocodectype(rd->qtcodecsettings.codecType);
555 static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
557 RenderData *rd= (RenderData*)ptr->data;
559 rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
562 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, int *free)
564 EnumPropertyItem *item= NULL;
565 EnumPropertyItem tmp = {0, "", 0, "", ""};
566 QuicktimeCodecTypeDesc *codecTypeDesc;
570 for(i=0;i<quicktime_get_num_videocodecs();i++) {
571 codecTypeDesc = quicktime_get_videocodecType_desc(i);
572 if (!codecTypeDesc) break;
574 tmp.value= codecTypeDesc->rnatmpvalue;
575 *((int*)id) = codecTypeDesc->codecType;
578 tmp.name= codecTypeDesc->codecName;
579 RNA_enum_item_add(&item, &totitem, &tmp);
582 RNA_enum_item_end(&item, &totitem);
589 static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
591 RenderData *rd= (RenderData*)ptr->data;
593 return quicktime_rnatmpvalue_from_audiocodectype(rd->qtcodecsettings.audiocodecType);
596 static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
598 RenderData *rd= (RenderData*)ptr->data;
600 rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
603 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr, int *free)
605 EnumPropertyItem *item= NULL;
606 EnumPropertyItem tmp = {0, "", 0, "", ""};
607 QuicktimeCodecTypeDesc *codecTypeDesc;
610 for(i=0;i<quicktime_get_num_audiocodecs();i++) {
611 codecTypeDesc = quicktime_get_audiocodecType_desc(i);
612 if (!codecTypeDesc) break;
614 tmp.value= codecTypeDesc->rnatmpvalue;
615 tmp.identifier= codecTypeDesc->codecName;
616 tmp.name= codecTypeDesc->codecName;
617 RNA_enum_item_add(&item, &totitem, &tmp);
620 RNA_enum_item_end(&item, &totitem);
628 static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
630 RenderData *rd= (RenderData*)ptr->data;
634 static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
636 RenderData *rd= (RenderData*)ptr->data;
640 static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
642 RenderData *rd= (RenderData*)ptr->data;
645 *max= BLI_countlist(&rd->layers)-1;
649 static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
651 RenderData *rd= (RenderData*)ptr->data;
652 SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
654 return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
657 static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
659 RenderData *rd= (RenderData*)ptr->data;
660 SceneRenderLayer *srl= (SceneRenderLayer*)value.data;
662 rd->actlay = BLI_findindex(&rd->layers, srl);
665 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
667 RenderData *rd= (RenderData*)ptr->data;
668 RenderEngineType *type= BLI_findlink(&R_engines, value);
671 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
674 static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *C, PointerRNA *ptr, int *free)
676 RenderEngineType *type;
677 EnumPropertyItem *item= NULL;
678 EnumPropertyItem tmp = {0, "", 0, "", ""};
681 for(type=R_engines.first; type; type=type->next, a++) {
683 tmp.identifier= type->idname;
684 tmp.name= type->name;
685 RNA_enum_item_add(&item, &totitem, &tmp);
688 RNA_enum_item_end(&item, &totitem);
694 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
696 RenderData *rd= (RenderData*)ptr->data;
697 RenderEngineType *type;
700 for(type=R_engines.first; type; type=type->next, a++)
701 if(strcmp(type->idname, rd->engine) == 0)
707 static void rna_Scene_glsl_update(Main *bmain, Scene *unused, PointerRNA *ptr)
709 Scene *scene= (Scene*)ptr->id.data;
711 DAG_id_flush_update(&scene->id, 0);
714 static void rna_RenderSettings_color_management_update(Main *bmain, Scene *unused, PointerRNA *ptr)
716 /* reset image nodes */
717 Scene *scene= (Scene*)ptr->id.data;
718 bNodeTree *ntree=scene->nodetree;
721 if(ntree && scene->use_nodes) {
722 for (node=ntree->nodes.first; node; node=node->next) {
723 if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
724 ED_node_changed_update(&scene->id, node);
725 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
727 if (node->type == CMP_NODE_IMAGE)
728 BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
733 rna_Scene_glsl_update(bmain, unused, ptr);
736 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
738 Scene *scene= (Scene*)ptr->id.data;
739 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
741 BLI_strncpy(rl->name, value, sizeof(rl->name));
743 if(scene->nodetree) {
745 int index= BLI_findindex(&scene->r.layers, rl);
747 for(node= scene->nodetree->nodes.first; node; node= node->next) {
748 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
749 if(node->custom1==index)
750 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
756 static int rna_RenderSettings_multiple_engines_get(PointerRNA *ptr)
758 return (BLI_countlist(&R_engines) > 1);
761 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
763 RenderData *rd= (RenderData*)ptr->data;
764 RenderEngineType *type;
766 for(type=R_engines.first; type; type=type->next)
767 if(strcmp(type->idname, rd->engine) == 0)
768 return (type->flag & RE_GAME);
773 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
775 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
776 rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL);
779 static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *unused, PointerRNA *ptr)
781 Scene *scene= (Scene*)ptr->id.data;
784 ntreeCompositForceHidden(scene->nodetree, scene);
787 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
789 Scene *scene= (Scene*)ptr->data;
791 scene->use_nodes= value;
792 if(scene->use_nodes && scene->nodetree==NULL)
793 ED_node_composit_default(scene);
796 static void rna_Physics_update(Main *bmain, Scene *unused, PointerRNA *ptr)
798 Scene *scene= (Scene*)ptr->id.data;
801 for(base = scene->base.first; base; base=base->next)
802 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
805 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
807 Scene *scene= (Scene*)ptr->id.data;
808 ToolSettings *ts = (ToolSettings*)ptr->data;
809 int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
812 ts->selectmode = flag;
815 Mesh *me= get_mesh(scene->basact->object);
816 if(me && me->edit_mesh && me->edit_mesh->selectmode != flag) {
817 me->edit_mesh->selectmode= flag;
818 EM_selectmode_set(me->edit_mesh);
824 static void rna_Scene_editmesh_select_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
829 me= get_mesh(scene->basact->object);
830 if(me && me->edit_mesh==NULL)
834 WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
835 WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
838 static void object_simplify_update(Object *ob)
841 ParticleSystem *psys;
843 for(md=ob->modifiers.first; md; md=md->next)
844 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
845 ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
847 for(psys=ob->particlesystem.first; psys; psys=psys->next)
848 psys->recalc |= PSYS_RECALC_CHILD;
853 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
854 object_simplify_update(gob->ob);
858 static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
863 for(SETLOOPER(scene, base))
864 object_simplify_update(base->object);
866 DAG_ids_flush_update(bmain, 0);
867 WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
870 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
872 if(scene->r.mode & R_SIMPLIFY)
873 rna_Scene_use_simplify_update(bmain, scene, ptr);
876 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
878 Scene *scene= (Scene*)ptr->data;
879 if(scene->audio.flag & AUDIO_SYNC)
881 return scene->flag & SCE_FRAME_DROP;
884 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
886 Scene *scene= (Scene*)ptr->data;
888 if(value == AUDIO_SYNC)
889 scene->audio.flag |= AUDIO_SYNC;
890 else if(value == SCE_FRAME_DROP)
892 scene->audio.flag &= ~AUDIO_SYNC;
893 scene->flag |= SCE_FRAME_DROP;
897 scene->audio.flag &= ~AUDIO_SYNC;
898 scene->flag &= ~SCE_FRAME_DROP;
902 static int rna_GameSettings_auto_start_get(PointerRNA *ptr)
904 if (G.fileflags & G_FILE_AUTOPLAY)
910 static void rna_GameSettings_auto_start_set(PointerRNA *ptr, int value)
913 G.fileflags |= G_FILE_AUTOPLAY;
915 G.fileflags &= ~G_FILE_AUTOPLAY;
919 static TimeMarker *rna_TimeLine_add(Scene *scene, char name[])
921 TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
922 marker->flag= SELECT;
924 BLI_strncpy(marker->name, name, sizeof(marker->name));
925 BLI_addtail(&scene->markers, marker);
929 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker)
931 /* try to remove the F-Curve from the action */
932 if (!BLI_remlink_safe(&scene->markers, marker)) {
933 BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in action '%s'", marker->name, scene->id.name+2);
937 /* XXX, invalidates PyObject */
943 static void rna_def_transform_orientation(BlenderRNA *brna)
948 int matrix_dimsize[]= {3, 3};
950 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
952 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
953 RNA_def_property_float_sdna(prop, NULL, "mat");
954 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
955 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
957 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
958 RNA_def_property_string_sdna(prop, NULL, "name");
959 RNA_def_struct_name_property(srna, prop);
960 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
963 static void rna_def_tool_settings(BlenderRNA *brna)
968 static EnumPropertyItem uv_select_mode_items[] = {
969 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
970 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
971 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
972 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
973 {0, NULL, 0, NULL, NULL}};
975 static EnumPropertyItem auto_key_items[] = {
976 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
977 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
978 {0, NULL, 0, NULL, NULL}};
980 static EnumPropertyItem retarget_roll_items[] = {
981 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
982 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
983 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
984 {0, NULL, 0, NULL, NULL}};
986 static EnumPropertyItem sketch_convert_items[] = {
987 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
988 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
989 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts"},
990 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
991 {0, NULL, 0, NULL, NULL}};
993 static EnumPropertyItem edge_tag_items[] = {
994 {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
995 {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
996 {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
997 {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
998 {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
999 {0, NULL, 0, NULL, NULL}};
1001 srna= RNA_def_struct(brna, "ToolSettings", NULL);
1002 RNA_def_struct_ui_text(srna, "Tool Settings", "");
1004 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
1005 RNA_def_property_struct_type(prop, "Sculpt");
1006 RNA_def_property_ui_text(prop, "Sculpt", "");
1008 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
1009 RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
1010 RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
1011 "Ensure all bone-deforming vertex groups add up to 1.0 while "
1014 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
1015 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
1016 RNA_def_property_ui_text(prop, "Vertex Paint", "");
1018 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
1019 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
1020 RNA_def_property_ui_text(prop, "Weight Paint", "");
1022 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
1023 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
1024 RNA_def_property_ui_text(prop, "Image Paint", "");
1026 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
1027 RNA_def_property_pointer_sdna(prop, NULL, "particle");
1028 RNA_def_property_ui_text(prop, "Particle Edit", "");
1031 prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
1032 RNA_def_property_enum_sdna(prop, NULL, "proportional");
1033 RNA_def_property_enum_items(prop, proportional_editing_items);
1034 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode");
1035 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1037 prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
1038 RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
1039 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing object mode");
1040 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
1041 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1043 prop= RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
1044 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
1045 RNA_def_property_enum_items(prop, proportional_falloff_items);
1046 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
1047 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1049 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
1050 RNA_def_property_float_sdna(prop, NULL, "normalsize");
1051 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
1052 RNA_def_property_range(prop, 0.00001, 1000.0);
1053 RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
1054 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
1056 prop= RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
1057 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
1058 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
1060 prop= RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
1061 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
1062 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
1063 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
1064 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1066 prop= RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
1067 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
1068 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
1069 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
1070 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1072 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
1073 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
1074 RNA_def_property_enum_items(prop, snap_element_items);
1075 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
1076 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1078 prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
1079 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
1080 RNA_def_property_enum_items(prop, snap_target_items);
1081 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
1082 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1084 prop= RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
1085 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
1086 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
1087 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
1088 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1090 prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
1091 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
1092 RNA_def_property_ui_text(prop, "Project Individual Elements", "Project vertices on the surface of other objects");
1093 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
1094 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1097 prop= RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
1098 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
1099 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
1100 RNA_def_property_ui_icon(prop, ICON_REC, 0);
1102 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
1103 RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
1104 RNA_def_property_enum_items(prop, auto_key_items);
1105 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
1107 prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
1108 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
1109 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");
1112 prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
1113 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
1114 RNA_def_property_enum_items(prop, uv_select_mode_items);
1115 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
1116 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1118 prop= RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
1119 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
1120 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
1121 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1122 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1124 prop= RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
1125 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
1126 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
1127 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1130 prop= RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
1131 RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
1132 RNA_def_property_array(prop, 3);
1133 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
1134 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
1135 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
1137 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
1138 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
1139 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
1141 /* use with MESH_OT_select_shortest_path */
1142 prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
1143 RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
1144 RNA_def_property_enum_items(prop, edge_tag_items);
1145 RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
1148 prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
1149 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
1150 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
1151 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1153 prop= RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
1154 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
1155 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
1157 prop= RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
1158 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
1159 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
1161 prop= RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
1162 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
1163 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
1165 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
1166 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1167 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
1169 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
1170 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1171 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
1173 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
1174 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
1175 RNA_def_property_flag(prop, PROP_EDITABLE);
1176 RNA_def_property_struct_type(prop, "Object");
1177 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
1178 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
1180 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
1181 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
1182 RNA_def_property_range(prop, 1, 10000);
1183 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
1184 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1186 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
1187 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
1188 RNA_def_property_range(prop, 0.00001, 1.0);
1189 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
1190 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
1191 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1193 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
1194 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
1195 RNA_def_property_range(prop, 0.00001, 100000.0);
1196 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1197 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
1198 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1200 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
1201 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
1202 RNA_def_property_enum_items(prop, retarget_roll_items);
1203 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
1205 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
1206 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
1207 RNA_def_property_enum_items(prop, sketch_convert_items);
1208 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
1209 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1211 /* Sculpt/Paint Unified Size and Strength */
1213 prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
1214 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
1215 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius", "Instead of per brush radius, the radius is shared across brushes");
1217 prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
1218 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
1219 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength", "Instead of per brush strength, the strength is shared across brushes");
1223 static void rna_def_unit_settings(BlenderRNA *brna)
1228 static EnumPropertyItem unit_systems[] = {
1229 {USER_UNIT_NONE, "NONE", 0, "None", ""},
1230 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
1231 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
1232 {0, NULL, 0, NULL, NULL}};
1234 static EnumPropertyItem rotation_units[] = {
1235 {0, "DEGREES", 0, "Degrees", ""},
1236 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
1237 {0, NULL, 0, NULL, NULL}};
1239 srna= RNA_def_struct(brna, "UnitSettings", NULL);
1240 RNA_def_struct_ui_text(srna, "Unit Settings", "");
1243 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
1244 RNA_def_property_enum_items(prop, unit_systems);
1245 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
1246 RNA_def_property_update(prop, NC_WINDOW, NULL);
1248 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
1249 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
1250 RNA_def_property_range(prop, 0.00001, 100000.0);
1251 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1252 RNA_def_property_update(prop, NC_WINDOW, NULL);
1254 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
1255 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
1256 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs");
1257 RNA_def_property_update(prop, NC_WINDOW, NULL);
1259 prop= RNA_def_property(srna, "rotation_units", PROP_ENUM, PROP_NONE);
1260 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
1261 RNA_def_property_enum_items(prop, rotation_units);
1262 RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
1263 RNA_def_property_update(prop, NC_WINDOW, NULL);
1266 void rna_def_render_layer_common(StructRNA *srna, int scene)
1270 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1271 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
1272 else RNA_def_property_string_sdna(prop, NULL, "name");
1273 RNA_def_property_ui_text(prop, "Name", "Render layer name");
1274 RNA_def_struct_name_property(srna, prop);
1275 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1276 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1278 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
1279 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
1280 RNA_def_property_struct_type(prop, "Material");
1281 RNA_def_property_flag(prop, PROP_EDITABLE);
1282 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
1283 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1284 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1286 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
1287 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
1288 RNA_def_property_struct_type(prop, "Group");
1289 RNA_def_property_flag(prop, PROP_EDITABLE);
1290 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
1291 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1292 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1295 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1296 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1297 RNA_def_property_array(prop, 20);
1298 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
1299 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
1300 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
1301 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1302 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1304 prop= RNA_def_property(srna, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
1305 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
1306 RNA_def_property_array(prop, 20);
1307 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers");
1308 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1309 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1312 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
1313 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
1314 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
1315 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1316 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1318 prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
1319 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
1320 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
1321 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1322 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1324 prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
1325 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
1326 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
1327 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1328 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1330 prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
1331 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
1332 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
1333 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1334 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1336 prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
1337 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
1338 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
1339 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1340 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1342 prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
1343 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
1344 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
1345 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1346 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1348 prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
1349 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
1350 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
1351 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1352 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1354 prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
1355 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
1356 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
1357 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1358 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1360 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
1361 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
1362 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
1363 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1364 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1366 prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
1367 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
1368 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
1369 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1370 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1373 prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
1374 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
1375 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
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, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
1380 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
1381 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
1382 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1383 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1385 prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
1386 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
1387 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
1388 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1389 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1391 prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
1392 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
1393 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
1394 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1395 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1397 prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
1398 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
1399 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
1400 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1401 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1403 prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
1404 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
1405 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
1406 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1407 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1409 prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
1410 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
1411 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
1412 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1413 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1415 prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
1416 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
1417 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
1418 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1419 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1421 prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
1422 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
1423 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
1424 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1425 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1427 prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
1428 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
1429 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
1430 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1431 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1433 prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
1434 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
1435 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
1436 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1437 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1439 prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1440 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
1441 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
1442 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1443 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1445 prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
1446 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
1447 RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
1448 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1449 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1451 prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
1452 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
1453 RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
1454 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1455 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1457 prop= RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
1458 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
1459 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
1460 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1461 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1463 prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
1464 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
1465 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
1466 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1467 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1469 prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
1470 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
1471 RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
1472 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1473 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1475 prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
1476 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
1477 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
1478 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1479 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1480 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1482 prop= RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
1483 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
1484 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
1485 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1486 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1487 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1489 prop= RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1490 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
1491 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
1492 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
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, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
1497 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
1498 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
1499 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1500 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1501 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1503 prop= RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
1504 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
1505 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
1506 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1507 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1508 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1510 prop= RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
1511 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
1512 RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
1513 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1514 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1515 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1517 prop= RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
1518 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
1519 RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
1520 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1521 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1522 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1524 prop= RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
1525 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
1526 RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
1527 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1528 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1529 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1532 static void rna_def_scene_game_data(BlenderRNA *brna)
1537 static EnumPropertyItem framing_types_items[] ={
1538 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
1539 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1540 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1541 {0, NULL, 0, NULL, NULL}};
1543 static EnumPropertyItem dome_modes_items[] ={
1544 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1545 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1546 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1547 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1548 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1549 {0, NULL, 0, NULL, NULL}};
1551 static EnumPropertyItem stereo_modes_items[] ={
1552 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1553 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1554 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1555 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1556 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1557 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1558 {0, NULL, 0, NULL, NULL}};
1560 static EnumPropertyItem stereo_items[] ={
1561 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
1562 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
1563 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
1564 {0, NULL, 0, NULL, NULL}};
1566 static EnumPropertyItem physics_engine_items[] = {
1567 {WOPHY_NONE, "NONE", 0, "None", ""},
1568 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1569 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1570 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1571 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1572 {WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
1573 {0, NULL, 0, NULL, NULL}};
1575 static EnumPropertyItem material_items[] ={
1576 {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials"},
1577 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
1578 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
1579 {0, NULL, 0, NULL, NULL}};
1581 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1582 RNA_def_struct_sdna(srna, "GameData");
1583 RNA_def_struct_nested(brna, srna, "Scene");
1584 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
1586 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1587 RNA_def_property_int_sdna(prop, NULL, "xplay");
1588 RNA_def_property_range(prop, 4, 10000);
1589 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
1590 RNA_def_property_update(prop, NC_SCENE, NULL);
1592 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1593 RNA_def_property_int_sdna(prop, NULL, "yplay");
1594 RNA_def_property_range(prop, 4, 10000);
1595 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
1596 RNA_def_property_update(prop, NC_SCENE, NULL);
1598 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
1599 RNA_def_property_int_sdna(prop, NULL, "depth");
1600 RNA_def_property_range(prop, 8, 32);
1601 RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
1602 RNA_def_property_update(prop, NC_SCENE, NULL);
1604 // Do we need it here ? (since we already have it in World
1605 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1606 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1607 RNA_def_property_range(prop, 4, 2000);
1608 RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display");
1609 RNA_def_property_update(prop, NC_SCENE, NULL);
1611 prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
1612 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1613 RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
1614 RNA_def_property_update(prop, NC_SCENE, NULL);
1617 prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
1618 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1619 RNA_def_property_enum_items(prop, framing_types_items);
1620 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
1621 RNA_def_property_update(prop, NC_SCENE, NULL);
1623 prop= RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
1624 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1625 RNA_def_property_array(prop, 3);
1626 RNA_def_property_ui_text(prop, "Framing Color", "Set colour of the bars");
1627 RNA_def_property_update(prop, NC_SCENE, NULL);
1630 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1631 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1632 RNA_def_property_enum_items(prop, stereo_items);
1633 RNA_def_property_ui_text(prop, "Stereo Options", "");
1634 RNA_def_property_update(prop, NC_SCENE, NULL);
1636 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1637 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1638 RNA_def_property_enum_items(prop, stereo_modes_items);
1639 RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
1640 RNA_def_property_update(prop, NC_SCENE, NULL);
1642 prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
1643 RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
1644 RNA_def_property_range(prop, 0.01, 5.0);
1645 RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
1646 RNA_def_property_update(prop, NC_SCENE, NULL);
1649 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1650 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1651 RNA_def_property_enum_items(prop, dome_modes_items);
1652 RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
1653 RNA_def_property_update(prop, NC_SCENE, NULL);
1655 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1656 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1657 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1658 RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
1659 RNA_def_property_update(prop, NC_SCENE, NULL);
1661 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1662 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1663 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1664 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1665 RNA_def_property_update(prop, NC_SCENE, NULL);
1667 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1668 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1669 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1670 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1671 RNA_def_property_update(prop, NC_SCENE, NULL);
1673 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1674 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1675 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1676 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1677 RNA_def_property_update(prop, NC_SCENE, NULL);
1679 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
1680 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
1681 RNA_def_property_struct_type(prop, "Text");
1682 RNA_def_property_flag(prop, PROP_EDITABLE);
1683 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
1684 RNA_def_property_update(prop, NC_SCENE, NULL);
1687 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
1688 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
1689 RNA_def_property_enum_items(prop, physics_engine_items);
1690 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
1691 RNA_def_property_update(prop, NC_SCENE, NULL);
1693 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
1694 RNA_def_property_float_sdna(prop, NULL, "gravity");
1695 RNA_def_property_range(prop, 0.0, 25.0);
1696 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
1697 RNA_def_property_update(prop, NC_SCENE, NULL);
1699 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_FLOAT, PROP_NONE);
1700 RNA_def_property_float_sdna(prop, NULL, "occlusionRes");
1701 RNA_def_property_range(prop, 128.0, 1024.0);
1702 RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
1703 RNA_def_property_update(prop, NC_SCENE, NULL);
1705 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1706 RNA_def_property_int_sdna(prop, NULL, "ticrate");
1707 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
1708 RNA_def_property_range(prop, 1, 250);
1709 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");
1710 RNA_def_property_update(prop, NC_SCENE, NULL);
1712 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
1713 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
1714 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1715 RNA_def_property_range(prop, 1, 5);
1716 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");
1717 RNA_def_property_update(prop, NC_SCENE, NULL);
1719 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
1720 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
1721 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1722 RNA_def_property_range(prop, 1, 5);
1723 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");
1724 RNA_def_property_update(prop, NC_SCENE, NULL);
1726 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
1727 RNA_def_property_int_sdna(prop, NULL, "physubstep");
1728 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1729 RNA_def_property_range(prop, 1, 5);
1730 RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
1731 RNA_def_property_update(prop, NC_SCENE, NULL);
1734 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
1735 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
1736 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
1738 // not used // deprecated !!!!!!!!!!!!!
1739 prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
1740 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
1741 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
1743 // not used // deprecated !!!!!!!!!!!!!
1744 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
1745 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
1746 RNA_def_property_range(prop, 0.0, 1000.0);
1747 RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
1750 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
1751 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
1752 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
1754 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
1755 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
1756 RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs");
1758 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
1759 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
1760 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
1762 prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
1763 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
1764 RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
1766 prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
1767 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
1768 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
1770 prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
1771 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
1772 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
1774 prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
1775 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
1776 RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
1778 prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
1779 RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
1780 RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
1783 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
1784 RNA_def_property_enum_sdna(prop, NULL, "matmode");
1785 RNA_def_property_enum_items(prop, material_items);
1786 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
1787 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1789 prop= RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
1790 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
1791 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
1792 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1794 prop= RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
1795 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
1796 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
1797 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1799 prop= RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
1800 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
1801 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
1802 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1804 prop= RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
1805 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
1806 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
1807 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1809 prop= RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
1810 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
1811 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
1812 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1814 prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
1815 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
1816 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
1817 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1820 static void rna_def_scene_render_layer(BlenderRNA *brna)
1824 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
1825 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
1826 RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
1828 rna_def_render_layer_common(srna, 1);
1832 static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
1837 // FunctionRNA *func;
1838 // PropertyRNA *parm;
1840 RNA_def_property_srna(cprop, "RenderLayers");
1841 srna= RNA_def_struct(brna, "RenderLayers", NULL);
1842 RNA_def_struct_sdna(srna, "RenderData");
1843 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
1845 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
1846 RNA_def_property_int_sdna(prop, NULL, "actlay");
1847 RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
1848 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
1849 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1851 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
1852 RNA_def_property_struct_type(prop, "SceneRenderLayer");
1853 RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get", "rna_RenderSettings_active_layer_set", NULL, NULL);
1854 RNA_def_property_flag(prop, PROP_EDITABLE);
1855 RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
1856 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1860 static void rna_def_scene_render_data(BlenderRNA *brna)
1865 static EnumPropertyItem pixel_filter_items[] ={
1866 {R_FILTER_BOX, "BOX", 0, "Box", ""},
1867 {R_FILTER_TENT, "TENT", 0, "Tent", ""},
1868 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""},
1869 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""},
1870 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""},
1871 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""},
1872 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""},
1873 {0, NULL, 0, NULL, NULL}};
1875 static EnumPropertyItem alpha_mode_items[] ={
1876 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
1877 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
1878 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
1879 {0, NULL, 0, NULL, NULL}};
1881 static EnumPropertyItem color_mode_items[] ={
1882 {R_PLANESBW, "BW", 0, "BW", "Images are saved with BW (grayscale) data"},
1883 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
1884 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
1885 {0, NULL, 0, NULL, NULL}};
1887 static EnumPropertyItem display_mode_items[] ={
1888 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
1889 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
1890 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
1891 {0, NULL, 0, NULL, NULL}};
1894 static EnumPropertyItem bake_mode_items[] ={
1895 {RE_BAKE_ALL, "FULL", 0, "Full Render", ""},
1896 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""},
1897 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""},
1898 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""},
1899 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""},
1900 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""},
1901 {0, NULL, 0, NULL, NULL}};
1903 static EnumPropertyItem bake_normal_space_items[] ={
1904 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""},
1905 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""},
1906 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""},
1907 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
1908 {0, NULL, 0, NULL, NULL}};
1910 static EnumPropertyItem bake_qyad_split_items[] ={
1911 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
1912 {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
1913 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
1914 {0, NULL, 0, NULL, NULL}};
1916 static EnumPropertyItem octree_resolution_items[] = {
1917 {64, "64", 0, "64", ""},
1918 {128, "128", 0, "128", ""},
1919 {256, "256", 0, "256", ""},
1920 {512, "512", 0, "512", ""},
1921 {0, NULL, 0, NULL, NULL}};
1923 static EnumPropertyItem raytrace_structure_items[] = {
1924 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""},
1925 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"},
1926 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
1927 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""},
1928 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""},
1929 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""},
1930 {0, NULL, 0, NULL, NULL}
1933 static EnumPropertyItem fixed_oversample_items[] = {
1934 {5, "5", 0, "5", ""},
1935 {8, "8", 0, "8", ""},
1936 {11, "11", 0, "11", ""},
1937 {16, "16", 0, "16", ""},
1938 {0, NULL, 0, NULL, NULL}};
1940 static EnumPropertyItem field_order_items[] = {
1941 {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"},
1942 {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"},
1943 {0, NULL, 0, NULL, NULL}};
1945 static EnumPropertyItem threads_mode_items[] = {
1946 {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
1947 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
1948 {0, NULL, 0, NULL, NULL}};
1951 static EnumPropertyItem exr_codec_items[] = {
1952 {0, "NONE", 0, "None", ""},
1953 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
1954 {2, "ZIP", 0, "ZIP (lossless)", ""},
1955 {3, "PIZ", 0, "PIZ (lossless)", ""},
1956 {4, "RLE", 0, "RLE (lossless)", ""},
1957 {0, NULL, 0, NULL, NULL}};
1960 #ifdef WITH_OPENJPEG
1961 static EnumPropertyItem jp2_preset_items[] = {
1962 {0, "NO_PRESET", 0, "No Preset", ""},
1963 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
1964 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
1965 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
1966 {4, "CINE_SCOPE_48FPS", 0, "Cine-Scope 24fps 2048x858", ""},
1967 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
1968 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
1969 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
1970 {0, NULL, 0, NULL, NULL}};
1972 static EnumPropertyItem jp2_depth_items[] = {
1973 {8, "8", 0, "8", "8 bit color channels"},
1974 {12, "12", 0, "12", "12 bit color channels"},
1975 {16, "16", 0, "16", "16 bit color channels"},
1976 {0, NULL, 0, NULL, NULL}};
1979 #ifdef WITH_QUICKTIME
1980 static EnumPropertyItem quicktime_codec_type_items[] = {
1981 {0, "codec", 0, "codec", ""},
1982 {0, NULL, 0, NULL, NULL}};
1985 static EnumPropertyItem quicktime_audio_samplerate_items[] = {
1986 {22050, "22050", 0, "22kHz", ""},
1987 {44100, "44100", 0, "44.1kHz", ""},
1988 {48000, "48000", 0, "48kHz", ""},
1989 {88200, "88200", 0, "88.2kHz", ""},
1990 {96000, "96000", 0, "96kHz", ""},
1991 {192000, "192000", 0, "192kHz", ""},
1992 {0, NULL, 0, NULL, NULL}};
1994 static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
1995 {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
1996 {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
1997 {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
1998 {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
1999 {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
2000 {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
2001 {0, NULL, 0, NULL, NULL}};
2003 static EnumPropertyItem quicktime_audio_bitrate_items[] = {
2004 {64000, "64000", 0, "64kbps", ""},
2005 {112000, "112000", 0, "112kpbs", ""},
2006 {128000, "128000", 0, "128kbps", ""},
2007 {192000, "192000", 0, "192kbps", ""},
2008 {256000, "256000", 0, "256kbps", ""},
2009 {320000, "320000", 0, "320kbps", ""},
2010 {0, NULL, 0, NULL, NULL}};
2015 static EnumPropertyItem ffmpeg_format_items[] = {
2016 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
2017 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
2018 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
2019 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
2020 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
2021 {FFMPEG_DV, "DV", 0, "DV", ""},
2022 {FFMPEG_H264, "H264", 0, "H.264", ""},
2023 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
2024 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
2025 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
2026 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
2027 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
2028 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
2029 {0, NULL, 0, NULL, NULL}};
2031 static EnumPropertyItem ffmpeg_codec_items[] = {
2032 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2033 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
2034 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
2035 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
2036 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
2037 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
2038 {CODEC_ID_H264, "H264", 0, "H.264", ""},
2039 {CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
2040 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
2041 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
2042 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
2043 {0, NULL, 0, NULL, NULL}};
2045 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
2046 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2047 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
2048 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
2049 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
2050 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
2051 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
2052 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
2053 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
2054 {0, NULL, 0, NULL, NULL}};
2057 static EnumPropertyItem engine_items[] = {
2058 {0, "BLENDER_RENDER", 0, "Blender Render", ""},
2059 {0, NULL, 0, NULL, NULL}};
2061 srna= RNA_def_struct(brna, "RenderSettings", NULL);
2062 RNA_def_struct_sdna(srna, "RenderData");
2063 RNA_def_struct_nested(brna, srna, "Scene");
2064 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
2065 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
2067 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
2068 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
2069 RNA_def_property_enum_items(prop, color_mode_items);
2070 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");
2071 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2073 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
2074 RNA_def_property_int_sdna(prop, NULL, "xsch");
2075 RNA_def_property_range(prop, 4, 10000);
2076 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
2077 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2079 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
2080 RNA_def_property_int_sdna(prop, NULL, "ysch");
2081 RNA_def_property_range(prop, 4, 10000);
2082 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
2083 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2085 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
2086 RNA_def_property_int_sdna(prop, NULL, "size");
2087 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
2088 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
2089 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2091 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
2092 RNA_def_property_int_sdna(prop, NULL, "xparts");
2093 RNA_def_property_range(prop, 1, 512);
2094 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
2095 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2097 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
2098 RNA_def_property_int_sdna(prop, NULL, "yparts");
2099 RNA_def_property_range(prop, 1, 512);
2100 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
2101 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2103 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
2104 RNA_def_property_float_sdna(prop, NULL, "xasp");
2105 RNA_def_property_range(prop, 1.0f, 200.0f);
2106 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
2107 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2109 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
2110 RNA_def_property_float_sdna(prop, NULL, "yasp");
2111 RNA_def_property_range(prop, 1.0f, 200.0f);
2112 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
2113 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2115 /* JPEG and AVI JPEG */
2117 prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
2118 RNA_def_property_int_sdna(prop, NULL, "quality");
2119 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
2120 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, Compression for PNG's");
2121 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2125 prop= RNA_def_property(srna, "use_tiff_16bit", PROP_BOOLEAN, PROP_NONE);
2126 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
2127 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
2128 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2130 /* Cineon and DPX */
2132 prop= RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
2133 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
2134 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
2135 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2137 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
2138 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
2139 RNA_def_property_range(prop, 0, 1024);
2140 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
2141 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2143 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
2144 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
2145 RNA_def_property_range(prop, 0, 1024);
2146 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
2147 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2149 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
2150 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
2151 RNA_def_property_range(prop, 0.0f, 10.0f);
2152 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
2153 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2158 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
2159 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
2160 RNA_def_property_enum_items(prop, exr_codec_items);
2161 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
2162 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2164 prop= RNA_def_property(srna, "use_exr_half", PROP_BOOLEAN, PROP_NONE);
2165 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
2166 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
2167 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2169 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
2170 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
2171 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int zbuffer)");
2172 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2174 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
2175 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
2176 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
2177 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2180 #ifdef WITH_OPENJPEG
2183 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
2184 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
2185 RNA_def_property_enum_items(prop, jp2_preset_items);
2186 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_preset_set", NULL);
2187 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
2188 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2190 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
2191 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
2192 RNA_def_property_enum_items(prop, jp2_depth_items);
2193 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_depth_set", NULL);
2194 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
2195 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2197 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
2198 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
2199 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
2200 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2203 #ifdef WITH_QUICKTIME
2206 prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
2207 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
2208 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2209 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
2210 "rna_RenderSettings_qtcodecsettings_codecType_set",
2211 "rna_RenderSettings_qtcodecsettings_codecType_itemf");
2212 RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
2213 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2215 prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
2216 RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
2217 RNA_def_property_range(prop, 0, 100);
2218 RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
2219 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2222 prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE);
2223 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType");
2224 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2225 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
2226 "rna_RenderSettings_qtcodecsettings_audiocodecType_set",
2227 "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
2228 RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
2229 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2231 prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE);
2232 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate");
2233 RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
2234 RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
2235 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2237 prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE);
2238 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth");
2239 RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
2240 RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
2241 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2243 prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
2244 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
2245 RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
2246 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2248 prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
2249 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
2250 RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
2251 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2253 prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE);
2254 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate");
2255 RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
2256 RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
2257 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2264 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
2265 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
2266 RNA_def_property_enum_items(prop, ffmpeg_format_items);
2267 RNA_def_property_ui_text(prop, "Format", "Output file format");
2268 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2270 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
2271 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
2272 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
2273 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
2274 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2276 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
2277 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
2278 RNA_def_property_range(prop, 1, 14000);
2279 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
2280 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2282 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
2283 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
2284 RNA_def_property_range(prop, 0, 9000);
2285 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
2286 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2288 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
2289 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
2290 RNA_def_property_range(prop, 1, 14000);
2291 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
2292 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2294 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
2295 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
2296 RNA_def_property_range(prop, 0, 100000000);
2297 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
2298 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2300 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
2301 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
2302 RNA_def_property_range(prop, 0, 100);
2303 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
2304 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2306 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
2307 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
2308 RNA_def_property_range(prop, 0, 2000);
2309 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
2310 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2312 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
2313 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
2314 RNA_def_property_range(prop, 0, 16384);
2315 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
2316 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2318 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
2319 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
2320 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
2321 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2324 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
2325 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
2326 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
2327 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
2328 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2330 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
2331 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
2332 RNA_def_property_range(prop, 32, 384);
2333 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
2334 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2336 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
2337 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
2338 RNA_def_property_range(prop, 8000, 192000);
2339 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
2340 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2342 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
2343 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
2344 RNA_def_property_range(prop, 0.0f, 1.0f);
2345 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
2346 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2350 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2351 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
2352 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2353 RNA_def_property_range(prop, 1, 120);
2354 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
2355 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2357 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
2358 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
2359 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2360 RNA_def_property_range(prop, 0.1f, 120.0f);
2361 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
2362 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2364 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
2365 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
2366 RNA_def_property_range(prop, 0.0f, 2.0f);
2367 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding");
2368 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2370 prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
2371 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
2372 RNA_def_property_enum_items(prop, pixel_filter_items);
2373 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
2374 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2376 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
2377 RNA_def_property_float_sdna(prop, NULL, "gauss");
2378 RNA_def_property_range(prop, 0.5f, 1.5f);
2379 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
2380 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2382 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2383 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
2384 RNA_def_property_enum_items(prop, alpha_mode_items);
2385 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2386 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2388 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
2389 RNA_def_property_enum_sdna(prop, NULL, "ocres");
2390 RNA_def_property_enum_items(prop, octree_resolution_items);
2391 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes");
2392 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2394 prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
2395 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
2396 RNA_def_property_enum_items(prop, raytrace_structure_items);
2397 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
2398 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2400 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
2401 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
2402 RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates");
2403 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2405 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
2406 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
2407 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");
2408 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2410 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2411 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
2412 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
2413 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2415 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
2416 RNA_def_property_enum_sdna(prop, NULL, "osa");
2417 RNA_def_property_enum_items(prop, fixed_oversample_items);
2418 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
2419 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2421 prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
2422 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
2423 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
2424 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2426 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
2427 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2428 RNA_def_property_enum_items(prop, field_order_items);
2429 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");
2430 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2432 prop= RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
2433 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
2434 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
2435 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2437 /* rendering features */
2438 prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
2439 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
2440 RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
2441 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2443 prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
2444 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
2445 RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
2446 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2448 prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
2449 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
2450 RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
2451 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2453 prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
2454 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
2455 RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
2456 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2458 prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
2459 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
2460 RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
2461 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2463 prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
2464 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
2465 RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
2466 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2468 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
2469 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
2470 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
2471 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2473 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
2474 RNA_def_property_int_sdna(prop, NULL, "edgeint");
2475 RNA_def_property_range(prop, 0, 255);
2476 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
2477 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2479 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
2480 RNA_def_property_float_sdna(prop, NULL, "edgeR");
2481 RNA_def_property_array(prop, 3);
2482 RNA_def_property_ui_text(prop, "Edge Color", "");
2483 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2486 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
2487 RNA_def_property_int_sdna(prop, NULL, "threads");
2488 RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
2489 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
2490 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
2491 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2493 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
2494 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2495 RNA_def_property_enum_items(prop, threads_mode_items);
2496 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
2497 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2500 prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
2501 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
2502 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
2503 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2505 prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
2506 RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
2507 RNA_def_property_range(prop, 1, 32);
2508 RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
2509 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2511 prop= RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
2512 RNA_def_property_float_sdna(prop, NULL, "blurfac");
2513 RNA_def_property_range(prop, 0.01f, 10.0f);
2514 RNA_def_property_ui_range(prop, 0.01, 2.0f, 1, 0);
2515 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
2516 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2519 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
2520 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
2521 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");
2522 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2524 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
2525 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
2526 RNA_def_property_range(prop, 0.0f, 1.0f);
2527 RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border");
2528 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2530 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
2531 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
2532 RNA_def_property_range(prop, 0.0f, 1.0f);
2533 RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
2534 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2536 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
2537 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
2538 RNA_def_property_range(prop, 0.0f, 1.0f);
2539 RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
2540 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2542 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
2543 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
2544 RNA_def_property_range(prop, 0.0f, 1.0f);
2545 RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
2546 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2548 prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
2549 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
2550 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
2551 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2553 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
2554 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
2555 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
2556 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2558 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2559 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2560 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
2561 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2563 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
2564 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
2565 RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled");
2566 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2568 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
2569 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
2570 RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist");
2571 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2573 prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
2574 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
2575 RNA_def_property_ui_text(prop, "Color Management", "Use linear workflow - gamma corrected imaging pipeline");
2576 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_RenderSettings_color_management_update");
2579 prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
2580 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
2581 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
2582 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2584 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
2585 RNA_def_property_enum_sdna(prop, NULL, "imtype");
2586 RNA_def_property_enum_items(prop, image_type_items);
2587 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
2588 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
2589 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2591 prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
2592 RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
2593 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
2594 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2596 prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
2597 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
2598 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2599 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
2601 prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
2602 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2603 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing");
2604 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2606 prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
2607 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
2608 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
2609 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2611 prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
2612 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
2613 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
2614 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)");
2615 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2617 prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
2618 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
2619 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
2620 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");
2621 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2623 prop= RNA_def_property(srna, "use_backbuf", PROP_BOOLEAN, PROP_NONE);
2624 RNA_def_property_boolean_sdna(prop, NULL, "bufflag", R_BACKBUF);
2625 RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image");
2626 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2628 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2629 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
2630 RNA_def_property_enum_items(prop, display_mode_items);
2631 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
2632 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2634 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
2635 RNA_def_property_string_sdna(prop, NULL, "pic");
2636 RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers");
2637 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2641 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
2642 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
2643 RNA_def_property_enum_items(prop, bake_mode_items);
2644 RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
2646 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
2647 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
2648 RNA_def_property_enum_items(prop, bake_normal_space_items);
2649 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
2651 prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
2652 RNA_def_property_enum_items(prop, bake_qyad_split_items);
2653 RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
2655 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
2656 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
2657 RNA_def_property_enum_items(prop, fixed_oversample_items);
2658 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
2660 prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
2661 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
2662 RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
2664 prop= RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
2665 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
2666 RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings");
2668 prop= RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
2669 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
2670 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
2672 prop= RNA_def_property(srna, "use_bake_antialiasing", PROP_BOOLEAN, PROP_NONE);
2673 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
2674 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
2676 prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
2677 RNA_def_property_int_sdna(prop, NULL, "bake_filter");
2678 RNA_def_property_range(prop, 0, 32);
2679 RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
2681 prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
2682 RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
2683 RNA_def_property_range(prop, 0.0, 1000.0);
2684 RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
2686 prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
2687 RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
2688 RNA_def_property_range(prop, 0.0, 1000.0);
2689 RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
2693 prop= RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
2694 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
2695 RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
2696 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2698 prop= RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
2699 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
2700 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
2701 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2703 prop= RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
2704 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
2705 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
2706 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2708 prop= RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
2709 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
2710 RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
2711 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2713 prop= RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
2714 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
2715 RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
2716 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2718 prop= RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
2719 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
2720 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
2721 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2723 prop= RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
2724 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
2725 RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
2726 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2728 prop= RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
2729 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
2730 RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
2731 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2733 prop= RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
2734 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
2735 RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
2736 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2738 prop= RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
2739 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
2740 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
2741 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2743 prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
2744 RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
2745 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
2746 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2748 prop= RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
2749 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
2750 RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
2751 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2753 prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
2754 RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
2755 RNA_def_property_range(prop, 8, 64);
2756 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
2757 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2759 prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
2760 RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
2761 RNA_def_property_array(prop, 4);
2762 RNA_def_property_range(prop,0.0,1.0);
2763 RNA_def_property_ui_text(prop, "Stamp Text Color", "Color to use for stamp text");
2764 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2766 prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
2767 RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
2768 RNA_def_property_array(prop, 4);
2769 RNA_def_property_range(prop,0.0,1.0);
2770 RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
2771 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2773 /* sequencer draw options */
2775 prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
2776 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV);
2777 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2779 prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
2780 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND);
2781 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2784 prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
2785 RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
2786 RNA_def_property_enum_items(prop, viewport_shade_items);
2787 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2789 prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
2790 RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
2791 RNA_def_property_enum_items(prop, viewport_shade_items);
2792 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2796 prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
2797 RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
2798 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2799 RNA_def_property_ui_text(prop, "Render Layers", "");
2800 rna_def_render_layers(brna, prop);
2803 prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
2804 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
2805 RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
2806 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2809 prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
2810 RNA_def_property_enum_items(prop, engine_items);
2811 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set", "rna_RenderSettings_engine_itemf");
2812 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
2813 RNA_def_property_update(prop, NC_WINDOW, NULL);
2815 prop= RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
2816 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
2817 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2818 RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
2820 prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
2821 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
2822 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2823 RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine");
2826 prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
2827 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
2828 RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
2829 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
2831 prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
2832 RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
2833 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
2834 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
2835 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2837 prop= RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
2838 RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
2839 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
2840 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2842 prop= RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
2843 RNA_def_property_int_sdna(prop, NULL, "simplify_shadowsamples");
2844 RNA_def_property_ui_range(prop, 1, 16, 1, 0);
2845 RNA_def_property_ui_text(prop, "Simplify Shadow Samples", "Global maximum shadow samples");
2846 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2848 prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
2849 RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
2850 RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor");
2851 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2853 prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
2854 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
2855 RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated");
2858 RNA_api_scene_render(srna);
2862 static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
2870 RNA_def_property_srna(cprop, "SceneObjects");
2871 srna= RNA_def_struct(brna, "SceneObjects", NULL);
2872 RNA_def_struct_sdna(srna, "Scene");
2873 RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
2875 func= RNA_def_function(srna, "link", "rna_Scene_object_link");
2876 RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after.");
2877 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
2878 parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
2879 RNA_def_property_flag(parm, PROP_REQUIRED);
2880 parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
2881 RNA_def_function_return(func, parm);
2883 func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
2884 RNA_def_function_ui_description(func, "Unlink object from scene.");
2885 RNA_def_function_flag(func, FUNC_USE_REPORTS);
2886 parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
2887 RNA_def_property_flag(parm, PROP_REQUIRED);
2889 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2890 RNA_def_property_struct_type(prop, "Object");
2891 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL, NULL);
2892 RNA_def_property_flag(prop, PROP_EDITABLE);
2893 RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene");
2894 /* Could call: ED_base_object_activate(C, scene->basact);
2895 * but would be a bad level call and it seems the notifier is enough */
2896 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
2901 static void rna_def_scene_bases(BlenderRNA *brna, PropertyRNA *cprop)
2906 // FunctionRNA *func;
2907 // PropertyRNA *parm;
2909 RNA_def_property_srna(cprop, "SceneBases");
2910 srna= RNA_def_struct(brna, "SceneBases", NULL);
2911 RNA_def_struct_sdna(srna, "Scene");
2912 RNA_def_struct_ui_text(srna, "Scene Bases", "Collection of scene bases");
2914 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2915 RNA_def_property_struct_type(prop, "ObjectBase");
2916 RNA_def_property_pointer_sdna(prop, NULL, "basact");
2917 RNA_def_property_flag(prop, PROP_EDITABLE);
2918 RNA_def_property_ui_text(prop, "Active Base", "Active object base in the scene");
2919 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
2922 /* scene.timeline_markers */
2923 static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
2930 RNA_def_property_srna(cprop, "TimelineMarkers");
2931 srna= RNA_def_struct(brna, "TimelineMarkers", NULL);
2932 RNA_def_struct_sdna(srna, "Scene");
2933 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
2935 func= RNA_def_function(srna, "new", "rna_TimeLine_add");
2936 RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
2937 parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
2938 RNA_def_property_flag(parm, PROP_REQUIRED);
2940 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
2941 RNA_def_function_return(func, parm);
2944 func= RNA_def_function(srna, "remove", "rna_TimeLine_remove");
2945 RNA_def_function_ui_description(func, "Remove a timeline marker.");
2946 RNA_def_function_flag(func, FUNC_USE_REPORTS);
2947 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
2948 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
2951 /* scene.keying_sets */
2952 static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
2957 // FunctionRNA *func;
2958 // PropertyRNA *parm;
2960 RNA_def_property_srna(cprop, "KeyingSets");
2961 srna= RNA_def_struct(brna, "KeyingSets", NULL);
2962 RNA_def_struct_sdna(srna, "Scene");
2963 RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
2966 func= RNA_def_function(srna, "new", "rna_Curve_spline_new");
2967 RNA_def_function_ui_description(func, "Add a new spline to the curve.");
2968 parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline.");
2969 RNA_def_property_flag(parm, PROP_REQUIRED);
2970 parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline.");
2971 RNA_def_function_return(func, parm);
2973 func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
2974 RNA_def_function_ui_description(func, "Remove a spline from a curve.");
2975 RNA_def_function_flag(func, FUNC_USE_REPORTS);
2976 parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
2977 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
2980 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2981 RNA_def_property_struct_type(prop, "KeyingSet");
2982 RNA_def_property_flag(prop, PROP_EDITABLE);
2983 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
2984 RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
2985 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2987 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
2988 RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
2989 RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
2990 RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
2991 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2994 static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
2999 RNA_def_property_srna(cprop, "KeyingSetsAll");
3000 srna= RNA_def_struct(brna, "KeyingSetsAll", NULL);
3001 RNA_def_struct_sdna(srna, "Scene");
3002 RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
3004 /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
3006 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3007 RNA_def_property_struct_type(prop, "KeyingSet");
3008 RNA_def_property_flag(prop, PROP_EDITABLE);
3009 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
3010 RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
3011 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3013 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
3014 RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
3015 RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
3016 RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
3017 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3020 void RNA_def_scene(BlenderRNA *brna)
3026 static EnumPropertyItem audio_distance_model_items[] = {
3027 {0, "NONE", 0, "None", "No distance attenuation"},
3028 {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
3029 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
3030 {3, "LINEAR", 0, "Linear", "Linear distance model"},
3031 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
3032 {5, "EXPONENT", 0, "Exponent", "Exponent distance model"},
3033 {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping"},
3034 {0, NULL, 0, NULL, NULL}};
3036 static EnumPropertyItem sync_mode_items[] = {
3037 {0, "NONE", 0, "No Sync", "Do not sync, play every frame"},
3038 {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
3039 {AUDIO_SYNC, "AUDIO_SYNC", 0, "AV-sync", "Sync to audio playback, dropping frames"},
3040 {0, NULL, 0, NULL, NULL}};
3042 /* Struct definition */
3043 srna= RNA_def_struct(brna, "Scene", "ID");
3044 RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings");
3045 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
3046 RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
3048 /* Global Settings */
3049 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
3050 RNA_def_property_flag(prop, PROP_EDITABLE);
3051 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
3052 RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene");
3053 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_view3d_update");
3055 prop= RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
3056 RNA_def_property_pointer_sdna(prop, NULL, "set");
3057 RNA_def_property_struct_type(prop, "Scene");
3058 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
3059 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL, NULL);
3060 RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
3061 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
3063 prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
3064 RNA_def_property_flag(prop, PROP_EDITABLE);
3065 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
3066 RNA_def_property_update(prop, NC_SCENE|NC_WORLD, NULL);
3068 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
3069 RNA_def_property_float_sdna(prop, NULL, "cursor");
3070 RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location");
3071 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
3072 RNA_def_property_update(prop, NC_WINDOW, NULL);
3075 prop= RNA_def_property(srna, "object_bases", PROP_COLLECTION, PROP_NONE);
3076 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
3077 RNA_def_property_struct_type(prop, "ObjectBase");
3078 RNA_def_property_ui_text(prop, "Bases", "");
3079 rna_def_scene_bases(brna, prop);
3081 prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
3082 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
3083 RNA_def_property_struct_type(prop, "Object");
3084 RNA_def_property_ui_text(prop, "Objects", "");
3085 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0);
3086 rna_def_scene_objects(brna, prop);
3089 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
3090 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
3091 RNA_def_property_array(prop, 20);
3092 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
3093 RNA_def_property_ui_text(prop, "Layers", "Layers visible when rendering the scene");
3094 RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_view3d_update");
3096 /* Frame Range Stuff */
3097 prop= RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
3098 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3099 RNA_def_property_int_sdna(prop, NULL, "r.cfra");
3100 RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
3101 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL);
3102 RNA_def_property_ui_text(prop, "Current Frame", "");
3103 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
3104 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
3106 prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
3107 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3108 RNA_def_property_int_sdna(prop, NULL, "r.sfra");
3109 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
3110 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
3111 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
3112 RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL);
3114 prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);