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 "RNA_access.h"
155 #include "MEM_guardedalloc.h"
157 #include "BKE_context.h"
158 #include "BKE_global.h"
159 #include "BKE_image.h"
160 #include "BKE_main.h"
161 #include "BKE_node.h"
162 #include "BKE_pointcache.h"
163 #include "BKE_scene.h"
164 #include "BKE_depsgraph.h"
165 #include "BKE_image.h"
166 #include "BKE_mesh.h"
167 #include "BKE_sound.h"
168 #include "BKE_screen.h"
169 #include "BKE_animsys.h"
171 #include "BLI_threads.h"
172 #include "BLI_editVert.h"
173 #include "BLI_blenlib.h"
179 #include "ED_view3d.h"
181 #include "ED_keyframing.h"
183 #include "RE_pipeline.h"
185 static PointerRNA rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key)
187 Scene *scene= (Scene*)ptr->data;
190 for(base= scene->base.first; base; base= base->next) {
191 if(strncmp(base->object->id.name+2, key, sizeof(base->object->id.name)-2)==0) {
192 return rna_pointer_inherit_refine(ptr, &RNA_ObjectBase, base);
196 return PointerRNA_NULL;
199 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
201 ListBaseIterator *internal= iter->internal;
203 /* we are actually iterating a Base list, so override get */
204 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
207 static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
209 Scene *scene_act= CTX_data_scene(C);
212 if (object_in_scene(ob, scene)) {
213 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
217 base= scene_add_base(scene, ob);
220 /* this is similar to what object_add_type and add_object do */
221 base->lay= scene->lay;
223 /* when linking to an inactive scene dont touch the layer */
224 if(scene == scene_act)
227 ob->recalc |= OB_RECALC_ALL;
229 /* slows down importers too much, run scene.update() */
230 /* DAG_scene_sort(G.main, scene); */
232 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
237 static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
239 Base *base= object_in_scene(ob, scene);
241 BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'.", ob->id.name+2, scene->id.name+2);
244 if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
245 BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink.", ob->id.name+2);
248 if(scene->basact==base) {
252 BLI_remlink(&scene->base, base);
257 /* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
258 DAG_scene_sort(G.main, scene);
259 DAG_ids_flush_update(G.main, 0);
261 WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
264 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
266 ToolSettings *ts = (ToolSettings*)ptr->data;
267 if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
268 ts->skgen_template = value.data;
270 ts->skgen_template = NULL;
273 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
275 Scene *scene= (Scene*)ptr->data;
276 return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
279 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
281 Scene *scene= (Scene*)ptr->data;
283 scene->basact= object_in_scene((Object*)value.data, scene);
288 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
290 Scene *scene= (Scene*)ptr->data;
291 Scene *set= (Scene*)value.data;
294 for(nested_set= set; nested_set; nested_set= nested_set->set) {
295 if(nested_set==scene)
302 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
304 Scene *scene= (Scene*)ptr->data;
306 scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
309 static void rna_Scene_view3d_update(Main *bmain, Scene *unused, PointerRNA *ptr)
311 Scene *scene= (Scene*)ptr->data;
313 BKE_screen_view3d_main_sync(&bmain->screen, scene);
316 static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
318 Scene *data= (Scene*)ptr->data;
320 /* if negative frames aren't allowed, then we can't use them */
321 FRAMENUMBER_MIN_CLAMP(value);
325 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
327 Scene *data= (Scene*)ptr->data;
328 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
329 CLAMP(value, MINFRAME, data->r.efra);
333 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
335 Scene *data= (Scene*)ptr->data;
336 CLAMP(value, data->r.sfra, MAXFRAME);
340 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
342 Scene *data= (Scene*)ptr->data;
345 /* copy range from scene if not set before */
346 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
347 data->r.psfra= data->r.sfra;
348 data->r.pefra= data->r.efra;
351 data->r.flag |= SCER_PRV_RANGE;
354 data->r.flag &= ~SCER_PRV_RANGE;
358 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
360 Scene *data= (Scene*)ptr->data;
362 /* check if enabled already */
363 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
364 /* set end of preview range to end frame, then clamp as per normal */
365 // TODO: or just refuse to set instead?
366 data->r.pefra= data->r.efra;
369 /* now set normally */
370 CLAMP(value, MINAFRAME, data->r.pefra);
371 data->r.psfra= value;
374 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
376 Scene *data= (Scene*)ptr->data;
378 /* check if enabled already */
379 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
380 /* set start of preview range to start frame, then clamp as per normal */
381 // TODO: or just refuse to set instead?
382 data->r.psfra= data->r.sfra;
385 /* now set normally */
386 CLAMP(value, data->r.psfra, MAXFRAME);
387 data->r.pefra= value;
390 static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
392 //Scene *scene= ptr->id.data;
393 //ED_update_for_newframe(C);
397 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
399 Scene *scene= (Scene *)ptr->data;
400 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
403 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
405 Scene *scene= (Scene *)ptr->data;
406 KeyingSet *ks= (KeyingSet*)value.data;
408 scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
411 /* get KeyingSet index stuff for list of Keying Sets editing UI
412 * - active_keyingset-1 since 0 is reserved for 'none'
413 * - don't clamp, otherwise can never set builtins types as active...
415 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
417 Scene *scene= (Scene *)ptr->data;
418 return scene->active_keyingset-1;
421 /* get KeyingSet index stuff for list of Keying Sets editing UI
422 * - value+1 since 0 is reserved for 'none'=
424 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
426 Scene *scene= (Scene *)ptr->data;
427 scene->active_keyingset= value+1;
430 // XXX: evil... builtin_keyingsets is defined in keyingsets.c!
431 // TODO: make API function to retrieve this...
432 extern ListBase builtin_keyingsets;
434 static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
436 Scene *scene= (Scene*)ptr->data;
438 /* start going over the scene KeyingSets first, while we still have pointer to it
439 * but only if we have any Keying Sets to use...
441 if (scene->keyingsets.first)
442 rna_iterator_listbase_begin(iter, &scene->keyingsets, NULL);
444 rna_iterator_listbase_begin(iter, &builtin_keyingsets, NULL);
447 static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
449 ListBaseIterator *internal= iter->internal;
450 KeyingSet *ks= (KeyingSet*)internal->link;
452 /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
453 if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
454 internal->link= (Link*)builtin_keyingsets.first;
456 internal->link= (Link*)ks->next;
458 iter->valid= (internal->link != NULL);
462 static char *rna_RenderSettings_path(PointerRNA *ptr)
464 return BLI_sprintfN("render");
467 static int rna_RenderSettings_threads_get(PointerRNA *ptr)
469 RenderData *rd= (RenderData*)ptr->data;
471 if(rd->mode & R_FIXED_THREADS)
474 return BLI_system_thread_count();
477 static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
479 RenderData *rd= (RenderData*)ptr->data;
480 return BKE_imtype_is_movie(rd->imtype);
483 static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
485 RenderData *rd= (RenderData*)ptr->data;
486 if(rd->mode & R_BORDER)
489 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
492 static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
494 RenderData *rd= (RenderData*)ptr->data;
496 return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
499 static void rna_RenderSettings_file_format_set(PointerRNA *ptr, int value)
501 RenderData *rd= (RenderData*)ptr->data;
505 ffmpeg_verify_image_type(rd);
507 #ifdef WITH_QUICKTIME
508 quicktime_verify_image_type(rd);
512 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
514 RenderData *rd= (RenderData*)ptr->data;
517 BKE_add_image_extension(ext, rd->imtype);
521 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
523 RenderData *rd= (RenderData*)ptr->data;
524 BKE_add_image_extension(str, rd->imtype);
527 void rna_RenderSettings_jpeg2k_preset_update(RenderData *rd)
529 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
531 switch(rd->jp2_depth) {
533 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
534 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
537 switch(rd->jp2_preset) {
538 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
539 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
540 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
541 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
542 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
543 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
544 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
549 static void rna_RenderSettings_jpeg2k_preset_set(PointerRNA *ptr, int value)
551 RenderData *rd= (RenderData*)ptr->data;
552 rd->jp2_preset= value;
553 rna_RenderSettings_jpeg2k_preset_update(rd);
556 static void rna_RenderSettings_jpeg2k_depth_set(PointerRNA *ptr, int value)
558 RenderData *rd= (RenderData*)ptr->data;
559 rd->jp2_depth= value;
560 rna_RenderSettings_jpeg2k_preset_update(rd);
564 #ifdef WITH_QUICKTIME
565 static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
567 RenderData *rd= (RenderData*)ptr->data;
569 return quicktime_rnatmpvalue_from_videocodectype(rd->qtcodecsettings.codecType);
572 static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
574 RenderData *rd= (RenderData*)ptr->data;
576 rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
579 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, int *free)
581 EnumPropertyItem *item= NULL;
582 EnumPropertyItem tmp = {0, "", 0, "", ""};
583 QuicktimeCodecTypeDesc *codecTypeDesc;
587 for(i=0;i<quicktime_get_num_videocodecs();i++) {
588 codecTypeDesc = quicktime_get_videocodecType_desc(i);
589 if (!codecTypeDesc) break;
591 tmp.value= codecTypeDesc->rnatmpvalue;
592 *((int*)id) = codecTypeDesc->codecType;
595 tmp.name= codecTypeDesc->codecName;
596 RNA_enum_item_add(&item, &totitem, &tmp);
599 RNA_enum_item_end(&item, &totitem);
606 static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
608 RenderData *rd= (RenderData*)ptr->data;
610 return quicktime_rnatmpvalue_from_audiocodectype(rd->qtcodecsettings.audiocodecType);
613 static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
615 RenderData *rd= (RenderData*)ptr->data;
617 rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
620 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr, int *free)
622 EnumPropertyItem *item= NULL;
623 EnumPropertyItem tmp = {0, "", 0, "", ""};
624 QuicktimeCodecTypeDesc *codecTypeDesc;
627 for(i=0;i<quicktime_get_num_audiocodecs();i++) {
628 codecTypeDesc = quicktime_get_audiocodecType_desc(i);
629 if (!codecTypeDesc) break;
631 tmp.value= codecTypeDesc->rnatmpvalue;
632 tmp.identifier= codecTypeDesc->codecName;
633 tmp.name= codecTypeDesc->codecName;
634 RNA_enum_item_add(&item, &totitem, &tmp);
637 RNA_enum_item_end(&item, &totitem);
645 static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
647 RenderData *rd= (RenderData*)ptr->data;
651 static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
653 RenderData *rd= (RenderData*)ptr->data;
657 static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
659 RenderData *rd= (RenderData*)ptr->data;
662 *max= BLI_countlist(&rd->layers)-1;
666 static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
668 RenderData *rd= (RenderData*)ptr->data;
669 SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
671 return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
674 static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
676 RenderData *rd= (RenderData*)ptr->data;
677 SceneRenderLayer *srl= (SceneRenderLayer*)value.data;
679 rd->actlay = BLI_findindex(&rd->layers, srl);
682 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
684 RenderData *rd= (RenderData*)ptr->data;
685 RenderEngineType *type= BLI_findlink(&R_engines, value);
688 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
691 static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *C, PointerRNA *ptr, int *free)
693 RenderEngineType *type;
694 EnumPropertyItem *item= NULL;
695 EnumPropertyItem tmp = {0, "", 0, "", ""};
698 for(type=R_engines.first; type; type=type->next, a++) {
700 tmp.identifier= type->idname;
701 tmp.name= type->name;
702 RNA_enum_item_add(&item, &totitem, &tmp);
705 RNA_enum_item_end(&item, &totitem);
711 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
713 RenderData *rd= (RenderData*)ptr->data;
714 RenderEngineType *type;
717 for(type=R_engines.first; type; type=type->next, a++)
718 if(strcmp(type->idname, rd->engine) == 0)
724 static void rna_Scene_glsl_update(Main *bmain, Scene *unused, PointerRNA *ptr)
726 Scene *scene= (Scene*)ptr->id.data;
728 DAG_id_flush_update(&scene->id, 0);
731 static void rna_RenderSettings_color_management_update(Main *bmain, Scene *unused, PointerRNA *ptr)
733 /* reset image nodes */
734 Scene *scene= (Scene*)ptr->id.data;
735 bNodeTree *ntree=scene->nodetree;
738 if(ntree && scene->use_nodes) {
739 for (node=ntree->nodes.first; node; node=node->next) {
740 if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
741 ED_node_changed_update(&scene->id, node);
742 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
744 if (node->type == CMP_NODE_IMAGE)
745 BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
750 rna_Scene_glsl_update(bmain, unused, ptr);
753 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
755 Scene *scene= (Scene*)ptr->id.data;
756 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
758 BLI_strncpy(rl->name, value, sizeof(rl->name));
760 if(scene->nodetree) {
762 int index= BLI_findindex(&scene->r.layers, rl);
764 for(node= scene->nodetree->nodes.first; node; node= node->next) {
765 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
766 if(node->custom1==index)
767 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
773 static int rna_RenderSettings_multiple_engines_get(PointerRNA *ptr)
775 return (BLI_countlist(&R_engines) > 1);
778 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
780 RenderData *rd= (RenderData*)ptr->data;
781 RenderEngineType *type;
783 for(type=R_engines.first; type; type=type->next)
784 if(strcmp(type->idname, rd->engine) == 0)
785 return (type->flag & RE_GAME);
790 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
792 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
793 rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL);
796 static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *unused, PointerRNA *ptr)
798 Scene *scene= (Scene*)ptr->id.data;
801 ntreeCompositForceHidden(scene->nodetree, scene);
804 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
806 Scene *scene= (Scene*)ptr->data;
808 scene->use_nodes= value;
809 if(scene->use_nodes && scene->nodetree==NULL)
810 ED_node_composit_default(scene);
813 static void rna_Physics_update(Main *bmain, Scene *unused, PointerRNA *ptr)
815 Scene *scene= (Scene*)ptr->id.data;
818 for(base = scene->base.first; base; base=base->next)
819 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
822 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
824 Scene *scene= (Scene*)ptr->id.data;
825 ToolSettings *ts = (ToolSettings*)ptr->data;
826 int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
829 ts->selectmode = flag;
832 Mesh *me= get_mesh(scene->basact->object);
833 if(me && me->edit_mesh && me->edit_mesh->selectmode != flag) {
834 me->edit_mesh->selectmode= flag;
835 EM_selectmode_set(me->edit_mesh);
841 static void rna_Scene_editmesh_select_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
846 me= get_mesh(scene->basact->object);
847 if(me && me->edit_mesh==NULL)
851 WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
852 WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
855 static void object_simplify_update(Object *ob)
858 ParticleSystem *psys;
860 for(md=ob->modifiers.first; md; md=md->next)
861 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
862 ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
864 for(psys=ob->particlesystem.first; psys; psys=psys->next)
865 psys->recalc |= PSYS_RECALC_CHILD;
870 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
871 object_simplify_update(gob->ob);
875 static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
880 for(SETLOOPER(scene, base))
881 object_simplify_update(base->object);
883 DAG_ids_flush_update(bmain, 0);
884 WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
887 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
889 if(scene->r.mode & R_SIMPLIFY)
890 rna_Scene_use_simplify_update(bmain, scene, ptr);
893 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
895 Scene *scene= (Scene*)ptr->data;
896 if(scene->audio.flag & AUDIO_SYNC)
898 return scene->flag & SCE_FRAME_DROP;
901 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
903 Scene *scene= (Scene*)ptr->data;
905 if(value == AUDIO_SYNC)
906 scene->audio.flag |= AUDIO_SYNC;
907 else if(value == SCE_FRAME_DROP)
909 scene->audio.flag &= ~AUDIO_SYNC;
910 scene->flag |= SCE_FRAME_DROP;
914 scene->audio.flag &= ~AUDIO_SYNC;
915 scene->flag &= ~SCE_FRAME_DROP;
919 static int rna_GameSettings_auto_start_get(PointerRNA *ptr)
921 if (G.fileflags & G_FILE_AUTOPLAY)
927 static void rna_GameSettings_auto_start_set(PointerRNA *ptr, int value)
930 G.fileflags |= G_FILE_AUTOPLAY;
932 G.fileflags &= ~G_FILE_AUTOPLAY;
936 static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[])
938 TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
939 marker->flag= SELECT;
941 BLI_strncpy(marker->name, name, sizeof(marker->name));
942 BLI_addtail(&scene->markers, marker);
946 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker)
948 /* try to remove the F-Curve from the action */
949 if (!BLI_remlink_safe(&scene->markers, marker)) {
950 BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in action '%s'", marker->name, scene->id.name+2);
954 /* XXX, invalidates PyObject */
958 static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, const char name[])
962 /* call the API func, and set the active keyingset index */
963 ks= BKE_keyingset_add(&sce->keyingsets, name, KEYINGSET_ABSOLUTE, 0);
966 sce->active_keyingset= BLI_countlist(&sce->keyingsets);
970 BKE_report(reports, RPT_ERROR, "Keying Set could not be added.");
977 static void rna_def_transform_orientation(BlenderRNA *brna)
982 const int matrix_dimsize[]= {3, 3};
984 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
986 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
987 RNA_def_property_float_sdna(prop, NULL, "mat");
988 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
989 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
991 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
992 RNA_def_property_string_sdna(prop, NULL, "name");
993 RNA_def_struct_name_property(srna, prop);
994 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
997 static void rna_def_tool_settings(BlenderRNA *brna)
1002 static EnumPropertyItem uv_select_mode_items[] = {
1003 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
1004 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
1005 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
1006 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
1007 {0, NULL, 0, NULL, NULL}};
1009 static EnumPropertyItem auto_key_items[] = {
1010 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
1011 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
1012 {0, NULL, 0, NULL, NULL}};
1014 static EnumPropertyItem retarget_roll_items[] = {
1015 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
1016 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
1017 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
1018 {0, NULL, 0, NULL, NULL}};
1020 static EnumPropertyItem sketch_convert_items[] = {
1021 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
1022 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
1023 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts"},
1024 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
1025 {0, NULL, 0, NULL, NULL}};
1027 static EnumPropertyItem edge_tag_items[] = {
1028 {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
1029 {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
1030 {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
1031 {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
1032 {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
1033 {0, NULL, 0, NULL, NULL}};
1035 srna= RNA_def_struct(brna, "ToolSettings", NULL);
1036 RNA_def_struct_ui_text(srna, "Tool Settings", "");
1038 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
1039 RNA_def_property_struct_type(prop, "Sculpt");
1040 RNA_def_property_ui_text(prop, "Sculpt", "");
1042 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
1043 RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
1044 RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
1045 "Ensure all bone-deforming vertex groups add up to 1.0 while "
1048 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
1049 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
1050 RNA_def_property_ui_text(prop, "Vertex Paint", "");
1052 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
1053 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
1054 RNA_def_property_ui_text(prop, "Weight Paint", "");
1056 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
1057 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
1058 RNA_def_property_ui_text(prop, "Image Paint", "");
1060 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
1061 RNA_def_property_pointer_sdna(prop, NULL, "particle");
1062 RNA_def_property_ui_text(prop, "Particle Edit", "");
1065 prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
1066 RNA_def_property_enum_sdna(prop, NULL, "proportional");
1067 RNA_def_property_enum_items(prop, proportional_editing_items);
1068 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode");
1069 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1071 prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
1072 RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
1073 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing object mode");
1074 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
1075 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1077 prop= RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
1078 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
1079 RNA_def_property_enum_items(prop, proportional_falloff_items);
1080 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
1081 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1083 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
1084 RNA_def_property_float_sdna(prop, NULL, "normalsize");
1085 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
1086 RNA_def_property_range(prop, 0.00001, 1000.0);
1087 RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
1088 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
1090 prop= RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
1091 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
1092 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
1094 prop= RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
1095 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
1096 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
1097 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
1098 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1100 prop= RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
1101 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
1102 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
1103 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
1104 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1106 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
1107 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
1108 RNA_def_property_enum_items(prop, snap_element_items);
1109 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
1110 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1112 prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
1113 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
1114 RNA_def_property_enum_items(prop, snap_target_items);
1115 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
1116 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1118 prop= RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
1119 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
1120 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
1121 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
1122 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1124 prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
1125 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
1126 RNA_def_property_ui_text(prop, "Project Individual Elements", "Project individual elements on the surface of other objects");
1127 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
1128 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
1131 prop= RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
1132 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
1133 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
1134 RNA_def_property_ui_icon(prop, ICON_REC, 0);
1136 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
1137 RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
1138 RNA_def_property_enum_items(prop, auto_key_items);
1139 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
1141 prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
1142 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
1143 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");
1146 prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
1147 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
1148 RNA_def_property_enum_items(prop, uv_select_mode_items);
1149 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
1150 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1152 prop= RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
1153 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
1154 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
1155 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1156 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1158 prop= RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
1159 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
1160 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
1161 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1164 prop= RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
1165 RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
1166 RNA_def_property_array(prop, 3);
1167 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
1168 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
1169 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
1171 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
1172 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
1173 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
1175 /* use with MESH_OT_select_shortest_path */
1176 prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
1177 RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
1178 RNA_def_property_enum_items(prop, edge_tag_items);
1179 RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
1182 prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
1183 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
1184 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
1185 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1187 prop= RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
1188 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
1189 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
1191 prop= RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
1192 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
1193 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
1195 prop= RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
1196 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
1197 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
1199 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
1200 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1201 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
1203 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
1204 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1205 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
1207 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
1208 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
1209 RNA_def_property_flag(prop, PROP_EDITABLE);
1210 RNA_def_property_struct_type(prop, "Object");
1211 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
1212 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
1214 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
1215 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
1216 RNA_def_property_range(prop, 1, 255);
1217 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
1218 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1220 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
1221 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
1222 RNA_def_property_range(prop, 0.00001, 1.0);
1223 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
1224 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
1225 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1227 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
1228 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
1229 RNA_def_property_range(prop, 0.00001, 100000.0);
1230 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1231 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
1232 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1234 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
1235 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
1236 RNA_def_property_enum_items(prop, retarget_roll_items);
1237 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
1239 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
1240 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
1241 RNA_def_property_enum_items(prop, sketch_convert_items);
1242 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
1243 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1245 /* Sculpt/Paint Unified Size and Strength */
1247 prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
1248 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
1249 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius", "Instead of per brush radius, the radius is shared across brushes");
1251 prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
1252 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
1253 RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength", "Instead of per brush strength, the strength is shared across brushes");
1257 static void rna_def_unit_settings(BlenderRNA *brna)
1262 static EnumPropertyItem unit_systems[] = {
1263 {USER_UNIT_NONE, "NONE", 0, "None", ""},
1264 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
1265 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
1266 {0, NULL, 0, NULL, NULL}};
1268 static EnumPropertyItem rotation_units[] = {
1269 {0, "DEGREES", 0, "Degrees", ""},
1270 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
1271 {0, NULL, 0, NULL, NULL}};
1273 srna= RNA_def_struct(brna, "UnitSettings", NULL);
1274 RNA_def_struct_ui_text(srna, "Unit Settings", "");
1277 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
1278 RNA_def_property_enum_items(prop, unit_systems);
1279 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
1280 RNA_def_property_update(prop, NC_WINDOW, NULL);
1282 prop= RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
1283 RNA_def_property_enum_items(prop, rotation_units);
1284 RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
1285 RNA_def_property_update(prop, NC_WINDOW, NULL);
1287 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
1288 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
1289 RNA_def_property_range(prop, 0.00001, 100000.0);
1290 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1291 RNA_def_property_update(prop, NC_WINDOW, NULL);
1293 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
1294 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
1295 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs");
1296 RNA_def_property_update(prop, NC_WINDOW, NULL);
1299 void rna_def_render_layer_common(StructRNA *srna, int scene)
1303 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1304 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
1305 else RNA_def_property_string_sdna(prop, NULL, "name");
1306 RNA_def_property_ui_text(prop, "Name", "Render layer name");
1307 RNA_def_struct_name_property(srna, prop);
1308 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1309 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1311 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
1312 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
1313 RNA_def_property_struct_type(prop, "Material");
1314 RNA_def_property_flag(prop, PROP_EDITABLE);
1315 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
1316 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1317 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1319 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
1320 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
1321 RNA_def_property_struct_type(prop, "Group");
1322 RNA_def_property_flag(prop, PROP_EDITABLE);
1323 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
1324 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1325 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1328 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1329 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1330 RNA_def_property_array(prop, 20);
1331 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
1332 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
1333 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
1334 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1335 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1337 prop= RNA_def_property(srna, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
1338 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
1339 RNA_def_property_array(prop, 20);
1340 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers");
1341 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1342 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1345 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
1346 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
1347 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
1348 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1349 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1351 prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
1352 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
1353 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
1354 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1355 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1357 prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
1358 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
1359 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
1360 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1361 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1363 prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
1364 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
1365 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
1366 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1367 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1369 prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
1370 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
1371 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
1372 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1373 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1375 prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
1376 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
1377 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
1378 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1379 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1381 prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
1382 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
1383 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
1384 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1385 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1387 prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
1388 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
1389 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
1390 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1391 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1393 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
1394 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
1395 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
1396 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1397 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1399 prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
1400 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
1401 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
1402 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1403 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1406 prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
1407 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
1408 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
1409 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1410 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1412 prop= RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
1413 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
1414 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
1415 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1416 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1418 prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
1419 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
1420 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
1421 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1422 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1424 prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
1425 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
1426 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
1427 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1428 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1430 prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
1431 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
1432 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
1433 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1434 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1436 prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
1437 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
1438 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
1439 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1440 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1442 prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
1443 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
1444 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
1445 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1446 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1448 prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
1449 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
1450 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
1451 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1452 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1454 prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
1455 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
1456 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
1457 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1458 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1460 prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
1461 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
1462 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
1463 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1464 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1466 prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
1467 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
1468 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
1469 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1470 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1472 prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1473 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
1474 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
1475 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1476 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1478 prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
1479 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
1480 RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
1481 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1482 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1484 prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
1485 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
1486 RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
1487 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1488 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1490 prop= RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
1491 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
1492 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
1493 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1494 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1496 prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
1497 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
1498 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
1499 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1500 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1502 prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
1503 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
1504 RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
1505 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1506 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1508 prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
1509 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
1510 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
1511 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1512 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1513 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1515 prop= RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
1516 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
1517 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
1518 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1519 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1520 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1522 prop= RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
1523 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
1524 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
1525 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1526 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1527 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1529 prop= RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
1530 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
1531 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
1532 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1533 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1534 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1536 prop= RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
1537 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
1538 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
1539 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1540 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1541 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1543 prop= RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
1544 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
1545 RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
1546 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1547 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1548 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1550 prop= RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
1551 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
1552 RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
1553 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1554 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1555 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1557 prop= RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
1558 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
1559 RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
1560 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
1561 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1562 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1565 static void rna_def_scene_game_data(BlenderRNA *brna)
1570 static EnumPropertyItem framing_types_items[] ={
1571 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
1572 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1573 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1574 {0, NULL, 0, NULL, NULL}};
1576 static EnumPropertyItem dome_modes_items[] ={
1577 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1578 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1579 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1580 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1581 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1582 {0, NULL, 0, NULL, NULL}};
1584 static EnumPropertyItem stereo_modes_items[] ={
1585 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1586 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1587 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1588 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1589 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1590 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1591 {0, NULL, 0, NULL, NULL}};
1593 static EnumPropertyItem stereo_items[] ={
1594 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
1595 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
1596 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
1597 {0, NULL, 0, NULL, NULL}};
1599 static EnumPropertyItem physics_engine_items[] = {
1600 {WOPHY_NONE, "NONE", 0, "None", ""},
1601 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1602 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1603 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1604 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1605 {WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
1606 {0, NULL, 0, NULL, NULL}};
1608 static EnumPropertyItem material_items[] ={
1609 {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials"},
1610 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
1611 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
1612 {0, NULL, 0, NULL, NULL}};
1614 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1615 RNA_def_struct_sdna(srna, "GameData");
1616 RNA_def_struct_nested(brna, srna, "Scene");
1617 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
1619 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1620 RNA_def_property_int_sdna(prop, NULL, "xplay");
1621 RNA_def_property_range(prop, 4, 10000);
1622 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
1623 RNA_def_property_update(prop, NC_SCENE, NULL);
1625 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1626 RNA_def_property_int_sdna(prop, NULL, "yplay");
1627 RNA_def_property_range(prop, 4, 10000);
1628 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
1629 RNA_def_property_update(prop, NC_SCENE, NULL);
1631 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
1632 RNA_def_property_int_sdna(prop, NULL, "depth");
1633 RNA_def_property_range(prop, 8, 32);
1634 RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
1635 RNA_def_property_update(prop, NC_SCENE, NULL);
1637 // Do we need it here ? (since we already have it in World
1638 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1639 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1640 RNA_def_property_range(prop, 4, 2000);
1641 RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display");
1642 RNA_def_property_update(prop, NC_SCENE, NULL);
1644 prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
1645 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1646 RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
1647 RNA_def_property_update(prop, NC_SCENE, NULL);
1650 prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
1651 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1652 RNA_def_property_enum_items(prop, framing_types_items);
1653 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
1654 RNA_def_property_update(prop, NC_SCENE, NULL);
1656 prop= RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
1657 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1658 RNA_def_property_array(prop, 3);
1659 RNA_def_property_ui_text(prop, "Framing Color", "Set colour of the bars");
1660 RNA_def_property_update(prop, NC_SCENE, NULL);
1663 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1664 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1665 RNA_def_property_enum_items(prop, stereo_items);
1666 RNA_def_property_ui_text(prop, "Stereo Options", "");
1667 RNA_def_property_update(prop, NC_SCENE, NULL);
1669 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1670 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1671 RNA_def_property_enum_items(prop, stereo_modes_items);
1672 RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
1673 RNA_def_property_update(prop, NC_SCENE, NULL);
1675 prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
1676 RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
1677 RNA_def_property_range(prop, 0.01, 5.0);
1678 RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
1679 RNA_def_property_update(prop, NC_SCENE, NULL);
1682 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1683 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1684 RNA_def_property_enum_items(prop, dome_modes_items);
1685 RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
1686 RNA_def_property_update(prop, NC_SCENE, NULL);
1688 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1689 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1690 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1691 RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
1692 RNA_def_property_update(prop, NC_SCENE, NULL);
1694 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1695 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1696 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1697 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1698 RNA_def_property_update(prop, NC_SCENE, NULL);
1700 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1701 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1702 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1703 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1704 RNA_def_property_update(prop, NC_SCENE, NULL);
1706 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1707 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1708 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1709 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1710 RNA_def_property_update(prop, NC_SCENE, NULL);
1712 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
1713 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
1714 RNA_def_property_struct_type(prop, "Text");
1715 RNA_def_property_flag(prop, PROP_EDITABLE);
1716 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
1717 RNA_def_property_update(prop, NC_SCENE, NULL);
1720 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
1721 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
1722 RNA_def_property_enum_items(prop, physics_engine_items);
1723 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
1724 RNA_def_property_update(prop, NC_SCENE, NULL);
1726 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
1727 RNA_def_property_float_sdna(prop, NULL, "gravity");
1728 RNA_def_property_range(prop, 0.0, 25.0);
1729 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
1730 RNA_def_property_update(prop, NC_SCENE, NULL);
1732 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_FLOAT, PROP_NONE);
1733 RNA_def_property_float_sdna(prop, NULL, "occlusionRes");
1734 RNA_def_property_range(prop, 128.0, 1024.0);
1735 RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
1736 RNA_def_property_update(prop, NC_SCENE, NULL);
1738 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1739 RNA_def_property_int_sdna(prop, NULL, "ticrate");
1740 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
1741 RNA_def_property_range(prop, 1, 250);
1742 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");
1743 RNA_def_property_update(prop, NC_SCENE, NULL);
1745 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
1746 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
1747 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1748 RNA_def_property_range(prop, 1, 5);
1749 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");
1750 RNA_def_property_update(prop, NC_SCENE, NULL);
1752 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
1753 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
1754 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1755 RNA_def_property_range(prop, 1, 5);
1756 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");
1757 RNA_def_property_update(prop, NC_SCENE, NULL);
1759 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
1760 RNA_def_property_int_sdna(prop, NULL, "physubstep");
1761 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1762 RNA_def_property_range(prop, 1, 5);
1763 RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
1764 RNA_def_property_update(prop, NC_SCENE, NULL);
1767 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
1768 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
1769 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
1771 // not used // deprecated !!!!!!!!!!!!!
1772 prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
1773 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
1774 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
1776 // not used // deprecated !!!!!!!!!!!!!
1777 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
1778 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
1779 RNA_def_property_range(prop, 0.0, 1000.0);
1780 RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
1783 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
1784 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
1785 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
1787 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
1788 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
1789 RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs");
1791 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
1792 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
1793 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
1795 prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
1796 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
1797 RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
1799 prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
1800 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
1801 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
1803 prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
1804 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
1805 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
1807 prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
1808 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
1809 RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
1811 prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
1812 RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
1813 RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
1816 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
1817 RNA_def_property_enum_sdna(prop, NULL, "matmode");
1818 RNA_def_property_enum_items(prop, material_items);
1819 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
1820 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1822 prop= RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
1823 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
1824 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
1825 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1827 prop= RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
1828 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
1829 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
1830 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1832 prop= RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
1833 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
1834 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
1835 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1837 prop= RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
1838 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
1839 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
1840 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1842 prop= RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
1843 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
1844 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
1845 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1847 prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
1848 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
1849 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
1850 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
1853 static void rna_def_scene_render_layer(BlenderRNA *brna)
1857 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
1858 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
1859 RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
1861 rna_def_render_layer_common(srna, 1);
1865 static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
1870 // FunctionRNA *func;
1871 // PropertyRNA *parm;
1873 RNA_def_property_srna(cprop, "RenderLayers");
1874 srna= RNA_def_struct(brna, "RenderLayers", NULL);
1875 RNA_def_struct_sdna(srna, "RenderData");
1876 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
1878 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
1879 RNA_def_property_int_sdna(prop, NULL, "actlay");
1880 RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
1881 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
1882 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1884 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
1885 RNA_def_property_struct_type(prop, "SceneRenderLayer");
1886 RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get", "rna_RenderSettings_active_layer_set", NULL, NULL);
1887 RNA_def_property_flag(prop, PROP_EDITABLE);
1888 RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
1889 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1893 static void rna_def_scene_render_data(BlenderRNA *brna)
1898 static EnumPropertyItem pixel_filter_items[] ={
1899 {R_FILTER_BOX, "BOX", 0, "Box", ""},
1900 {R_FILTER_TENT, "TENT", 0, "Tent", ""},
1901 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""},
1902 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""},
1903 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""},
1904 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""},
1905 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""},
1906 {0, NULL, 0, NULL, NULL}};
1908 static EnumPropertyItem alpha_mode_items[] ={
1909 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
1910 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
1911 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
1912 {0, NULL, 0, NULL, NULL}};
1914 static EnumPropertyItem color_mode_items[] ={
1915 {R_PLANESBW, "BW", 0, "BW", "Images are saved with BW (grayscale) data"},
1916 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
1917 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
1918 {0, NULL, 0, NULL, NULL}};
1920 static EnumPropertyItem display_mode_items[] ={
1921 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
1922 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
1923 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
1924 {0, NULL, 0, NULL, NULL}};
1927 static EnumPropertyItem bake_mode_items[] ={
1928 {RE_BAKE_ALL, "FULL", 0, "Full Render", ""},
1929 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""},
1930 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""},
1931 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""},
1932 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""},
1933 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""},
1934 {0, NULL, 0, NULL, NULL}};
1936 static EnumPropertyItem bake_normal_space_items[] ={
1937 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""},
1938 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""},
1939 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""},
1940 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
1941 {0, NULL, 0, NULL, NULL}};
1943 static EnumPropertyItem bake_qyad_split_items[] ={
1944 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
1945 {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
1946 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
1947 {0, NULL, 0, NULL, NULL}};
1949 static EnumPropertyItem octree_resolution_items[] = {
1950 {64, "64", 0, "64", ""},
1951 {128, "128", 0, "128", ""},
1952 {256, "256", 0, "256", ""},
1953 {512, "512", 0, "512", ""},
1954 {0, NULL, 0, NULL, NULL}};
1956 static EnumPropertyItem raytrace_structure_items[] = {
1957 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""},
1958 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"},
1959 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
1960 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""},
1961 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""},
1962 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""},
1963 {0, NULL, 0, NULL, NULL}
1966 static EnumPropertyItem fixed_oversample_items[] = {
1967 {5, "5", 0, "5", ""},
1968 {8, "8", 0, "8", ""},
1969 {11, "11", 0, "11", ""},
1970 {16, "16", 0, "16", ""},
1971 {0, NULL, 0, NULL, NULL}};
1973 static EnumPropertyItem field_order_items[] = {
1974 {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"},
1975 {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"},
1976 {0, NULL, 0, NULL, NULL}};
1978 static EnumPropertyItem threads_mode_items[] = {
1979 {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
1980 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
1981 {0, NULL, 0, NULL, NULL}};
1984 static EnumPropertyItem exr_codec_items[] = {
1985 {0, "NONE", 0, "None", ""},
1986 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
1987 {2, "ZIP", 0, "ZIP (lossless)", ""},
1988 {3, "PIZ", 0, "PIZ (lossless)", ""},
1989 {4, "RLE", 0, "RLE (lossless)", ""},
1990 {0, NULL, 0, NULL, NULL}};
1993 #ifdef WITH_OPENJPEG
1994 static EnumPropertyItem jp2_preset_items[] = {
1995 {0, "NO_PRESET", 0, "No Preset", ""},
1996 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
1997 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
1998 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
1999 {4, "CINE_SCOPE_48FPS", 0, "Cine-Scope 24fps 2048x858", ""},
2000 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
2001 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
2002 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
2003 {0, NULL, 0, NULL, NULL}};
2005 static EnumPropertyItem jp2_depth_items[] = {
2006 {8, "8", 0, "8", "8 bit color channels"},
2007 {12, "12", 0, "12", "12 bit color channels"},
2008 {16, "16", 0, "16", "16 bit color channels"},
2009 {0, NULL, 0, NULL, NULL}};
2012 #ifdef WITH_QUICKTIME
2013 static EnumPropertyItem quicktime_codec_type_items[] = {
2014 {0, "codec", 0, "codec", ""},
2015 {0, NULL, 0, NULL, NULL}};
2018 static EnumPropertyItem quicktime_audio_samplerate_items[] = {
2019 {22050, "22050", 0, "22kHz", ""},
2020 {44100, "44100", 0, "44.1kHz", ""},
2021 {48000, "48000", 0, "48kHz", ""},
2022 {88200, "88200", 0, "88.2kHz", ""},
2023 {96000, "96000", 0, "96kHz", ""},
2024 {192000, "192000", 0, "192kHz", ""},
2025 {0, NULL, 0, NULL, NULL}};
2027 static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
2028 {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
2029 {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
2030 {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
2031 {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
2032 {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
2033 {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
2034 {0, NULL, 0, NULL, NULL}};
2036 static EnumPropertyItem quicktime_audio_bitrate_items[] = {
2037 {64000, "64000", 0, "64kbps", ""},
2038 {112000, "112000", 0, "112kpbs", ""},
2039 {128000, "128000", 0, "128kbps", ""},
2040 {192000, "192000", 0, "192kbps", ""},
2041 {256000, "256000", 0, "256kbps", ""},
2042 {320000, "320000", 0, "320kbps", ""},
2043 {0, NULL, 0, NULL, NULL}};
2048 static EnumPropertyItem ffmpeg_format_items[] = {
2049 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
2050 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
2051 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
2052 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
2053 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
2054 {FFMPEG_DV, "DV", 0, "DV", ""},
2055 {FFMPEG_H264, "H264", 0, "H.264", ""},
2056 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
2057 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
2058 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
2059 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
2060 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
2061 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
2062 {0, NULL, 0, NULL, NULL}};
2064 static EnumPropertyItem ffmpeg_codec_items[] = {
2065 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2066 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
2067 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
2068 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
2069 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
2070 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
2071 {CODEC_ID_H264, "H264", 0, "H.264", ""},
2072 {CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
2073 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
2074 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
2075 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
2076 {0, NULL, 0, NULL, NULL}};
2078 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
2079 {CODEC_ID_NONE, "NONE", 0, "None", ""},
2080 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
2081 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
2082 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
2083 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
2084 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
2085 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
2086 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
2087 {0, NULL, 0, NULL, NULL}};
2090 static EnumPropertyItem engine_items[] = {
2091 {0, "BLENDER_RENDER", 0, "Blender Render", ""},
2092 {0, NULL, 0, NULL, NULL}};
2094 srna= RNA_def_struct(brna, "RenderSettings", NULL);
2095 RNA_def_struct_sdna(srna, "RenderData");
2096 RNA_def_struct_nested(brna, srna, "Scene");
2097 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
2098 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
2100 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
2101 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
2102 RNA_def_property_enum_items(prop, color_mode_items);
2103 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");
2104 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2106 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
2107 RNA_def_property_int_sdna(prop, NULL, "xsch");
2108 RNA_def_property_range(prop, 4, 10000);
2109 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
2110 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2112 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
2113 RNA_def_property_int_sdna(prop, NULL, "ysch");
2114 RNA_def_property_range(prop, 4, 10000);
2115 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
2116 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2118 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
2119 RNA_def_property_int_sdna(prop, NULL, "size");
2120 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
2121 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
2122 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2124 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
2125 RNA_def_property_int_sdna(prop, NULL, "xparts");
2126 RNA_def_property_range(prop, 1, 512);
2127 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
2128 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2130 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
2131 RNA_def_property_int_sdna(prop, NULL, "yparts");
2132 RNA_def_property_range(prop, 1, 512);
2133 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
2134 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2136 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
2137 RNA_def_property_float_sdna(prop, NULL, "xasp");
2138 RNA_def_property_range(prop, 1.0f, 200.0f);
2139 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
2140 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2142 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
2143 RNA_def_property_float_sdna(prop, NULL, "yasp");
2144 RNA_def_property_range(prop, 1.0f, 200.0f);
2145 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
2146 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2148 /* JPEG and AVI JPEG */
2150 prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
2151 RNA_def_property_int_sdna(prop, NULL, "quality");
2152 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
2153 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, Compression for PNG's");
2154 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2158 prop= RNA_def_property(srna, "use_tiff_16bit", PROP_BOOLEAN, PROP_NONE);
2159 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
2160 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
2161 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2163 /* Cineon and DPX */
2165 prop= RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
2166 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
2167 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
2168 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2170 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
2171 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
2172 RNA_def_property_range(prop, 0, 1024);
2173 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
2174 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2176 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
2177 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
2178 RNA_def_property_range(prop, 0, 1024);
2179 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
2180 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2182 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
2183 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
2184 RNA_def_property_range(prop, 0.0f, 10.0f);
2185 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
2186 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2191 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
2192 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
2193 RNA_def_property_enum_items(prop, exr_codec_items);
2194 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
2195 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2197 prop= RNA_def_property(srna, "use_exr_half", PROP_BOOLEAN, PROP_NONE);
2198 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
2199 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
2200 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2202 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
2203 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
2204 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int zbuffer)");
2205 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2207 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
2208 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
2209 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
2210 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2213 #ifdef WITH_OPENJPEG
2216 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
2217 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
2218 RNA_def_property_enum_items(prop, jp2_preset_items);
2219 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_preset_set", NULL);
2220 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
2221 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2223 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
2224 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
2225 RNA_def_property_enum_items(prop, jp2_depth_items);
2226 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_depth_set", NULL);
2227 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
2228 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2230 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
2231 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
2232 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
2233 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2236 #ifdef WITH_QUICKTIME
2239 prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
2240 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
2241 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2242 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
2243 "rna_RenderSettings_qtcodecsettings_codecType_set",
2244 "rna_RenderSettings_qtcodecsettings_codecType_itemf");
2245 RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
2246 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2248 prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
2249 RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
2250 RNA_def_property_range(prop, 0, 100);
2251 RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
2252 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2255 prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE);
2256 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType");
2257 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2258 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
2259 "rna_RenderSettings_qtcodecsettings_audiocodecType_set",
2260 "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
2261 RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
2262 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2264 prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE);
2265 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate");
2266 RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
2267 RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
2268 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2270 prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE);
2271 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth");
2272 RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
2273 RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
2274 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2276 prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
2277 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
2278 RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
2279 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2281 prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
2282 RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
2283 RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
2284 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2286 prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE);
2287 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate");
2288 RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
2289 RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
2290 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2297 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
2298 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
2299 RNA_def_property_enum_items(prop, ffmpeg_format_items);
2300 RNA_def_property_ui_text(prop, "Format", "Output file format");
2301 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2303 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
2304 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
2305 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
2306 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
2307 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2309 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
2310 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
2311 RNA_def_property_range(prop, 1, 14000);
2312 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
2313 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2315 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
2316 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
2317 RNA_def_property_range(prop, 0, 9000);
2318 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
2319 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2321 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
2322 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
2323 RNA_def_property_range(prop, 1, 14000);
2324 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
2325 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2327 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
2328 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
2329 RNA_def_property_range(prop, 0, 100000000);
2330 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
2331 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2333 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
2334 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
2335 RNA_def_property_range(prop, 0, 100);
2336 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
2337 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2339 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
2340 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
2341 RNA_def_property_range(prop, 0, 2000);
2342 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
2343 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2345 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
2346 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
2347 RNA_def_property_range(prop, 0, 16384);
2348 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
2349 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2351 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
2352 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
2353 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
2354 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2357 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
2358 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
2359 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
2360 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
2361 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2363 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
2364 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
2365 RNA_def_property_range(prop, 32, 384);
2366 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
2367 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2369 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
2370 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
2371 RNA_def_property_range(prop, 8000, 192000);
2372 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
2373 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2375 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
2376 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
2377 RNA_def_property_range(prop, 0.0f, 1.0f);
2378 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
2379 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2383 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2384 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
2385 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2386 RNA_def_property_range(prop, 1, 120);
2387 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
2388 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2390 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
2391 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
2392 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2393 RNA_def_property_range(prop, 0.1f, 120.0f);
2394 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
2395 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2398 prop= RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
2399 RNA_def_property_int_sdna(prop, NULL, "framapto");
2400 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2401 RNA_def_property_range(prop, 1, 900);
2402 RNA_def_property_ui_text(prop, "Frame Map Old", "Specify old mapping value in frames");
2403 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2405 prop= RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
2406 RNA_def_property_int_sdna(prop, NULL, "images");
2407 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2408 RNA_def_property_range(prop, 1, 900);
2409 RNA_def_property_ui_text(prop, "Frame Map New", "Specify how many frames the Map Old will last");
2410 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2413 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
2414 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
2415 RNA_def_property_range(prop, 0.0f, 2.0f);
2416 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding");
2417 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2419 prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
2420 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
2421 RNA_def_property_enum_items(prop, pixel_filter_items);
2422 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
2423 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2425 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
2426 RNA_def_property_float_sdna(prop, NULL, "gauss");
2427 RNA_def_property_range(prop, 0.5f, 1.5f);
2428 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
2429 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2431 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2432 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
2433 RNA_def_property_enum_items(prop, alpha_mode_items);
2434 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2435 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2437 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
2438 RNA_def_property_enum_sdna(prop, NULL, "ocres");
2439 RNA_def_property_enum_items(prop, octree_resolution_items);
2440 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes");
2441 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2443 prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
2444 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
2445 RNA_def_property_enum_items(prop, raytrace_structure_items);
2446 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
2447 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2449 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
2450 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
2451 RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates");
2452 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2454 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
2455 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
2456 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");
2457 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2459 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2460 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
2461 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
2462 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2464 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
2465 RNA_def_property_enum_sdna(prop, NULL, "osa");
2466 RNA_def_property_enum_items(prop, fixed_oversample_items);
2467 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
2468 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2470 prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
2471 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
2472 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
2473 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2475 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
2476 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2477 RNA_def_property_enum_items(prop, field_order_items);
2478 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");
2479 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2481 prop= RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
2482 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
2483 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
2484 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2486 /* rendering features */
2487 prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
2488 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
2489 RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
2490 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2492 prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
2493 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
2494 RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
2495 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2497 prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
2498 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
2499 RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
2500 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2502 prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
2503 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
2504 RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
2505 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2507 prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
2508 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
2509 RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
2510 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2512 prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
2513 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
2514 RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
2515 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2517 prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
2518 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
2519 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
2520 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2522 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
2523 RNA_def_property_int_sdna(prop, NULL, "edgeint");
2524 RNA_def_property_range(prop, 0, 255);
2525 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
2526 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2528 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
2529 RNA_def_property_float_sdna(prop, NULL, "edgeR");
2530 RNA_def_property_array(prop, 3);
2531 RNA_def_property_ui_text(prop, "Edge Color", "");
2532 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2535 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
2536 RNA_def_property_int_sdna(prop, NULL, "threads");
2537 RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
2538 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
2539 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
2540 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2542 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
2543 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2544 RNA_def_property_enum_items(prop, threads_mode_items);
2545 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
2546 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2549 prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
2550 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
2551 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
2552 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2554 prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
2555 RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
2556 RNA_def_property_range(prop, 1, 32);
2557 RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
2558 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2560 prop= RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
2561 RNA_def_property_float_sdna(prop, NULL, "blurfac");
2562 RNA_def_property_range(prop, 0.01f, 10.0f);
2563 RNA_def_property_ui_range(prop, 0.01, 2.0f, 1, 0);
2564 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
2565 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2568 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
2569 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
2570 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");
2571 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2573 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
2574 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
2575 RNA_def_property_range(prop, 0.0f, 1.0f);
2576 RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border");
2577 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2579 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
2580 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
2581 RNA_def_property_range(prop, 0.0f, 1.0f);
2582 RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
2583 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2585 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
2586 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
2587 RNA_def_property_range(prop, 0.0f, 1.0f);
2588 RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
2589 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2591 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
2592 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
2593 RNA_def_property_range(prop, 0.0f, 1.0f);
2594 RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
2595 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2597 prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
2598 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
2599 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
2600 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2602 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
2603 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
2604 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
2605 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2607 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2608 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2609 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
2610 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2612 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
2613 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
2614 RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled");
2615 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2617 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
2618 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
2619 RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist");
2620 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2622 prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
2623 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
2624 RNA_def_property_ui_text(prop, "Color Management", "Use linear workflow - gamma corrected imaging pipeline");
2625 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_RenderSettings_color_management_update");
2628 prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
2629 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
2630 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
2631 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2633 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
2634 RNA_def_property_enum_sdna(prop, NULL, "imtype");
2635 RNA_def_property_enum_items(prop, image_type_items);
2636 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
2637 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
2638 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2640 prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
2641 RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
2642 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
2643 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2645 prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
2646 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
2647 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2648 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
2650 prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
2651 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2652 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing");
2653 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2655 prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
2656 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
2657 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
2658 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2660 prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
2661 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
2662 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
2663 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)");
2664 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2666 prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
2667 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
2668 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
2669 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");
2670 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2672 prop= RNA_def_property(srna, "use_backbuf", PROP_BOOLEAN, PROP_NONE);
2673 RNA_def_property_boolean_sdna(prop, NULL, "bufflag", R_BACKBUF);
2674 RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image");
2675 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2677 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2678 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
2679 RNA_def_property_enum_items(prop, display_mode_items);
2680 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
2681 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2683 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
2684 RNA_def_property_string_sdna(prop, NULL, "pic");
2685 RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers");
2686 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2690 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
2691 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
2692 RNA_def_property_enum_items(prop, bake_mode_items);
2693 RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
2695 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
2696 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
2697 RNA_def_property_enum_items(prop, bake_normal_space_items);
2698 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
2700 prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
2701 RNA_def_property_enum_items(prop, bake_qyad_split_items);
2702 RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
2704 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
2705 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
2706 RNA_def_property_enum_items(prop, fixed_oversample_items);
2707 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
2709 prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
2710 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
2711 RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
2713 prop= RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
2714 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
2715 RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings");
2717 prop= RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
2718 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
2719 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
2721 prop= RNA_def_property(srna, "use_bake_antialiasing", PROP_BOOLEAN, PROP_NONE);
2722 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
2723 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
2725 prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
2726 RNA_def_property_int_sdna(prop, NULL, "bake_filter");
2727 RNA_def_property_range(prop, 0, 32);
2728 RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
2730 prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
2731 RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
2732 RNA_def_property_range(prop, 0.0, 1000.0);
2733 RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
2735 prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
2736 RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
2737 RNA_def_property_range(prop, 0.0, 1000.0);
2738 RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
2742 prop= RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
2743 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
2744 RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
2745 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2747 prop= RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
2748 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
2749 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
2750 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2752 prop= RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
2753 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
2754 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
2755 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2757 prop= RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
2758 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
2759 RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
2760 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2762 prop= RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
2763 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
2764 RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
2765 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2767 prop= RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
2768 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
2769 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
2770 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2772 prop= RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
2773 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
2774 RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
2775 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2777 prop= RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
2778 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
2779 RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
2780 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2782 prop= RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
2783 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
2784 RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
2785 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2787 prop= RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
2788 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
2789 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
2790 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2792 prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
2793 RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
2794 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
2795 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2797 prop= RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
2798 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
2799 RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
2800 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2802 prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
2803 RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
2804 RNA_def_property_range(prop, 8, 64);
2805 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
2806 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2808 prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
2809 RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
2810 RNA_def_property_array(prop, 4);
2811 RNA_def_property_range(prop,0.0,1.0);
2812 RNA_def_property_ui_text(prop, "Stamp Text Color", "Color to use for stamp text");
2813 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2815 prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
2816 RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
2817 RNA_def_property_array(prop, 4);
2818 RNA_def_property_range(prop,0.0,1.0);
2819 RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
2820 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2822 /* sequencer draw options */
2824 prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
2825 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV);
2826 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2828 prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
2829 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND);
2830 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2833 prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
2834 RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
2835 RNA_def_property_enum_items(prop, viewport_shade_items);
2836 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2838 prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
2839 RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
2840 RNA_def_property_enum_items(prop, viewport_shade_items);
2841 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2845 prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
2846 RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
2847 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2848 RNA_def_property_ui_text(prop, "Render Layers", "");
2849 rna_def_render_layers(brna, prop);
2852 prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
2853 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
2854 RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
2855 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
2856 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2859 prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
2860 RNA_def_property_enum_items(prop, engine_items);
2861 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set", "rna_RenderSettings_engine_itemf");
2862 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
2863 RNA_def_property_update(prop, NC_WINDOW, NULL);
2865 prop= RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
2866 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
2867 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2868 RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
2870 prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
2871 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
2872 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2873 RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine");
2876 prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
2877 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
2878 RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
2879 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
2881 prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
2882 RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
2883 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
2884 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
2885 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2887 prop= RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
2888 RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
2889 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
2890 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2892 prop= RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
2893 RNA_def_property_int_sdna(prop, NULL, "simplify_shadowsamples");
2894 RNA_def_property_ui_range(prop, 1, 16, 1, 0);
2895 RNA_def_property_ui_text(prop, "Simplify Shadow Samples", "Global maximum shadow samples");
2896 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2898 prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
2899 RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
2900 RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor");
2901 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2903 prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
2904 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
2905 RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated");
2908 RNA_api_scene_render(srna);
2912 static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
2920 RNA_def_property_srna(cprop, "SceneObjects");
2921 srna= RNA_def_struct(brna, "SceneObjects", NULL);
2922 RNA_def_struct_sdna(srna, "Scene");
2923 RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
2925 func= RNA_def_function(srna, "link", "rna_Scene_object_link");
2926 RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after.");
2927 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
2928 parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
2929 RNA_def_property_flag(parm, PROP_REQUIRED);
2930 parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
2931 RNA_def_function_return(func, parm);
2933 func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
2934 RNA_def_function_ui_description(func, "Unlink object from scene.");
2935 RNA_def_function_flag(func, FUNC_USE_REPORTS);
2936 parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
2937 RNA_def_property_flag(parm, PROP_REQUIRED);
2939 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2940 RNA_def_property_struct_type(prop, "Object");
2941 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL, NULL);
2942 RNA_def_property_flag(prop, PROP_EDITABLE);
2943 RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene");
2944 /* Could call: ED_base_object_activate(C, scene->basact);
2945 * but would be a bad level call and it seems the notifier is enough */
2946 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
2951 static void rna_def_scene_bases(BlenderRNA *brna, PropertyRNA *cprop)
2956 // FunctionRNA *func;
2957 // PropertyRNA *parm;
2959 RNA_def_property_srna(cprop, "SceneBases");
2960 srna= RNA_def_struct(brna, "SceneBases", NULL);
2961 RNA_def_struct_sdna(srna, "Scene");
2962 RNA_def_struct_ui_text(srna, "Scene Bases", "Collection of scene bases");
2964 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2965 RNA_def_property_struct_type(prop, "ObjectBase");
2966 RNA_def_property_pointer_sdna(prop, NULL, "basact");
2967 RNA_def_property_flag(prop, PROP_EDITABLE);
2968 RNA_def_property_ui_text(prop, "Active Base", "Active object base in the scene");
2969 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
2972 /* scene.timeline_markers */
2973 static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
2980 RNA_def_property_srna(cprop, "TimelineMarkers");
2981 srna= RNA_def_struct(brna, "TimelineMarkers", NULL);
2982 RNA_def_struct_sdna(srna, "Scene");
2983 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
2985 func= RNA_def_function(srna, "new", "rna_TimeLine_add");
2986 RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
2987 parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
2988 RNA_def_property_flag(parm, PROP_REQUIRED);
2990 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
2991 RNA_def_function_return(func, parm);
2994 func= RNA_def_function(srna, "remove", "rna_TimeLine_remove");
2995 RNA_def_function_ui_description(func, "Remove a timeline marker.");
2996 RNA_def_function_flag(func, FUNC_USE_REPORTS);
2997 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
2998 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3001 /* scene.keying_sets */
3002 static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
3010 RNA_def_property_srna(cprop, "KeyingSets");
3011 srna= RNA_def_struct(brna, "KeyingSets", NULL);
3012 RNA_def_struct_sdna(srna, "Scene");
3013 RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
3015 /* Add Keying Set */
3016 func= RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
3017 RNA_def_function_ui_description(func, "Add a new Keying Set to Scene.");
3018 RNA_def_function_flag(func, FUNC_USE_REPORTS);
3020 RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
3022 /* returns the new KeyingSet */
3023 parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set.");
3024 RNA_def_function_return(func, parm);
3026 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3027 RNA_def_property_struct_type(prop, "KeyingSet");
3028 RNA_def_property_flag(prop, PROP_EDITABLE);
3029 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
3030 RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
3031 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3033 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
3034 RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
3035 RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
3036 RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
3037 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3040 static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
3045 RNA_def_property_srna(cprop, "KeyingSetsAll");
3046 srna= RNA_def_struct(brna, "KeyingSetsAll", NULL);
3047 RNA_def_struct_sdna(srna, "Scene");
3048 RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
3050 /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
3052 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
3053 RNA_def_property_struct_type(prop, "KeyingSet");
3054 RNA_def_property_flag(prop, PROP_EDITABLE);
3055 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
3056 RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
3057 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3059 prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
3060 RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
3061 RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
3062 RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
3063 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3066 void RNA_def_scene(BlenderRNA *brna)
3072 static EnumPropertyItem audio_distance_model_items[] = {
3073 {0, "NONE", 0, "None", "No distance attenuation"},
3074 {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
3075 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
3076 {3, "LINEAR", 0, "Linear", "Linear distance model"},
3077 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
3078 {5, "EXPONENT", 0, "Exponent", "Exponent distance model"},
3079 {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping"},
3080 {0, NULL, 0, NULL, NULL}};
3082 static EnumPropertyItem sync_mode_items[] = {
3083 {0, "NONE", 0, "No Sync", "Do not sync, play every frame"},
3084 {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
3085 {AUDIO_SYNC, "AUDIO_SYNC", 0, "AV-sync", "Sync to audio playback, dropping frames"},
3086 {0, NULL, 0, NULL, NULL}};
3088 /* Struct definition */
3089 srna= RNA_def_struct(brna, "Scene", "ID");
3090 RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings");
3091 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
3092 RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
3094 /* Global Settings */
3095 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
3096 RNA_def_property_flag(prop, PROP_EDITABLE);
3097 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
3098 RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene");
3099 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_view3d_update");
3101 prop= RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
3102 RNA_def_property_pointer_sdna(prop, NULL, "set");
3103 RNA_def_property_struct_type(prop, "Scene");
3104 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
3105 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL, NULL);
3106 RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
3107 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
3109 prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
3110 RNA_def_property_flag(prop, PROP_EDITABLE);
3111 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
3112 RNA_def_property_update(prop, NC_SCENE|ND_WORLD, NULL);
3114 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
3115 RNA_def_property_float_sdna(prop, NULL, "cursor");
3116 RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location");
3117 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
3118 RNA_def_property_update(prop, NC_WINDOW, NULL);
3121 prop= RNA_def_property(srna, "object_bases", PROP_COLLECTION, PROP_NONE);
3122 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
3123 RNA_def_property_struct_type(prop, "ObjectBase");
3124 RNA_def_property_ui_text(prop, "Bases", "");
3125 RNA_def_property_collection_funcs(prop, 0, 0, 0, 0, 0, 0, "rna_Scene_object_bases_lookup_string");
3126 rna_def_scene_bases(brna, prop);
3128 prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
3129 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
3130 RNA_def_property_struct_type(prop, "Object");
3131 RNA_def_property_ui_text(prop, "Objects", "");
3132 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0);
3133 rna_def_scene_objects(brna, prop);
3136 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
3137 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
3138 RNA_def_property_array(prop, 20);
3139 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
3140 RNA_def_property_ui_text(prop, "Layers", "Layers visible when rendering the scene");
3141 RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_view3d_update");
3143 /* Frame Range Stuff */
3144 prop= RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
3145 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3146 RNA_def_property_int_sdna(prop, NULL, "r.cfra");
3147 RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
3148 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL);
3149 RNA_def_property_ui_text(prop, "Current Frame", "");
3150 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
3151 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
3153 prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
3154 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3155 RNA_def_property_int_sdna(prop, NULL, "r.sfra");
3156 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
3157 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
3158 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
3159 RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL);
3161 prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
3162 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3163 RNA_def_property_int_sdna(prop, NULL, "r.efra");
3164 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
3165 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
3166 RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
3167 RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL);
3169 prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
3170 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3171 RNA_def_property_int_sdna(prop, NULL, "r.frame_step");
3172 RNA_def_property_range(prop, 0, MAXFRAME);
3173 RNA_def_property_ui_range(prop, 1, 100, 1, 0);
3174 RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
3175 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
3177 /* Preview Range (frame-range for UI playback) */
3178 prop=RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
3179 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3180 RNA_def_property_boolean_sdna(prop, NULL, "r.flag", SCER_PRV_RANGE);
3181 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_preview_range_set");
3182 RNA_def_property_ui_text(prop, "Use Preview Range", "Use an alternative start/end frame for UI playback, rather than the scene start/end frame");
3183 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
3184 RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
3186 prop= RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME);
3187 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3188 RNA_def_property_int_sdna(prop, NULL, "r.psfra");
3189 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
3190 RNA_def_property_ui_text(prop, "Preview Range Start Frame", "Alternative start frame for UI playback");
3191 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
3193 prop= RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME);
3194 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
3195 RNA_def_property_int_sdna(prop, NULL, "r.pefra");
3196 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
3197 RNA_def_property_ui_text(prop, "Preview Range End Frame", "Alternative end frame for UI playback");