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_scene_types.h"
35 #include "DNA_userdef_types.h"
37 /* Include for Bake Options */
38 #include "RE_pipeline.h"
41 #include "quicktime_export.h"
45 #include "BKE_writeffmpeg.h"
46 #include <libavcodec/avcodec.h>
47 #include <libavformat/avformat.h>
52 #include "BLI_threads.h"
54 EnumPropertyItem snap_target_items[] = {
55 {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
56 {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target"},
57 {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
58 {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
59 {0, NULL, 0, NULL, NULL}};
61 EnumPropertyItem proportional_falloff_items[] ={
62 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
63 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
64 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
65 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
66 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", ""},
67 {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", ""},
68 {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
69 {0, NULL, 0, NULL, NULL}};
72 EnumPropertyItem proportional_editing_items[] = {
73 {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", ""},
74 {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", ""},
75 {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", ""},
76 {0, NULL, 0, NULL, NULL}};
78 /* keep for operators, not used here */
79 EnumPropertyItem mesh_select_mode_items[] = {
80 {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
81 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
82 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
83 {0, NULL, 0, NULL, NULL}};
85 EnumPropertyItem snap_element_items[] = {
86 {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid"},
87 {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
88 {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"},
89 {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces"},
90 {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"},
91 {0, NULL, 0, NULL, NULL}};
93 EnumPropertyItem image_type_items[] = {
94 {0, "", 0, "Image", NULL},
95 {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""},
96 {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""},
98 {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""},
100 {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""},
101 {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""},
102 {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", ""},
103 //{R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, // XXX not yet implemented
104 //{R_HAMX, "HAMX", ICON_FILE_IMAGE, "HamX", ""}, // should remove this format, 8bits are so 80's
105 {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""},
106 {0, "", 0, " ", NULL},
108 {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""},
109 {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""},
111 {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""}, // XXX only with G.have_libtiff
112 {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", ""},
113 {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""},
114 {R_DPX, "DPX", ICON_FILE_IMAGE, "DPX", ""},
115 {0, "", 0, "Movie", NULL},
116 {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", ""},
117 {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", ""},
119 {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""},
121 #ifdef WITH_QUICKTIME
123 {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", ""},
125 {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", ""},
129 {R_MOVIE, "MOVIE", ICON_FILE_MOVIE, "Movie", ""},
132 {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
133 {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""},
134 {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
135 {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", ""},
137 {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
138 {0, NULL, 0, NULL, NULL}};
142 #include "DNA_anim_types.h"
143 #include "DNA_node_types.h"
144 #include "DNA_object_types.h"
145 #include "DNA_mesh_types.h"
147 #include "BKE_context.h"
148 #include "BKE_global.h"
149 #include "BKE_image.h"
150 #include "BKE_main.h"
151 #include "BKE_node.h"
152 #include "BKE_pointcache.h"
153 #include "BKE_scene.h"
154 #include "BKE_depsgraph.h"
155 #include "BKE_image.h"
156 #include "BKE_mesh.h"
157 #include "BKE_sound.h"
159 #include "BLI_threads.h"
160 #include "BLI_editVert.h"
166 #include "ED_view3d.h"
167 #include "ED_object.h"
169 #include "ED_keyframing.h"
171 #include "RE_pipeline.h"
173 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
175 ListBaseIterator *internal= iter->internal;
177 /* we are actually iterating a Base list, so override get */
178 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
181 static Base *rna_Scene_object_link(Scene *scene, ReportList *reports, Object *ob)
185 if (ob->type != OB_EMPTY && ob->data==NULL) {
186 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is not an Empty type and has no Object Data set.", ob->id.name+2);
190 if (object_in_scene(ob, scene)) {
191 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
195 base= scene_add_base(scene, ob);
198 /* this is similar to what object_add_type and add_object do */
199 ob->lay= base->lay= scene->lay;
200 ob->recalc |= OB_RECALC;
202 DAG_scene_sort(scene);
207 static void rna_Scene_object_unlink(Scene *scene, bContext *C, ReportList *reports, Object *ob)
209 Base *base= object_in_scene(ob, scene);
211 BKE_report(reports, RPT_ERROR, "Object is not in this scene.");
214 if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
215 BKE_report(reports, RPT_ERROR, "Object must be in 'Object Mode' to unlink.");
219 /* as long as ED_base_object_free_and_unlink calls free_libblock_us, we don't have to decrement ob->id.us */
220 ED_base_object_free_and_unlink(scene, base);
222 /* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
223 DAG_scene_sort(scene);
224 DAG_ids_flush_update(0);
226 WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
229 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
231 ToolSettings *ts = (ToolSettings*)ptr->data;
232 if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
233 ts->skgen_template = value.data;
235 ts->skgen_template = NULL;
238 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
240 Scene *scene= (Scene*)ptr->data;
241 return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
244 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
246 Scene *scene= (Scene*)ptr->data;
248 scene->basact= object_in_scene((Object*)value.data, scene);
253 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
255 Scene *scene= (Scene*)ptr->data;
256 Scene *set= (Scene*)value.data;
259 for(nested_set= set; nested_set; nested_set= nested_set->set) {
260 if(nested_set==scene)
267 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
269 Scene *scene= (Scene*)ptr->data;
271 scene->lay= ED_view3d_scene_layer_set(scene->lay, values);
274 static void rna_Scene_layer_update(Main *bmain, Scene *unused, PointerRNA *ptr)
276 Scene *scene= (Scene*)ptr->data;
278 ED_view3d_scene_layers_update(bmain, scene);
281 static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
283 Scene *data= (Scene*)ptr->data;
285 /* if negative frames aren't allowed, then we can't use them */
286 FRAMENUMBER_MIN_CLAMP(value);
290 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
292 Scene *data= (Scene*)ptr->data;
293 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
294 CLAMP(value, MINFRAME, data->r.efra);
298 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
300 Scene *data= (Scene*)ptr->data;
301 CLAMP(value, data->r.sfra, MAXFRAME);
305 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
307 Scene *data= (Scene*)ptr->data;
310 /* copy range from scene if not set before */
311 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
312 data->r.psfra= data->r.sfra;
313 data->r.pefra= data->r.efra;
316 data->r.flag |= SCER_PRV_RANGE;
319 data->r.flag &= ~SCER_PRV_RANGE;
323 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
325 Scene *data= (Scene*)ptr->data;
327 /* check if enabled already */
328 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
329 /* set end of preview range to end frame, then clamp as per normal */
330 // TODO: or just refuse to set instead?
331 data->r.pefra= data->r.efra;
334 /* now set normally */
335 CLAMP(value, MINAFRAME, data->r.pefra);
336 data->r.psfra= value;
339 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
341 Scene *data= (Scene*)ptr->data;
343 /* check if enabled already */
344 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
345 /* set start of preview range to start frame, then clamp as per normal */
346 // TODO: or just refuse to set instead?
347 data->r.psfra= data->r.sfra;
350 /* now set normally */
351 CLAMP(value, data->r.psfra, MAXFRAME);
352 data->r.pefra= value;
355 static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
357 //Scene *scene= ptr->id.data;
358 //ED_update_for_newframe(C);
362 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
364 Scene *scene= (Scene *)ptr->data;
365 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
368 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
370 Scene *scene= (Scene *)ptr->data;
371 KeyingSet *ks= (KeyingSet*)value.data;
373 scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
376 #if 0 // XXX: these need to be fixed up first...
377 static void rna_Scene_active_keying_set_index_range(PointerRNA *ptr, int *min, int *max)
379 Scene *scene= (Scene *)ptr->data;
381 // FIXME: would need access to builtin keyingsets list to count min...
387 // XXX: evil... builtin_keyingsets is defined in keyingsets.c!
388 // TODO: make API function to retrieve this...
389 extern ListBase builtin_keyingsets;
391 static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
393 Scene *scene= (Scene*)ptr->data;
395 /* start going over the scene KeyingSets first, while we still have pointer to it
396 * but only if we have any Keying Sets to use...
398 if (scene->keyingsets.first)
399 rna_iterator_listbase_begin(iter, &scene->keyingsets, NULL);
401 rna_iterator_listbase_begin(iter, &builtin_keyingsets, NULL);
404 static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
406 ListBaseIterator *internal= iter->internal;
407 KeyingSet *ks= (KeyingSet*)internal->link;
409 /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
410 if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
411 internal->link= (Link*)builtin_keyingsets.first;
413 internal->link= (Link*)ks->next;
415 iter->valid= (internal->link != NULL);
419 static char *rna_RenderSettings_path(PointerRNA *ptr)
421 return BLI_sprintfN("render");
424 static int rna_RenderSettings_threads_get(PointerRNA *ptr)
426 RenderData *rd= (RenderData*)ptr->data;
428 if(rd->mode & R_FIXED_THREADS)
431 return BLI_system_thread_count();
434 static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
436 RenderData *rd= (RenderData*)ptr->data;
437 return BKE_imtype_is_movie(rd->imtype);
440 static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
442 RenderData *rd= (RenderData*)ptr->data;
443 if(rd->mode & R_BORDER)
446 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
449 static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
451 RenderData *rd= (RenderData*)ptr->data;
453 return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
456 static void rna_RenderSettings_file_format_set(PointerRNA *ptr, int value)
458 RenderData *rd= (RenderData*)ptr->data;
462 ffmpeg_verify_image_type(rd);
464 #ifdef WITH_QUICKTIME
465 quicktime_verify_image_type(rd);
469 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
471 RenderData *rd= (RenderData*)ptr->data;
474 BKE_add_image_extension(ext, rd->imtype);
478 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
480 RenderData *rd= (RenderData*)ptr->data;
481 BKE_add_image_extension(str, rd->imtype);
484 void rna_RenderSettings_jpeg2k_preset_update(RenderData *rd)
486 rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
488 switch(rd->jp2_depth) {
490 case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
491 case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
494 switch(rd->jp2_preset) {
495 case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
496 case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
497 case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
498 case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
499 case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
500 case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
501 case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
506 static void rna_RenderSettings_jpeg2k_preset_set(PointerRNA *ptr, int value)
508 RenderData *rd= (RenderData*)ptr->data;
509 rd->jp2_preset= value;
510 rna_RenderSettings_jpeg2k_preset_update(rd);
513 static void rna_RenderSettings_jpeg2k_depth_set(PointerRNA *ptr, int value)
515 RenderData *rd= (RenderData*)ptr->data;
516 rd->jp2_depth= value;
517 rna_RenderSettings_jpeg2k_preset_update(rd);
521 #ifdef WITH_QUICKTIME
522 static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
524 RenderData *rd= (RenderData*)ptr->data;
526 return quicktime_rnatmpvalue_from_codectype(rd->qtcodecsettings.codecType);
529 static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
531 RenderData *rd= (RenderData*)ptr->data;
533 rd->qtcodecsettings.codecType = quicktime_codecType_from_rnatmpvalue(value);
536 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, int *free)
538 EnumPropertyItem *item= NULL;
539 EnumPropertyItem tmp = {0, "", 0, "", ""};
540 QuicktimeCodecTypeDesc *codecTypeDesc;
544 for(i=0;i<quicktime_get_num_codecs();i++) {
545 codecTypeDesc = quicktime_get_codecType_desc(i);
546 if (!codecTypeDesc) break;
548 tmp.value= codecTypeDesc->rnatmpvalue;
549 *((int*)id) = codecTypeDesc->codecType;
552 tmp.name= codecTypeDesc->codecName;
553 RNA_enum_item_add(&item, &totitem, &tmp);
556 RNA_enum_item_end(&item, &totitem);
563 static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
565 RenderData *rd= (RenderData*)ptr->data;
569 static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
571 RenderData *rd= (RenderData*)ptr->data;
575 static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
577 RenderData *rd= (RenderData*)ptr->data;
580 *max= BLI_countlist(&rd->layers)-1;
584 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
586 RenderData *rd= (RenderData*)ptr->data;
587 RenderEngineType *type= BLI_findlink(&R_engines, value);
590 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
593 static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *C, PointerRNA *ptr, int *free)
595 RenderEngineType *type;
596 EnumPropertyItem *item= NULL;
597 EnumPropertyItem tmp = {0, "", 0, "", ""};
600 for(type=R_engines.first; type; type=type->next, a++) {
602 tmp.identifier= type->idname;
603 tmp.name= type->name;
604 RNA_enum_item_add(&item, &totitem, &tmp);
607 RNA_enum_item_end(&item, &totitem);
613 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
615 RenderData *rd= (RenderData*)ptr->data;
616 RenderEngineType *type;
619 for(type=R_engines.first; type; type=type->next, a++)
620 if(strcmp(type->idname, rd->engine) == 0)
626 static void rna_RenderSettings_color_management_update(Main *bmain, Scene *unused, PointerRNA *ptr)
628 /* reset image nodes */
629 Scene *scene= (Scene*)ptr->id.data;
630 bNodeTree *ntree=scene->nodetree;
633 if(ntree && scene->use_nodes) {
634 for (node=ntree->nodes.first; node; node=node->next) {
635 if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
636 ED_node_changed_update(&scene->id, node);
637 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
639 if (node->type == CMP_NODE_IMAGE)
640 BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
646 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
648 Scene *scene= (Scene*)ptr->id.data;
649 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
651 BLI_strncpy(rl->name, value, sizeof(rl->name));
653 if(scene->nodetree) {
655 int index= BLI_findindex(&scene->r.layers, rl);
657 for(node= scene->nodetree->nodes.first; node; node= node->next) {
658 if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
659 if(node->custom1==index)
660 BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
666 static int rna_RenderSettings_multiple_engines_get(PointerRNA *ptr)
668 return (BLI_countlist(&R_engines) > 1);
671 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
673 RenderData *rd= (RenderData*)ptr->data;
674 RenderEngineType *type;
676 for(type=R_engines.first; type; type=type->next)
677 if(strcmp(type->idname, rd->engine) == 0)
678 return (type->flag & RE_GAME);
683 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
685 SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
686 rl->lay= ED_view3d_scene_layer_set(rl->lay, values);
689 static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *unused, PointerRNA *ptr)
691 Scene *scene= (Scene*)ptr->id.data;
694 ntreeCompositForceHidden(scene->nodetree, scene);
697 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
699 Scene *scene= (Scene*)ptr->data;
701 scene->use_nodes= value;
702 if(scene->use_nodes && scene->nodetree==NULL)
703 ED_node_composit_default(scene);
706 static void rna_Physics_update(Main *bmain, Scene *unused, PointerRNA *ptr)
708 Scene *scene= (Scene*)ptr->id.data;
711 for(base = scene->base.first; base; base=base->next)
712 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
715 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
717 Scene *scene= (Scene*)ptr->id.data;
718 ToolSettings *ts = (ToolSettings*)ptr->data;
719 int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
722 ts->selectmode = flag;
725 Mesh *me= get_mesh(scene->basact->object);
726 if(me && me->edit_mesh && me->edit_mesh->selectmode != flag) {
727 me->edit_mesh->selectmode= flag;
728 EM_selectmode_set(me->edit_mesh);
734 static void rna_Scene_editmesh_select_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
739 me= get_mesh(scene->basact->object);
740 if(me && me->edit_mesh==NULL)
744 WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
745 WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
748 static void object_simplify_update(Object *ob)
752 for(md=ob->modifiers.first; md; md=md->next)
753 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
754 ob->recalc |= OB_RECALC_DATA;
759 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
760 object_simplify_update(gob->ob);
764 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
768 for(base= scene->base.first; base; base= base->next)
769 object_simplify_update(base->object);
771 DAG_ids_flush_update(0);
772 WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
775 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
777 Scene *scene= (Scene*)ptr->data;
778 if(scene->audio.flag & AUDIO_SYNC)
780 return scene->flag & SCE_FRAME_DROP;
783 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
785 Scene *scene= (Scene*)ptr->data;
787 if(value == AUDIO_SYNC)
788 scene->audio.flag |= AUDIO_SYNC;
789 else if(value == SCE_FRAME_DROP)
791 scene->audio.flag &= ~AUDIO_SYNC;
792 scene->flag |= SCE_FRAME_DROP;
796 scene->audio.flag &= ~AUDIO_SYNC;
797 scene->flag &= ~SCE_FRAME_DROP;
801 static int rna_GameSettings_auto_start_get(PointerRNA *ptr)
803 if (G.fileflags & G_FILE_AUTOPLAY)
809 static void rna_GameSettings_auto_start_set(PointerRNA *ptr, int value)
812 G.fileflags |= G_FILE_AUTOPLAY;
814 G.fileflags &= ~G_FILE_AUTOPLAY;
818 static TimeMarker *rna_TimeLine_add(Scene *scene, char name[])
820 TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
821 marker->flag= SELECT;
823 BLI_strncpy(marker->name, name, sizeof(marker->name));
824 BLI_addtail(&scene->markers, marker);
828 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker)
830 /* try to remove the F-Curve from the action */
831 if (!BLI_remlink_safe(&scene->markers, marker)) {
832 BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in action '%s'", marker->name, scene->id.name+2);
836 /* XXX, invalidates PyObject */
842 static void rna_def_transform_orientation(BlenderRNA *brna)
847 int matrix_dimsize[]= {3, 3};
849 srna= RNA_def_struct(brna, "TransformOrientation", NULL);
851 prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
852 RNA_def_property_float_sdna(prop, NULL, "mat");
853 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
854 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
856 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
857 RNA_def_property_string_sdna(prop, NULL, "name");
858 RNA_def_struct_name_property(srna, prop);
859 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
862 static void rna_def_tool_settings(BlenderRNA *brna)
867 static EnumPropertyItem uv_select_mode_items[] = {
868 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
869 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
870 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
871 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
872 {0, NULL, 0, NULL, NULL}};
874 static EnumPropertyItem auto_key_items[] = {
875 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
876 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
877 {0, NULL, 0, NULL, NULL}};
879 static EnumPropertyItem retarget_roll_items[] = {
880 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
881 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
882 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
883 {0, NULL, 0, NULL, NULL}};
885 static EnumPropertyItem sketch_convert_items[] = {
886 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
887 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
888 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts"},
889 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
890 {0, NULL, 0, NULL, NULL}};
892 static EnumPropertyItem edge_tag_items[] = {
893 {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
894 {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
895 {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
896 {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
897 {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
898 {0, NULL, 0, NULL, NULL}};
900 srna= RNA_def_struct(brna, "ToolSettings", NULL);
901 RNA_def_struct_ui_text(srna, "Tool Settings", "");
903 prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
904 RNA_def_property_struct_type(prop, "Sculpt");
905 RNA_def_property_ui_text(prop, "Sculpt", "");
907 prop = RNA_def_property(srna, "auto_normalize", PROP_BOOLEAN, PROP_NONE);
908 RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
909 RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
910 "Ensure all bone-deforming vertex groups add up to 1.0 while "
913 prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
914 RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
915 RNA_def_property_ui_text(prop, "Vertex Paint", "");
917 prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
918 RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
919 RNA_def_property_ui_text(prop, "Weight Paint", "");
921 prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
922 RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
923 RNA_def_property_ui_text(prop, "Image Paint", "");
925 prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
926 RNA_def_property_pointer_sdna(prop, NULL, "particle");
927 RNA_def_property_ui_text(prop, "Particle Edit", "");
930 prop= RNA_def_property(srna, "proportional_editing", PROP_ENUM, PROP_NONE);
931 RNA_def_property_enum_sdna(prop, NULL, "proportional");
932 RNA_def_property_enum_items(prop, proportional_editing_items);
933 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode");
934 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
936 prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE);
937 RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
938 RNA_def_property_enum_items(prop, proportional_falloff_items);
939 RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
940 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
942 prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
943 RNA_def_property_float_sdna(prop, NULL, "normalsize");
944 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
945 RNA_def_property_range(prop, 0.00001, 1000.0);
946 RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
947 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
949 prop= RNA_def_property(srna, "automerge_editing", PROP_BOOLEAN, PROP_NONE);
950 RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
951 RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
953 prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE);
954 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
955 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
956 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
957 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
959 prop= RNA_def_property(srna, "snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
960 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
961 RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
962 RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
963 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
965 prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
966 RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
967 RNA_def_property_enum_items(prop, snap_element_items);
968 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
969 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
971 prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
972 RNA_def_property_enum_sdna(prop, NULL, "snap_target");
973 RNA_def_property_enum_items(prop, snap_target_items);
974 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
975 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
977 prop= RNA_def_property(srna, "snap_peel_object", PROP_BOOLEAN, PROP_NONE);
978 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
979 RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
980 RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
981 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
983 prop= RNA_def_property(srna, "snap_project", PROP_BOOLEAN, PROP_NONE);
984 RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
985 RNA_def_property_ui_text(prop, "Project Individual Elements", "Project vertices on the surface of other objects");
986 RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
987 RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
990 prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
991 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
992 RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
994 prop= RNA_def_property(srna, "autokey_mode", PROP_ENUM, PROP_NONE);
995 RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
996 RNA_def_property_enum_items(prop, auto_key_items);
997 RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
999 prop= RNA_def_property(srna, "record_with_nla", PROP_BOOLEAN, PROP_NONE);
1000 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
1001 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");
1004 prop= RNA_def_property(srna, "uv_selection_mode", PROP_ENUM, PROP_NONE);
1005 RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
1006 RNA_def_property_enum_items(prop, uv_select_mode_items);
1007 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
1008 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1010 prop= RNA_def_property(srna, "uv_sync_selection", PROP_BOOLEAN, PROP_NONE);
1011 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
1012 RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
1013 RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1014 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1016 prop= RNA_def_property(srna, "uv_local_view", PROP_BOOLEAN, PROP_NONE);
1017 RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
1018 RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
1019 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1022 prop= RNA_def_property(srna, "mesh_selection_mode", PROP_BOOLEAN, PROP_NONE);
1023 RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
1024 RNA_def_property_array(prop, 3);
1025 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
1026 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
1027 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
1029 prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
1030 RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
1031 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
1033 /* use with MESH_OT_select_shortest_path */
1034 prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
1035 RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
1036 RNA_def_property_enum_items(prop, edge_tag_items);
1037 RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
1040 prop= RNA_def_property(srna, "bone_sketching", PROP_BOOLEAN, PROP_NONE);
1041 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
1042 RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
1043 // RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
1045 prop= RNA_def_property(srna, "etch_quick", PROP_BOOLEAN, PROP_NONE);
1046 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
1047 RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
1049 prop= RNA_def_property(srna, "etch_overdraw", PROP_BOOLEAN, PROP_NONE);
1050 RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
1051 RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
1053 prop= RNA_def_property(srna, "etch_autoname", PROP_BOOLEAN, PROP_NONE);
1054 RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
1055 RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
1057 prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
1058 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1059 RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
1061 prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
1062 RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
1063 RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
1065 prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
1066 RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
1067 RNA_def_property_flag(prop, PROP_EDITABLE);
1068 RNA_def_property_struct_type(prop, "Object");
1069 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL);
1070 RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
1072 prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
1073 RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
1074 RNA_def_property_range(prop, 1, 10000);
1075 RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
1076 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1078 prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
1079 RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
1080 RNA_def_property_range(prop, 0.00001, 1.0);
1081 RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
1082 RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
1083 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1085 prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
1086 RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
1087 RNA_def_property_range(prop, 0.00001, 100000.0);
1088 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1089 RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
1090 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1092 prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
1093 RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
1094 RNA_def_property_enum_items(prop, retarget_roll_items);
1095 RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
1097 prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
1098 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
1099 RNA_def_property_enum_items(prop, sketch_convert_items);
1100 RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
1101 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1105 static void rna_def_unit_settings(BlenderRNA *brna)
1110 static EnumPropertyItem unit_systems[] = {
1111 {USER_UNIT_NONE, "NONE", 0, "None", ""},
1112 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
1113 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
1114 {0, NULL, 0, NULL, NULL}};
1116 static EnumPropertyItem rotation_units[] = {
1117 {0, "DEGREES", 0, "Degrees", ""},
1118 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
1119 {0, NULL, 0, NULL, NULL}};
1121 srna= RNA_def_struct(brna, "UnitSettings", NULL);
1122 RNA_def_struct_ui_text(srna, "Unit Settings", "");
1125 prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
1126 RNA_def_property_enum_items(prop, unit_systems);
1127 RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
1128 RNA_def_property_update(prop, NC_WINDOW, NULL);
1130 prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
1131 RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
1132 RNA_def_property_range(prop, 0.00001, 100000.0);
1133 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
1134 RNA_def_property_update(prop, NC_WINDOW, NULL);
1136 prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
1137 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
1138 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs");
1139 RNA_def_property_update(prop, NC_WINDOW, NULL);
1141 prop= RNA_def_property(srna, "rotation_units", PROP_ENUM, PROP_NONE);
1142 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
1143 RNA_def_property_enum_items(prop, rotation_units);
1144 RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
1145 RNA_def_property_update(prop, NC_WINDOW, NULL);
1148 void rna_def_render_layer_common(StructRNA *srna, int scene)
1152 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1153 if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
1154 else RNA_def_property_string_sdna(prop, NULL, "name");
1155 RNA_def_property_ui_text(prop, "Name", "Render layer name");
1156 RNA_def_struct_name_property(srna, prop);
1157 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1158 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1160 prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
1161 RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
1162 RNA_def_property_struct_type(prop, "Material");
1163 RNA_def_property_flag(prop, PROP_EDITABLE);
1164 RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
1165 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1166 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1168 prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
1169 RNA_def_property_pointer_sdna(prop, NULL, "light_override");
1170 RNA_def_property_struct_type(prop, "Group");
1171 RNA_def_property_flag(prop, PROP_EDITABLE);
1172 RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
1173 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1174 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1177 prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1178 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1179 RNA_def_property_array(prop, 20);
1180 RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
1181 if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
1182 else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
1183 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1184 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1186 prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_LAYER);
1187 RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
1188 RNA_def_property_array(prop, 20);
1189 RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers");
1190 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1191 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1194 prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
1195 RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
1196 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
1197 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1198 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1200 prop= RNA_def_property(srna, "zmask", PROP_BOOLEAN, PROP_NONE);
1201 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
1202 RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
1203 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1204 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1206 prop= RNA_def_property(srna, "zmask_negate", PROP_BOOLEAN, PROP_NONE);
1207 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
1208 RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
1209 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1210 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1212 prop= RNA_def_property(srna, "all_z", PROP_BOOLEAN, PROP_NONE);
1213 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
1214 RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
1215 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1216 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1218 prop= RNA_def_property(srna, "solid", PROP_BOOLEAN, PROP_NONE);
1219 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
1220 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
1221 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1222 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1224 prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
1225 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
1226 RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
1227 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1228 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1230 prop= RNA_def_property(srna, "ztransp", PROP_BOOLEAN, PROP_NONE);
1231 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
1232 RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
1233 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1234 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1236 prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
1237 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
1238 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
1239 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1240 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1242 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
1243 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
1244 RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
1245 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1246 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1248 prop= RNA_def_property(srna, "strand", PROP_BOOLEAN, PROP_NONE);
1249 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
1250 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
1251 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1252 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1254 prop= RNA_def_property(srna, "freestyle", PROP_BOOLEAN, PROP_NONE);
1255 RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_FRS);
1256 RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer.");
1257 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1258 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1261 prop= RNA_def_property(srna, "pass_combined", PROP_BOOLEAN, PROP_NONE);
1262 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
1263 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
1264 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1265 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1267 prop= RNA_def_property(srna, "pass_z", PROP_BOOLEAN, PROP_NONE);
1268 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
1269 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
1270 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1271 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1273 prop= RNA_def_property(srna, "pass_vector", PROP_BOOLEAN, PROP_NONE);
1274 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
1275 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
1276 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1277 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1279 prop= RNA_def_property(srna, "pass_normal", PROP_BOOLEAN, PROP_NONE);
1280 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
1281 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
1282 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1283 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1285 prop= RNA_def_property(srna, "pass_uv", PROP_BOOLEAN, PROP_NONE);
1286 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
1287 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
1288 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1289 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1291 prop= RNA_def_property(srna, "pass_mist", PROP_BOOLEAN, PROP_NONE);
1292 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
1293 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
1294 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1295 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1297 prop= RNA_def_property(srna, "pass_object_index", PROP_BOOLEAN, PROP_NONE);
1298 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
1299 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
1300 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1301 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1303 prop= RNA_def_property(srna, "pass_color", PROP_BOOLEAN, PROP_NONE);
1304 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
1305 RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
1306 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1307 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1309 prop= RNA_def_property(srna, "pass_diffuse", PROP_BOOLEAN, PROP_NONE);
1310 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
1311 RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
1312 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1313 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1315 prop= RNA_def_property(srna, "pass_specular", PROP_BOOLEAN, PROP_NONE);
1316 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
1317 RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
1318 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1319 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1321 prop= RNA_def_property(srna, "pass_shadow", PROP_BOOLEAN, PROP_NONE);
1322 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
1323 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
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);
1327 prop= RNA_def_property(srna, "pass_ao", PROP_BOOLEAN, PROP_NONE);
1328 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
1329 RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
1330 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1331 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1333 prop= RNA_def_property(srna, "pass_reflection", PROP_BOOLEAN, PROP_NONE);
1334 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
1335 RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
1336 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1337 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1339 prop= RNA_def_property(srna, "pass_refraction", PROP_BOOLEAN, PROP_NONE);
1340 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
1341 RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
1342 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1343 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1345 prop= RNA_def_property(srna, "pass_emit", PROP_BOOLEAN, PROP_NONE);
1346 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
1347 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
1348 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1349 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1351 prop= RNA_def_property(srna, "pass_environment", PROP_BOOLEAN, PROP_NONE);
1352 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
1353 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
1354 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1355 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1357 prop= RNA_def_property(srna, "pass_indirect", PROP_BOOLEAN, PROP_NONE);
1358 RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
1359 RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
1360 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1361 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1363 prop= RNA_def_property(srna, "pass_specular_exclude", PROP_BOOLEAN, PROP_NONE);
1364 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
1365 RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
1366 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1367 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1369 prop= RNA_def_property(srna, "pass_shadow_exclude", PROP_BOOLEAN, PROP_NONE);
1370 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
1371 RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
1372 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1373 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1375 prop= RNA_def_property(srna, "pass_ao_exclude", PROP_BOOLEAN, PROP_NONE);
1376 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
1377 RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
1378 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1379 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1381 prop= RNA_def_property(srna, "pass_reflection_exclude", PROP_BOOLEAN, PROP_NONE);
1382 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
1383 RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
1384 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1385 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1387 prop= RNA_def_property(srna, "pass_refraction_exclude", PROP_BOOLEAN, PROP_NONE);
1388 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
1389 RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
1390 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1391 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1393 prop= RNA_def_property(srna, "pass_emit_exclude", PROP_BOOLEAN, PROP_NONE);
1394 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
1395 RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
1396 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1397 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1399 prop= RNA_def_property(srna, "pass_environment_exclude", PROP_BOOLEAN, PROP_NONE);
1400 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
1401 RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
1402 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1403 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1405 prop= RNA_def_property(srna, "pass_indirect_exclude", PROP_BOOLEAN, PROP_NONE);
1406 RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
1407 RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
1408 if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
1409 else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1412 static void rna_def_freestyle_settings(BlenderRNA *brna)
1417 /* FreestyleModuleSettings */
1419 srna= RNA_def_struct(brna, "FreestyleModuleSettings", NULL);
1420 RNA_def_struct_sdna(srna, "FreestyleModuleConfig");
1421 RNA_def_struct_ui_text(srna, "Freestyle Module", "Style module configuration for specifying a style module.");
1423 prop= RNA_def_property(srna, "module_path", PROP_STRING, PROP_FILEPATH);
1424 RNA_def_property_string_sdna(prop, NULL, "module_path");
1425 RNA_def_property_ui_text(prop, "Module Path", "Path to a style module file.");
1426 RNA_def_property_update(prop, NC_SCENE, NULL);
1428 prop= RNA_def_property(srna, "is_displayed", PROP_BOOLEAN, PROP_NONE);
1429 RNA_def_property_boolean_sdna(prop, NULL, "is_displayed", 1);
1430 RNA_def_property_ui_text(prop, "Is Displayed", "Enable this style module during the rendering.");
1431 RNA_def_property_update(prop, NC_SCENE, NULL);
1433 /* FreestyleSettings */
1435 srna= RNA_def_struct(brna, "FreestyleSettings", NULL);
1436 RNA_def_struct_sdna(srna, "FreestyleConfig");
1437 RNA_def_struct_nested(brna, srna, "SceneRenderLayer");
1438 RNA_def_struct_ui_text(srna, "Frestyle Settings", "Freestyle settings for a SceneRenderLayer datablock.");
1440 prop= RNA_def_property(srna, "modules", PROP_COLLECTION, PROP_NONE);
1441 RNA_def_property_collection_sdna(prop, NULL, "modules", NULL);
1442 RNA_def_property_struct_type(prop, "FreestyleModuleSettings");
1443 RNA_def_property_ui_text(prop, "Style modules", "A list of style modules (to be applied from top to bottom).");
1445 prop= RNA_def_property(srna, "suggestive_contours", PROP_BOOLEAN, PROP_NONE);
1446 RNA_def_property_boolean_sdna(prop, NULL, "flags", FREESTYLE_SUGGESTIVE_CONTOURS_FLAG);
1447 RNA_def_property_ui_text(prop, "Suggestive Contours", "Enable suggestive contours.");
1448 RNA_def_property_update(prop, NC_SCENE, NULL);
1450 prop= RNA_def_property(srna, "ridges_and_valleys", PROP_BOOLEAN, PROP_NONE);
1451 RNA_def_property_boolean_sdna(prop, NULL, "flags", FREESTYLE_RIDGES_AND_VALLEYS_FLAG);
1452 RNA_def_property_ui_text(prop, "Ridges and Valleys", "Enable ridges and valleys.");
1453 RNA_def_property_update(prop, NC_SCENE, NULL);
1455 prop= RNA_def_property(srna, "sphere_radius", PROP_FLOAT, PROP_NONE);
1456 RNA_def_property_float_sdna(prop, NULL, "sphere_radius");
1457 RNA_def_property_range(prop, 0.0, 1000.0);
1458 RNA_def_property_ui_text(prop, "Sphere Radius", "*TBD*");
1459 RNA_def_property_update(prop, NC_SCENE, NULL);
1461 prop= RNA_def_property(srna, "dkr_epsilon", PROP_FLOAT, PROP_NONE);
1462 RNA_def_property_float_sdna(prop, NULL, "dkr_epsilon");
1463 RNA_def_property_range(prop, 0.0, 1000.0);
1464 RNA_def_property_ui_text(prop, "Dkr Epsilon", "*TBD*");
1465 RNA_def_property_update(prop, NC_SCENE, NULL);
1468 static void rna_def_scene_game_data(BlenderRNA *brna)
1473 static EnumPropertyItem framing_types_items[] ={
1474 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
1475 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
1476 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
1477 {0, NULL, 0, NULL, NULL}};
1479 static EnumPropertyItem dome_modes_items[] ={
1480 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
1481 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
1482 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
1483 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
1484 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
1485 {0, NULL, 0, NULL, NULL}};
1487 static EnumPropertyItem stereo_modes_items[] ={
1488 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
1489 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
1490 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
1491 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
1492 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
1493 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
1494 {0, NULL, 0, NULL, NULL}};
1496 static EnumPropertyItem stereo_items[] ={
1497 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
1498 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
1499 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
1500 {0, NULL, 0, NULL, NULL}};
1502 static EnumPropertyItem physics_engine_items[] = {
1503 {WOPHY_NONE, "NONE", 0, "None", ""},
1504 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
1505 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
1506 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
1507 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
1508 {WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
1509 {0, NULL, 0, NULL, NULL}};
1511 static EnumPropertyItem material_items[] ={
1512 {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials"},
1513 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
1514 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
1515 {0, NULL, 0, NULL, NULL}};
1517 srna= RNA_def_struct(brna, "SceneGameData", NULL);
1518 RNA_def_struct_sdna(srna, "GameData");
1519 RNA_def_struct_nested(brna, srna, "Scene");
1520 RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
1522 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1523 RNA_def_property_int_sdna(prop, NULL, "xplay");
1524 RNA_def_property_range(prop, 4, 10000);
1525 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
1526 RNA_def_property_update(prop, NC_SCENE, NULL);
1528 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1529 RNA_def_property_int_sdna(prop, NULL, "yplay");
1530 RNA_def_property_range(prop, 4, 10000);
1531 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
1532 RNA_def_property_update(prop, NC_SCENE, NULL);
1534 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
1535 RNA_def_property_int_sdna(prop, NULL, "depth");
1536 RNA_def_property_range(prop, 8, 32);
1537 RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
1538 RNA_def_property_update(prop, NC_SCENE, NULL);
1540 // Do we need it here ? (since we already have it in World
1541 prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
1542 RNA_def_property_int_sdna(prop, NULL, "freqplay");
1543 RNA_def_property_range(prop, 4, 2000);
1544 RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display");
1545 RNA_def_property_update(prop, NC_SCENE, NULL);
1547 prop= RNA_def_property(srna, "fullscreen", PROP_BOOLEAN, PROP_NONE);
1548 RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
1549 RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
1550 RNA_def_property_update(prop, NC_SCENE, NULL);
1553 prop= RNA_def_property(srna, "framing_type", PROP_ENUM, PROP_NONE);
1554 RNA_def_property_enum_sdna(prop, NULL, "framing.type");
1555 RNA_def_property_enum_items(prop, framing_types_items);
1556 RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
1557 RNA_def_property_update(prop, NC_SCENE, NULL);
1559 prop= RNA_def_property(srna, "framing_color", PROP_FLOAT, PROP_COLOR);
1560 RNA_def_property_float_sdna(prop, NULL, "framing.col");
1561 RNA_def_property_array(prop, 3);
1562 RNA_def_property_ui_text(prop, "Framing Color", "Set colour of the bars");
1563 RNA_def_property_update(prop, NC_SCENE, NULL);
1566 prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
1567 RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
1568 RNA_def_property_enum_items(prop, stereo_items);
1569 RNA_def_property_ui_text(prop, "Stereo Options", "");
1570 RNA_def_property_update(prop, NC_SCENE, NULL);
1572 prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
1573 RNA_def_property_enum_sdna(prop, NULL, "stereomode");
1574 RNA_def_property_enum_items(prop, stereo_modes_items);
1575 RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
1576 RNA_def_property_update(prop, NC_SCENE, NULL);
1578 prop= RNA_def_property(srna, "eye_separation", PROP_FLOAT, PROP_NONE);
1579 RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
1580 RNA_def_property_range(prop, 0.01, 5.0);
1581 RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
1582 RNA_def_property_update(prop, NC_SCENE, NULL);
1585 prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
1586 RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
1587 RNA_def_property_enum_items(prop, dome_modes_items);
1588 RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
1589 RNA_def_property_update(prop, NC_SCENE, NULL);
1591 prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
1592 RNA_def_property_int_sdna(prop, NULL, "dome.res");
1593 RNA_def_property_ui_range(prop, 1, 8, 1, 1);
1594 RNA_def_property_ui_text(prop, "Tesselation", "Tesselation level - check the generated mesh in wireframe mode");
1595 RNA_def_property_update(prop, NC_SCENE, NULL);
1597 prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
1598 RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
1599 RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
1600 RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
1601 RNA_def_property_update(prop, NC_SCENE, NULL);
1603 prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
1604 RNA_def_property_int_sdna(prop, NULL, "dome.angle");
1605 RNA_def_property_ui_range(prop, 90, 250, 1, 1);
1606 RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
1607 RNA_def_property_update(prop, NC_SCENE, NULL);
1609 prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
1610 RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
1611 RNA_def_property_ui_range(prop, -180, 180, 1, 1);
1612 RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
1613 RNA_def_property_update(prop, NC_SCENE, NULL);
1615 prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
1616 RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
1617 RNA_def_property_struct_type(prop, "Text");
1618 RNA_def_property_flag(prop, PROP_EDITABLE);
1619 RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
1620 RNA_def_property_update(prop, NC_SCENE, NULL);
1623 prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
1624 RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
1625 RNA_def_property_enum_items(prop, physics_engine_items);
1626 RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
1627 RNA_def_property_update(prop, NC_SCENE, NULL);
1629 prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
1630 RNA_def_property_float_sdna(prop, NULL, "gravity");
1631 RNA_def_property_range(prop, 0.0, 25.0);
1632 RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
1633 RNA_def_property_update(prop, NC_SCENE, NULL);
1635 prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_FLOAT, PROP_NONE);
1636 RNA_def_property_float_sdna(prop, NULL, "occlusionRes");
1637 RNA_def_property_range(prop, 128.0, 1024.0);
1638 RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precsion (slower)");
1639 RNA_def_property_update(prop, NC_SCENE, NULL);
1641 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
1642 RNA_def_property_int_sdna(prop, NULL, "ticrate");
1643 RNA_def_property_ui_range(prop, 1, 60, 1, 1);
1644 RNA_def_property_range(prop, 1, 250);
1645 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");
1646 RNA_def_property_update(prop, NC_SCENE, NULL);
1648 prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
1649 RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
1650 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1651 RNA_def_property_range(prop, 1, 5);
1652 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");
1653 RNA_def_property_update(prop, NC_SCENE, NULL);
1655 prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
1656 RNA_def_property_int_sdna(prop, NULL, "maxphystep");
1657 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1658 RNA_def_property_range(prop, 1, 5);
1659 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");
1660 RNA_def_property_update(prop, NC_SCENE, NULL);
1662 prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
1663 RNA_def_property_int_sdna(prop, NULL, "physubstep");
1664 RNA_def_property_ui_range(prop, 1, 5, 1, 1);
1665 RNA_def_property_range(prop, 1, 5);
1666 RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
1667 RNA_def_property_update(prop, NC_SCENE, NULL);
1670 prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
1671 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
1672 RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustrum and occlusion culling");
1674 // not used // deprecated !!!!!!!!!!!!!
1675 prop= RNA_def_property(srna, "activity_culling", PROP_BOOLEAN, PROP_NONE);
1676 RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
1677 RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
1679 // not used // deprecated !!!!!!!!!!!!!
1680 prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
1681 RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
1682 RNA_def_property_range(prop, 0.0, 1000.0);
1683 RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
1686 prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
1687 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
1688 RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
1690 prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
1691 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
1692 RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs");
1694 prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
1695 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
1696 RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
1698 prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
1699 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
1700 RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather then rendering as many frames as possible");
1702 prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
1703 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
1704 RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
1706 prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
1707 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
1708 RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
1710 prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
1711 RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
1712 RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
1714 prop= RNA_def_property(srna, "auto_start", PROP_BOOLEAN, PROP_NONE);
1715 RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
1716 RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
1719 prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
1720 RNA_def_property_enum_sdna(prop, NULL, "matmode");
1721 RNA_def_property_enum_items(prop, material_items);
1722 RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
1723 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1725 prop= RNA_def_property(srna, "glsl_lights", PROP_BOOLEAN, PROP_NONE);
1726 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
1727 RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
1728 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1730 prop= RNA_def_property(srna, "glsl_shaders", PROP_BOOLEAN, PROP_NONE);
1731 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
1732 RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
1733 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1735 prop= RNA_def_property(srna, "glsl_shadows", PROP_BOOLEAN, PROP_NONE);
1736 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
1737 RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
1738 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1740 prop= RNA_def_property(srna, "glsl_ramps", PROP_BOOLEAN, PROP_NONE);
1741 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
1742 RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
1743 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1745 prop= RNA_def_property(srna, "glsl_nodes", PROP_BOOLEAN, PROP_NONE);
1746 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
1747 RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
1748 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1750 prop= RNA_def_property(srna, "glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
1751 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
1752 RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
1753 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
1756 static void rna_def_scene_render_layer(BlenderRNA *brna)
1761 srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
1762 RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
1764 rna_def_render_layer_common(srna, 1);
1768 rna_def_freestyle_settings(brna);
1770 prop= RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE);
1771 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1772 RNA_def_property_pointer_sdna(prop, NULL, "freestyleConfig");
1773 RNA_def_property_struct_type(prop, "FreestyleSettings");
1774 RNA_def_property_ui_text(prop, "Freestyle Settings", "");
1777 static void rna_def_scene_render_data(BlenderRNA *brna)
1782 static EnumPropertyItem pixel_filter_items[] ={
1783 {R_FILTER_BOX, "BOX", 0, "Box", ""},
1784 {R_FILTER_TENT, "TENT", 0, "Tent", ""},
1785 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""},
1786 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""},
1787 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""},
1788 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""},
1789 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""},
1790 {0, NULL, 0, NULL, NULL}};
1792 static EnumPropertyItem alpha_mode_items[] ={
1793 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
1794 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
1795 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
1796 {0, NULL, 0, NULL, NULL}};
1798 static EnumPropertyItem color_mode_items[] ={
1799 {R_PLANESBW, "BW", 0, "BW", "Images are saved with BW (grayscale) data"},
1800 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
1801 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
1802 {0, NULL, 0, NULL, NULL}};
1804 static EnumPropertyItem display_mode_items[] ={
1805 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
1806 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
1807 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
1808 {0, NULL, 0, NULL, NULL}};
1811 static EnumPropertyItem bake_mode_items[] ={
1812 {RE_BAKE_ALL, "FULL", 0, "Full Render", ""},
1813 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""},
1814 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""},
1815 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""},
1816 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""},
1817 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""},
1818 {0, NULL, 0, NULL, NULL}};
1820 static EnumPropertyItem bake_normal_space_items[] ={
1821 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""},
1822 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""},
1823 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""},
1824 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
1825 {0, NULL, 0, NULL, NULL}};
1827 static EnumPropertyItem bake_qyad_split_items[] ={
1828 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
1829 {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
1830 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
1831 {0, NULL, 0, NULL, NULL}};
1833 static EnumPropertyItem octree_resolution_items[] = {
1834 {64, "64", 0, "64", ""},
1835 {128, "128", 0, "128", ""},
1836 {256, "256", 0, "256", ""},
1837 {512, "512", 0, "512", ""},
1838 {0, NULL, 0, NULL, NULL}};
1840 static EnumPropertyItem raytrace_structure_items[] = {
1841 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""},
1842 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"},
1843 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
1844 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""},
1845 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""},
1846 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""},
1847 {0, NULL, 0, NULL, NULL}
1850 static EnumPropertyItem fixed_oversample_items[] = {
1851 {5, "5", 0, "5", ""},
1852 {8, "8", 0, "8", ""},
1853 {11, "11", 0, "11", ""},
1854 {16, "16", 0, "16", ""},
1855 {0, NULL, 0, NULL, NULL}};
1857 static EnumPropertyItem field_order_items[] = {
1858 {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"},
1859 {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"},
1860 {0, NULL, 0, NULL, NULL}};
1862 static EnumPropertyItem threads_mode_items[] = {
1863 {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
1864 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
1865 {0, NULL, 0, NULL, NULL}};
1868 static EnumPropertyItem exr_codec_items[] = {
1869 {0, "NONE", 0, "None", ""},
1870 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
1871 {2, "ZIP", 0, "ZIP (lossless)", ""},
1872 {3, "PIZ", 0, "PIZ (lossless)", ""},
1873 {4, "RLE", 0, "RLE (lossless)", ""},
1874 {0, NULL, 0, NULL, NULL}};
1877 #ifdef WITH_OPENJPEG
1878 static EnumPropertyItem jp2_preset_items[] = {
1879 {0, "NO_PRESET", 0, "No Preset", ""},
1880 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
1881 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
1882 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
1883 {4, "CINE_SCOPE_48FPS", 0, "Cine-Scope 24fps 2048x858", ""},
1884 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
1885 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
1886 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
1887 {0, NULL, 0, NULL, NULL}};
1889 static EnumPropertyItem jp2_depth_items[] = {
1890 {8, "8", 0, "8", "8 bit color channels"},
1891 {12, "12", 0, "12", "12 bit color channels"},
1892 {16, "16", 0, "16", "16 bit color channels"},
1893 {0, NULL, 0, NULL, NULL}};
1896 #ifdef WITH_QUICKTIME
1897 static EnumPropertyItem quicktime_codec_type_items[] = {
1898 {0, "codec", 0, "codec", ""},
1899 {0, NULL, 0, NULL, NULL}};
1903 static EnumPropertyItem ffmpeg_format_items[] = {
1904 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
1905 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
1906 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
1907 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
1908 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
1909 {FFMPEG_DV, "DV", 0, "DV", ""},
1910 {FFMPEG_H264, "H264", 0, "H.264", ""},
1911 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
1912 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
1913 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
1914 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
1915 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
1916 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
1917 {0, NULL, 0, NULL, NULL}};
1919 static EnumPropertyItem ffmpeg_codec_items[] = {
1920 {CODEC_ID_NONE, "NONE", 0, "None", ""},
1921 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
1922 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
1923 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
1924 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
1925 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
1926 {CODEC_ID_H264, "H264", 0, "H.264", ""},
1927 {CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
1928 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
1929 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
1930 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
1931 {0, NULL, 0, NULL, NULL}};
1933 static EnumPropertyItem ffmpeg_audio_codec_items[] = {
1934 {CODEC_ID_NONE, "NONE", 0, "None", ""},
1935 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
1936 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
1937 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
1938 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
1939 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
1940 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
1941 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
1942 {0, NULL, 0, NULL, NULL}};
1945 static EnumPropertyItem engine_items[] = {
1946 {0, "BLENDER_RENDER", 0, "Blender Render", ""},
1947 {0, NULL, 0, NULL, NULL}};
1949 srna= RNA_def_struct(brna, "RenderSettings", NULL);
1950 RNA_def_struct_sdna(srna, "RenderData");
1951 RNA_def_struct_nested(brna, srna, "Scene");
1952 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
1953 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
1955 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
1956 RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
1957 RNA_def_property_enum_items(prop, color_mode_items);
1958 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");
1959 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1961 prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
1962 RNA_def_property_int_sdna(prop, NULL, "xsch");
1963 RNA_def_property_range(prop, 4, 10000);
1964 RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
1965 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1967 prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
1968 RNA_def_property_int_sdna(prop, NULL, "ysch");
1969 RNA_def_property_range(prop, 4, 10000);
1970 RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
1971 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1973 prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
1974 RNA_def_property_int_sdna(prop, NULL, "size");
1975 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
1976 RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
1977 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1979 prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
1980 RNA_def_property_int_sdna(prop, NULL, "xparts");
1981 RNA_def_property_range(prop, 1, 512);
1982 RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
1983 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1985 prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
1986 RNA_def_property_int_sdna(prop, NULL, "yparts");
1987 RNA_def_property_range(prop, 1, 512);
1988 RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
1989 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1991 prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
1992 RNA_def_property_float_sdna(prop, NULL, "xasp");
1993 RNA_def_property_range(prop, 1.0f, 200.0f);
1994 RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
1995 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
1997 prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
1998 RNA_def_property_float_sdna(prop, NULL, "yasp");
1999 RNA_def_property_range(prop, 1.0f, 200.0f);
2000 RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
2001 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2003 /* JPEG and AVI JPEG */
2005 prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
2006 RNA_def_property_int_sdna(prop, NULL, "quality");
2007 RNA_def_property_range(prop, 1, 100);
2008 RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies");
2009 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2013 prop= RNA_def_property(srna, "tiff_bit", PROP_BOOLEAN, PROP_NONE);
2014 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
2015 RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
2016 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2018 /* Cineon and DPX */
2020 prop= RNA_def_property(srna, "cineon_log", PROP_BOOLEAN, PROP_NONE);
2021 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
2022 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
2023 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2025 prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
2026 RNA_def_property_int_sdna(prop, NULL, "cineonblack");
2027 RNA_def_property_range(prop, 0, 1024);
2028 RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
2029 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2031 prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
2032 RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
2033 RNA_def_property_range(prop, 0, 1024);
2034 RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
2035 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2037 prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
2038 RNA_def_property_float_sdna(prop, NULL, "cineongamma");
2039 RNA_def_property_range(prop, 0.0f, 10.0f);
2040 RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
2041 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2046 prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
2047 RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
2048 RNA_def_property_enum_items(prop, exr_codec_items);
2049 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
2050 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2052 prop= RNA_def_property(srna, "exr_half", PROP_BOOLEAN, PROP_NONE);
2053 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
2054 RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
2055 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2057 prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
2058 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
2059 RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int zbuffer)");
2060 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2062 prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
2063 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
2064 RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
2065 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2068 #ifdef WITH_OPENJPEG
2071 prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
2072 RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
2073 RNA_def_property_enum_items(prop, jp2_preset_items);
2074 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_preset_set", NULL);
2075 RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
2076 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2078 prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
2079 RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
2080 RNA_def_property_enum_items(prop, jp2_depth_items);
2081 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_depth_set", NULL);
2082 RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
2083 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2085 prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
2086 RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
2087 RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
2088 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2091 #ifdef WITH_QUICKTIME
2094 prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
2095 RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
2096 RNA_def_property_enum_items(prop, quicktime_codec_type_items);
2097 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
2098 "rna_RenderSettings_qtcodecsettings_codecType_set",
2099 "rna_RenderSettings_qtcodecsettings_codecType_itemf");
2100 RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
2101 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2103 prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
2104 RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
2105 RNA_def_property_range(prop, 0, 100);
2106 RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
2107 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2113 prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
2114 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
2115 RNA_def_property_enum_items(prop, ffmpeg_format_items);
2116 RNA_def_property_ui_text(prop, "Format", "Output file format");
2117 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2119 prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
2120 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
2121 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
2122 RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
2123 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2125 prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
2126 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
2127 RNA_def_property_range(prop, 1, 14000);
2128 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
2129 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2131 prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
2132 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
2133 RNA_def_property_range(prop, 0, 9000);
2134 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
2135 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2137 prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
2138 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
2139 RNA_def_property_range(prop, 1, 14000);
2140 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
2141 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2143 prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
2144 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
2145 RNA_def_property_range(prop, 0, 100000000);
2146 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
2147 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2149 prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
2150 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
2151 RNA_def_property_range(prop, 0, 100);
2152 RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
2153 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2155 prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
2156 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
2157 RNA_def_property_range(prop, 0, 2000);
2158 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
2159 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2161 prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
2162 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
2163 RNA_def_property_range(prop, 0, 16384);
2164 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
2165 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2167 prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
2168 RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
2169 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
2170 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2173 prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
2174 RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
2175 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
2176 RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
2177 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2179 prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
2180 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
2181 RNA_def_property_range(prop, 32, 384);
2182 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
2183 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2185 prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
2186 RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
2187 RNA_def_property_range(prop, 8000, 192000);
2188 RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
2189 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2191 prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
2192 RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
2193 RNA_def_property_range(prop, 0.0f, 1.0f);
2194 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
2195 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2199 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
2200 RNA_def_property_int_sdna(prop, NULL, "frs_sec");
2201 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2202 RNA_def_property_range(prop, 1, 120);
2203 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
2204 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2206 prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
2207 RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
2208 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2209 RNA_def_property_range(prop, 0.1f, 120.0f);
2210 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
2211 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2213 prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
2214 RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
2215 RNA_def_property_range(prop, 0.0f, 2.0f);
2216 RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding");
2217 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2219 prop= RNA_def_property(srna, "pixel_filter", PROP_ENUM, PROP_NONE);
2220 RNA_def_property_enum_sdna(prop, NULL, "filtertype");
2221 RNA_def_property_enum_items(prop, pixel_filter_items);
2222 RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
2223 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2225 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
2226 RNA_def_property_float_sdna(prop, NULL, "gauss");
2227 RNA_def_property_range(prop, 0.5f, 1.5f);
2228 RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
2229 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2231 prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2232 RNA_def_property_enum_sdna(prop, NULL, "alphamode");
2233 RNA_def_property_enum_items(prop, alpha_mode_items);
2234 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2235 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2237 prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
2238 RNA_def_property_enum_sdna(prop, NULL, "ocres");
2239 RNA_def_property_enum_items(prop, octree_resolution_items);
2240 RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes");
2241 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2243 prop= RNA_def_property(srna, "raytrace_structure", PROP_ENUM, PROP_NONE);
2244 RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
2245 RNA_def_property_enum_items(prop, raytrace_structure_items);
2246 RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
2247 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2249 prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
2250 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
2251 RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates");
2252 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2254 prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
2255 RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
2256 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");
2257 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2259 prop= RNA_def_property(srna, "antialiasing", PROP_BOOLEAN, PROP_NONE);
2260 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
2261 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
2262 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2264 prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
2265 RNA_def_property_enum_sdna(prop, NULL, "osa");
2266 RNA_def_property_enum_items(prop, fixed_oversample_items);
2267 RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
2268 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2270 prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
2271 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
2272 RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
2273 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2275 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
2276 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2277 RNA_def_property_enum_items(prop, field_order_items);
2278 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");
2279 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2281 prop= RNA_def_property(srna, "fields_still", PROP_BOOLEAN, PROP_NONE);
2282 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
2283 RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
2284 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2286 prop= RNA_def_property(srna, "render_shadows", PROP_BOOLEAN, PROP_NONE);
2287 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
2288 RNA_def_property_ui_text(prop, "Render Shadows", "Calculate shadows while rendering");
2289 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2291 prop= RNA_def_property(srna, "render_envmaps", PROP_BOOLEAN, PROP_NONE);
2292 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
2293 RNA_def_property_ui_text(prop, "Render Environment Maps", "Calculate environment maps while rendering");
2294 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2296 prop= RNA_def_property(srna, "render_radiosity", PROP_BOOLEAN, PROP_NONE);
2297 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
2298 RNA_def_property_ui_text(prop, "Render Radiosity", "Calculate radiosity in a pre-process before rendering");
2299 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2301 prop= RNA_def_property(srna, "render_sss", PROP_BOOLEAN, PROP_NONE);
2302 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
2303 RNA_def_property_ui_text(prop, "Render SSS", "Calculate sub-surface scattering in materials rendering");
2304 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2306 prop= RNA_def_property(srna, "render_raytracing", PROP_BOOLEAN, PROP_NONE);
2307 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
2308 RNA_def_property_ui_text(prop, "Render Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
2309 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2311 prop= RNA_def_property(srna, "render_textures", PROP_BOOLEAN, PROP_NONE);
2312 RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
2313 RNA_def_property_ui_text(prop, "Render Textures", "Use textures to affect material properties");
2314 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2316 prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
2317 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
2318 RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
2319 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2321 prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
2322 RNA_def_property_int_sdna(prop, NULL, "edgeint");
2323 RNA_def_property_range(prop, 0, 255);
2324 RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
2325 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2327 prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
2328 RNA_def_property_float_sdna(prop, NULL, "edgeR");
2329 RNA_def_property_array(prop, 3);
2330 RNA_def_property_ui_text(prop, "Edge Color", "");
2331 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2333 prop= RNA_def_property(srna, "freestyle", PROP_BOOLEAN, PROP_NONE);
2334 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE_FRS);
2335 RNA_def_property_ui_text(prop, "Edge", "Draw stylized strokes using Freestyle.");
2336 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2338 prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
2339 RNA_def_property_int_sdna(prop, NULL, "threads");
2340 RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
2341 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
2342 RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
2343 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2345 prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
2346 RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
2347 RNA_def_property_enum_items(prop, threads_mode_items);
2348 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
2349 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2351 prop= RNA_def_property(srna, "motion_blur", PROP_BOOLEAN, PROP_NONE);
2352 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
2353 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
2354 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2356 prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
2357 RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
2358 RNA_def_property_range(prop, 1, 32);
2359 RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
2360 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2362 prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
2363 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
2364 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");
2365 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2367 prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
2368 RNA_def_property_float_sdna(prop, NULL, "border.xmin");
2369 RNA_def_property_range(prop, 0.0f, 1.0f);
2370 RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border");
2371 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2373 prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
2374 RNA_def_property_float_sdna(prop, NULL, "border.ymin");
2375 RNA_def_property_range(prop, 0.0f, 1.0f);
2376 RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
2377 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2379 prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
2380 RNA_def_property_float_sdna(prop, NULL, "border.xmax");
2381 RNA_def_property_range(prop, 0.0f, 1.0f);
2382 RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
2383 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2385 prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
2386 RNA_def_property_float_sdna(prop, NULL, "border.ymax");
2387 RNA_def_property_range(prop, 0.0f, 1.0f);
2388 RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
2389 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2391 prop= RNA_def_property(srna, "crop_to_border", PROP_BOOLEAN, PROP_NONE);
2392 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
2393 RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
2394 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2396 prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
2397 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
2398 RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
2399 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2401 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2402 RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
2403 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
2404 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2406 prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
2407 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
2408 RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled");
2409 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2411 prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
2412 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
2413 RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist");
2414 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2416 prop= RNA_def_property(srna, "color_management", PROP_BOOLEAN, PROP_NONE);
2417 RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
2418 RNA_def_property_ui_text(prop, "Color Management", "Use color profiles and gamma corrected imaging pipeline");
2419 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_MATERIAL|ND_SHADING, "rna_RenderSettings_color_management_update");
2421 prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
2422 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
2423 RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
2424 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2426 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
2427 RNA_def_property_enum_sdna(prop, NULL, "imtype");
2428 RNA_def_property_enum_items(prop, image_type_items);
2429 RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
2430 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
2431 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2433 prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
2434 RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
2435 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
2436 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2438 prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
2439 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
2440 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2441 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
2443 prop= RNA_def_property(srna, "free_image_textures", PROP_BOOLEAN, PROP_NONE);
2444 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2445 RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing");
2446 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2448 prop= RNA_def_property(srna, "free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
2449 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
2450 RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
2451 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2453 prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE);
2454 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
2455 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
2456 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)");
2457 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2459 prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE);
2460 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
2461 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
2462 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");
2463 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2465 prop= RNA_def_property(srna, "backbuf", PROP_BOOLEAN, PROP_NONE);
2466 RNA_def_property_boolean_sdna(prop, NULL, "bufflag", R_BACKBUF);
2467 RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image");
2468 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2470 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2471 RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
2472 RNA_def_property_enum_items(prop, display_mode_items);
2473 RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
2474 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2476 prop= RNA_def_property(srna, "output_path", PROP_STRING, PROP_DIRPATH);
2477 RNA_def_property_string_sdna(prop, NULL, "pic");
2478 RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers");
2479 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2483 prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
2484 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
2485 RNA_def_property_enum_items(prop, bake_mode_items);
2486 RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
2488 prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
2489 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
2490 RNA_def_property_enum_items(prop, bake_normal_space_items);
2491 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
2493 prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
2494 RNA_def_property_enum_items(prop, bake_qyad_split_items);
2495 RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
2497 prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
2498 RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
2499 RNA_def_property_enum_items(prop, fixed_oversample_items);
2500 RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
2502 prop= RNA_def_property(srna, "bake_active", PROP_BOOLEAN, PROP_NONE);
2503 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
2504 RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
2506 prop= RNA_def_property(srna, "bake_normalized", PROP_BOOLEAN, PROP_NONE);
2507 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
2508 RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings");
2510 prop= RNA_def_property(srna, "bake_clear", PROP_BOOLEAN, PROP_NONE);
2511 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
2512 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
2514 prop= RNA_def_property(srna, "bake_enable_aa", PROP_BOOLEAN, PROP_NONE);
2515 RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
2516 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
2518 prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
2519 RNA_def_property_int_sdna(prop, NULL, "bake_filter");
2520 RNA_def_property_range(prop, 0, 32);
2521 RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
2523 prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
2524 RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
2525 RNA_def_property_range(prop, 0.0, 1000.0);
2526 RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
2528 prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
2529 RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
2530 RNA_def_property_range(prop, 0.0, 1000.0);
2531 RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
2535 prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE);
2536 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
2537 RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
2538 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2540 prop= RNA_def_property(srna, "stamp_date", PROP_BOOLEAN, PROP_NONE);
2541 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
2542 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
2543 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2545 prop= RNA_def_property(srna, "stamp_frame", PROP_BOOLEAN, PROP_NONE);
2546 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
2547 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
2548 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2550 prop= RNA_def_property(srna, "stamp_camera", PROP_BOOLEAN, PROP_NONE);
2551 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
2552 RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
2553 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2555 prop= RNA_def_property(srna, "stamp_scene", PROP_BOOLEAN, PROP_NONE);
2556 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
2557 RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
2558 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2560 prop= RNA_def_property(srna, "stamp_note", PROP_BOOLEAN, PROP_NONE);
2561 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
2562 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
2563 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2565 prop= RNA_def_property(srna, "stamp_marker", PROP_BOOLEAN, PROP_NONE);
2566 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
2567 RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
2568 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2570 prop= RNA_def_property(srna, "stamp_filename", PROP_BOOLEAN, PROP_NONE);
2571 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
2572 RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
2573 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2575 prop= RNA_def_property(srna, "stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
2576 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
2577 RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
2578 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2580 prop= RNA_def_property(srna, "stamp_render_time", PROP_BOOLEAN, PROP_NONE);
2581 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
2582 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
2583 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2585 prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
2586 RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
2587 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
2588 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2590 prop= RNA_def_property(srna, "render_stamp", PROP_BOOLEAN, PROP_NONE);
2591 RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
2592 RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
2593 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2595 prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
2596 RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
2597 RNA_def_property_range(prop, 8, 64);
2598 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
2599 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2601 prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
2602 RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
2603 RNA_def_property_array(prop, 4);
2604 RNA_def_property_range(prop,0.0,1.0);
2605 RNA_def_property_ui_text(prop, "Stamp Text Color", "Color to use for stamp text");
2606 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2608 prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
2609 RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
2610 RNA_def_property_array(prop, 4);
2611 RNA_def_property_range(prop,0.0,1.0);
2612 RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
2613 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2615 /* sequencer draw options */
2617 prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
2618 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV);
2619 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2621 prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
2622 RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND);
2623 RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
2626 prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
2627 RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
2628 RNA_def_property_enum_items(prop, viewport_shading_items);
2629 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2631 prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
2632 RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
2633 RNA_def_property_enum_items(prop, viewport_shading_items);
2634 RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
2638 prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
2639 RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
2640 RNA_def_property_struct_type(prop, "SceneRenderLayer");
2641 RNA_def_property_ui_text(prop, "Render Layers", "");
2643 prop= RNA_def_property(srna, "single_layer", PROP_BOOLEAN, PROP_NONE);
2644 RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
2645 RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
2646 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2648 prop= RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE);
2649 RNA_def_property_int_sdna(prop, NULL, "actlay");
2650 RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
2651 RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
2652 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2655 prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
2656 RNA_def_property_enum_items(prop, engine_items);
2657 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set", "rna_RenderSettings_engine_itemf");
2658 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
2659 RNA_def_property_update(prop, NC_WINDOW, NULL);
2661 prop= RNA_def_property(srna, "multiple_engines", PROP_BOOLEAN, PROP_NONE);
2662 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
2663 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2664 RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
2666 prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
2667 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
2668 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2669 RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine");
2672 prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
2673 RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
2674 RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
2675 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2677 prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_NONE);
2678 RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
2679 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
2680 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
2681 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2683 prop= RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
2684 RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
2685 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
2686 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2688 prop= RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
2689 RNA_def_property_int_sdna(prop, NULL, "simplify_shadowsamples");
2690 RNA_def_property_ui_range(prop, 1, 16, 1, 0);
2691 RNA_def_property_ui_text(prop, "Simplify Shadow Samples", "Global maximum shadow samples");
2692 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2694 prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
2695 RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
2696 RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor");
2697 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
2699 prop= RNA_def_property(srna, "simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
2700 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
2701 RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated");
2704 RNA_api_scene_render(srna);
2708 static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
2716 RNA_def_property_srna(cprop, "SceneObjects");
2717 srna= RNA_def_struct(brna, "SceneObjects", NULL);
2718 RNA_def_struct_sdna(srna, "Scene");
2719 RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
2721 func= RNA_def_function(srna, "link", "rna_Scene_object_link");
2722 RNA_def_function_ui_description(func, "Link object to scene.");
2723 RNA_def_function_flag(func, FUNC_USE_REPORTS);
2724 parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
2725 RNA_def_property_flag(parm, PROP_REQUIRED);
2726 parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
2727 RNA_def_function_return(func, parm);
2729 func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
2730 RNA_def_function_ui_description(func, "Unlink object from scene.");
2731 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
2732 parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
2733 RNA_def_property_flag(parm, PROP_REQUIRED);
2735 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2736 RNA_def_property_struct_type(prop, "Object");
2737 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL);
2738 RNA_def_property_flag(prop, PROP_EDITABLE);
2739 RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene");
2740 /* Could call: ED_base_object_activate(C, scene->basact);
2741 * but would be a bad level call and it seems the notifier is enough */
2742 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
2747 static void rna_def_scene_bases(BlenderRNA *brna, PropertyRNA *cprop)
2752 // FunctionRNA *func;
2753 // PropertyRNA *parm;
2755 RNA_def_property_srna(cprop, "SceneBases");
2756 srna= RNA_def_struct(brna, "SceneBases", NULL);
2757 RNA_def_struct_sdna(srna, "Scene");
2758 RNA_def_struct_ui_text(srna, "Scene Bases", "Collection of scene bases");
2760 prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2761 RNA_def_property_struct_type(prop, "ObjectBase");
2762 RNA_def_property_pointer_sdna(prop, NULL, "basact");
2763 RNA_def_property_flag(prop, PROP_EDITABLE);
2764 RNA_def_property_ui_text(prop, "Active Base", "Active object base in the scene");
2765 RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
2768 /* scene.timeline_markers */
2769 static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
2776 RNA_def_property_srna(cprop, "TimelineMarkers");
2777 srna= RNA_def_struct(brna, "TimelineMarkers", NULL);
2778 RNA_def_struct_sdna(srna, "Scene");
2779 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
2781 func= RNA_def_function(srna, "add", "rna_TimeLine_add");
2782 RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
2783 parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
2784 RNA_def_property_flag(parm, PROP_REQUIRED);
2786 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
2787 RNA_def_function_return(func, parm);
2790 func= RNA_def_function(srna, "remove", "rna_TimeLine_remove");
2791 RNA_def_function_ui_description(func, "Remove a timeline marker.");
2792 RNA_def_function_flag(func, FUNC_USE_REPORTS);
2793 parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
2794 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
2797 void RNA_def_scene(BlenderRNA *brna)
2803 static EnumPropertyItem audio_distance_model_items[] = {
2804 {0, "NONE", 0, "None", "No distance attenuation"},
2805 {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
2806 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
2807 {3, "LINEAR", 0, "Linear", "Linear distance model"},
2808 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
2809 {5, "EXPONENT", 0, "Exponent", "Exponent distance model"},
2810 {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping"},
2811 {0, NULL, 0, NULL, NULL}};
2813 static EnumPropertyItem sync_mode_items[] = {
2814 {0, "NONE", 0, "No Sync", "Do not sync, play every frame"},
2815 {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
2816 {AUDIO_SYNC, "AUDIO_SYNC", 0, "AV-sync", "Sync to audio playback, dropping frames"},
2817 {0, NULL, 0, NULL, NULL}};
2819 /* Struct definition */
2820 srna= RNA_def_struct(brna, "Scene", "ID");
2821 RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings");
2822 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
2823 RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
2825 /* Global Settings */
2826 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
2827 RNA_def_property_flag(prop, PROP_EDITABLE);
2828 RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene");
2829 RNA_def_property_update(prop, NC_SCENE, NULL);
2831 prop= RNA_def_property(srna, "set", PROP_POINTER, PROP_NONE);
2832 RNA_def_property_pointer_sdna(prop, NULL, "set");
2833 RNA_def_property_struct_type(prop, "Scene");
2834 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2835 RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL);
2836 RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
2837 RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
2839 prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
2840 RNA_def_property_flag(prop, PROP_EDITABLE);
2841 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
2842 RNA_def_property_update(prop, NC_SCENE|NC_WORLD, NULL);
2844 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ|PROP_UNIT_LENGTH);
2845 RNA_def_property_float_sdna(prop, NULL, "cursor");
2846 RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location");
2847 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
2848 RNA_def_property_update(prop, NC_WINDOW, NULL);
2851 prop= RNA_def_property(srna, "bases", PROP_COLLECTION, PROP_NONE);
2852 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
2853 RNA_def_property_struct_type(prop, "ObjectBase");
2854 RNA_def_property_ui_text(prop, "Bases", "");
2855 rna_def_scene_bases(brna, prop);
2857 prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
2858 RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
2859 RNA_def_property_struct_type(prop, "Object");
2860 RNA_def_property_ui_text(prop, "Objects", "");
2861 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0);
2862 rna_def_scene_objects(brna, prop);
2865 prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
2866 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
2867 RNA_def_property_array(prop, 20);
2868 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
2869 RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene");
2870 RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_layer_update");
2872 /* Frame Range Stuff */
2873 prop= RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
2874 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2875 RNA_def_property_int_sdna(prop, NULL, "r.cfra");
2876 RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
2877 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL);
2878 RNA_def_property_ui_text(prop, "Current Frame", "");
2879 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
2880 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
2882 prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
2883 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2884 RNA_def_property_int_sdna(prop, NULL, "r.sfra");
2885 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
2886 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
2887 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
2888 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
2890 prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
2891 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2892 RNA_def_property_int_sdna(prop, NULL, "r.efra");
2893 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
2894 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
2895 RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
2896 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
2898 prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
2899 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2900 RNA_def_property_int_sdna(prop, NULL, "r.frame_step");
2901 RNA_def_property_range(prop, 0, MAXFRAME);
2902 RNA_def_property_ui_range(prop, 1, 100, 1, 0);
2903 RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
2904 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
2906 /* Preview Range (frame-range for UI playback) */
2907 prop=RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
2908 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2909 RNA_def_property_boolean_sdna(prop, NULL, "r.flag", SCER_PRV_RANGE);
2910 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_preview_range_set");
2911 RNA_def_property_ui_text(prop, "Use Preview Range", "");
2912 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
2914 prop= RNA_def_property(srna, "preview_range_frame_start", PROP_INT, PROP_TIME);
2915 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2916 RNA_def_property_int_sdna(prop, NULL, "r.psfra");
2917 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
2918 RNA_def_property_ui_text(prop, "Preview Range Start Frame", "");
2919 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
2921 prop= RNA_def_property(srna, "preview_range_frame_end", PROP_INT, PROP_TIME);
2922 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2923 RNA_def_property_int_sdna(prop, NULL, "r.pefra");
2924 RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
2925 RNA_def_property_ui_text(prop, "Preview Range End Frame", "");
2926 RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
2929 prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
2930 RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
2931 RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping");
2932 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2934 /* Animation Data (for Scene) */
2935 rna_def_animdata_common(srna);
2937 /* Readonly Properties */
2938 prop= RNA_def_property(srna, "nla_tweakmode_on", PROP_BOOLEAN, PROP_NONE);
2939 RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_NLA_EDIT_ON);
2940 RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
2941 RNA_def_property_ui_text(prop, "NLA TweakMode", "Indicates whether there is any action referenced by NLA being edited. Strictly read-only");
2942 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2944 /* Frame dropping flag for playback and sync enum */
2945 prop= RNA_def_property(srna, "frame_drop", PROP_BOOLEAN, PROP_NONE);
2946 RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_FRAME_DROP);
2947 RNA_def_property_ui_text(prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
2948 RNA_def_property_update(prop, NC_SCENE, NULL);
2950 prop= RNA_def_property(srna, "sync_mode", PROP_ENUM, PROP_NONE);
2951 RNA_def_property_enum_funcs(prop, "rna_Scene_sync_mode_get", "rna_Scene_sync_mode_set", NULL);
2952 RNA_def_property_enum_items(prop, sync_mode_items);
2953 RNA_def_property_ui_text(prop, "Sync Mode", "How to sync playback");
2954 RNA_def_property_update(prop, NC_SCENE, NULL);
2957 /* Nodes (Compositing) */
2958 prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
2959 RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree");
2961 prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
2962 RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
2963 RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_nodes_set");
2964 RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree");
2965 RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
2968 prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
2969 RNA_def_property_pointer_sdna(prop, NULL, "ed");
2970 RNA_def_property_struct_type(prop, "SequenceEditor");
2971 RNA_def_property_ui_text(prop, "Sequence Editor", "");
2974 prop= RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
2975 RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
2976 RNA_def_property_struct_type(prop, "KeyingSet");
2977 RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene");
2978 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2980 prop= RNA_def_property(srna, "all_keying_sets", PROP_COLLECTION, PROP_NONE);
2981 RNA_def_property_collection_funcs(prop, "rna_Scene_all_keyingsets_begin", "rna_Scene_all_keyingsets_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
2982 RNA_def_property_struct_type(prop, "KeyingSet");
2983 RNA_def_property_ui_text(prop, "All Keying Sets", "All Keying Sets available for use (builtins and Absolute Keying Sets for this Scene)");
2984 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2986 prop= RNA_def_property(srna, "active_keying_set", PROP_POINTER, PROP_NONE);
2987 RNA_def_property_struct_type(prop, "KeyingSet");
2988 RNA_def_property_flag(prop, PROP_EDITABLE);
2989 RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL);
2990 RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
2991 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
2993 prop= RNA_def_property(srna, "active_keying_set_index", PROP_INT, PROP_NONE);
2994 RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
2995 //RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Scene_active_keying_set_index_range"); // XXX
2996 RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
2997 RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
3000 prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
3001 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3002 RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
3003 RNA_def_property_struct_type(prop, "ToolSettings");
3004 RNA_def_property_ui_text(prop, "Tool Settings", "");
3007 prop= RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
3008 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3009 RNA_def_property_pointer_sdna(prop, NULL, "unit");
3010 RNA_def_property_struct_type(prop, "UnitSettings");
3011 RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
3013 /* Physics Settings */
3014 prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
3015 RNA_def_property_float_sdna(prop, NULL, "physics_settings.gravity");
3016 RNA_def_property_array(prop, 3);
3017 RNA_def_property_range(prop, -200.0f, 200.0f);
3018 RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
3019 RNA_def_property_update(prop, 0, "rna_Physics_update");
3021 prop= RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
3022 RNA_def_property_boolean_sdna(prop, NULL, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
3023 RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics");
3024 RNA_def_property_update(prop, 0, "rna_Physics_update");
3027 prop= RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
3028 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3029 RNA_def_property_pointer_sdna(prop, NULL, "r");
3030 RNA_def_property_struct_type(prop, "RenderSettings");
3031 RNA_def_property_ui_text(prop, "Render Data", "");
3034 prop= RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
3035 RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
3036 RNA_def_property_struct_type(prop, "TimelineMarker");
3037 RNA_def_property_ui_text(prop, "Timeline Markers", "Markers used in all timelines for the current scene");
3038 rna_def_timeline_markers(brna, prop);
3040 /* Audio Settings */
3041 prop= RNA_def_property(srna, "mute_audio", PROP_BOOLEAN, PROP_NONE);
3042 RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_MUTE);
3043 RNA_def_property_ui_text(prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted");
3044 RNA_def_property_update(prop, NC_SCENE, NULL);
3046 prop= RNA_def_property(srna, "sync_audio", PROP_BOOLEAN, PROP_NONE);
3047 RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
3048 RNA_def_property_ui_text(prop, "Audio Sync", "Play back and sync with audio clock, dropping frames if frame display is too slow");
3049 RNA_def_property_update(prop, NC_SCENE, NULL);
3051 prop= RNA_def_property(srna, "scrub_audio", PROP_BOOLEAN, PROP_NONE);
3052 RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SCRUB);
3053 RNA_def_property_ui_text(prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing");
3054 RNA_def_property_update(prop, NC_SCENE, NULL);
3056 prop= RNA_def_property(srna, "speed_of_sound", PROP_FLOAT, PROP_NONE);
3057 RNA_def_property_float_sdna(prop, NULL, "audio.speed_of_sound");
3058 RNA_def_property_range(prop, 0.01f, FLT_MAX);
3059 RNA_def_property_ui_text(prop, "Speed of Sound", "Speed of sound for doppler effect calculation");
3060 RNA_def_property_update(prop, NC_SCENE, NULL);
3062 prop= RNA_def_property(srna, "doppler_factor", PROP_FLOAT, PROP_NONE);
3063 RNA_def_property_float_sdna(prop, NULL, "audio.doppler_factor");
3064 RNA_def_property_range(prop, 0.0, FLT_MAX);
3065 RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for doppler effect calculation");
3066 RNA_def_property_update(prop, NC_SCENE, NULL);
3068 prop= RNA_def_property(srna, "distance_model", PROP_ENUM, PROP_NONE);
3069 RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio.distance_model");
3070 RNA_def_property_enum_items(prop, audio_distance_model_items);
3071 RNA_def_property_ui_text(prop, "Distance Model", "Distance model for distance attenuation calculation");
3072 RNA_def_property_update(prop, NC_SCENE, NULL);
3075 prop= RNA_def_property(srna, "game_data", PROP_POINTER, PROP_NONE);
3076 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3077 RNA_def_property_pointer_sdna(prop, NULL, "gm");
3078 RNA_def_property_struct_type(prop, "SceneGameData");
3079 RNA_def_property_ui_text(prop, "Game Data", "");
3082 func= RNA_def_function(srna, "statistics", "ED_info_stats_string");
3083 prop= RNA_def_string(func, "statistics", "", 0, "Statistics", "");
3084 RNA_def_function_return(func, prop);
3087 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
3088 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
3089 RNA_def_property_flag(prop, PROP_EDITABLE);
3090 RNA_def_property_struct_type(prop, "GreasePencil");
3091 RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock");
3093 /* Transform Orientations */
3094 prop= RNA_def_property(srna, "orientations", PROP_COLLECTION, PROP_NONE);
3095 RNA_def_property_collection_sdna(prop, NULL, "transform_spaces", NULL);
3096 RNA_def_property_struct_type(prop, "TransformOrientation");
3097 RNA_def_property_ui_text(prop, "Transform Orientations", "");
3100 rna_def_tool_settings(brna);
3101 rna_def_unit_settings(brna);
3102 rna_def_scene_render_data(brna);
3103 rna_def_scene_game_data(brna);
3104 rna_def_scene_render_layer(brna);
3105 rna_def_transform_orientation(brna);
3108 RNA_api_scene(srna);