Blender  V2.59
rna_scene.c
Go to the documentation of this file.
00001 /*
00002  * $Id: rna_scene.c 39084 2011-08-05 20:45:26Z blendix $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * Contributor(s): Blender Foundation (2008).
00021  *
00022  * ***** END GPL LICENSE BLOCK *****
00023  */
00024 
00030 #include <stdlib.h>
00031 
00032 #include "RNA_define.h"
00033 #include "RNA_enum_types.h"
00034 
00035 #include "rna_internal.h"
00036 
00037 #include "DNA_group_types.h"
00038 #include "DNA_modifier_types.h"
00039 #include "DNA_particle_types.h"
00040 #include "DNA_scene_types.h"
00041 #include "DNA_userdef_types.h"
00042 
00043 /* Include for Bake Options */
00044 #include "RE_pipeline.h"
00045 
00046 #ifdef WITH_QUICKTIME
00047 #include "quicktime_export.h"
00048 #  ifdef WITH_AUDASPACE
00049 #    include "AUD_C-API.h"
00050 #  endif
00051 #endif
00052 
00053 #ifdef WITH_FFMPEG
00054 #include "BKE_writeffmpeg.h"
00055 #include <libavcodec/avcodec.h> 
00056 #include <libavformat/avformat.h>
00057 #endif
00058 
00059 #include "WM_api.h"
00060 #include "WM_types.h"
00061 
00062 #include "BLI_threads.h"
00063 
00064 EnumPropertyItem snap_target_items[] = {
00065         {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
00066         {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target"},
00067         {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
00068         {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
00069         {0, NULL, 0, NULL, NULL}};
00070         
00071 EnumPropertyItem proportional_falloff_items[] ={
00072         {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
00073         {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
00074         {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
00075         {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
00076         {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
00077         {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", "Consant falloff"},
00078         {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", "Random falloff"},
00079         {0, NULL, 0, NULL, NULL}};
00080 
00081 
00082 EnumPropertyItem proportional_editing_items[] = {
00083         {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"},
00084         {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"},
00085         {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", "Proportional Editing using connected geometry only"},
00086         {0, NULL, 0, NULL, NULL}};
00087 
00088 /* keep for operators, not used here */
00089 EnumPropertyItem mesh_select_mode_items[] = {
00090         {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
00091         {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
00092         {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
00093         {0, NULL, 0, NULL, NULL}};
00094 
00095 EnumPropertyItem snap_element_items[] = {
00096         {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid"},
00097         {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
00098         {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"},
00099         {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces"},
00100         {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"},
00101         {0, NULL, 0, NULL, NULL}};
00102 
00103 EnumPropertyItem image_type_items[] = {
00104         {0, "", 0, "Image", NULL},
00105         {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"},
00106 #ifdef WITH_DDS
00107         {R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"},
00108 #endif
00109         {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in (old!) SGI IRIS format"},
00110         {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"},
00111         {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"},
00112 #ifdef WITH_OPENJPEG
00113         {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", "Output image in JPEG 2000 format"},
00114 #endif
00115         {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"},
00116         {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", "Output image in uncompressed Targa format"},
00117         {0, "", 0, " ", NULL},
00118 #ifdef WITH_CINEON
00119         {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"},
00120         {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", "Output image in DPX format"},
00121 #endif
00122 #ifdef WITH_OPENEXR
00123         {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", "Output image in multilayer OpenEXR format"},
00124         {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", "Output image in OpenEXR format"},
00125 #endif
00126 #ifdef WITH_HDR
00127         {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", "Output image in Radiance HDR format"},
00128 #endif
00129 #ifdef WITH_TIFF
00130         {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"},
00131 #endif
00132         {0, "", 0, "Movie", NULL},
00133 #ifdef _WIN32
00134         {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", "Output video in AVI format"}, // XXX Missing codec menu
00135 #endif
00136         {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", "Output video in AVI JPEG format"},
00137         {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", "Output video in AVI Raw format"},
00138 #ifdef WITH_FRAMESERVER
00139         {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", "Output image to a frameserver"},
00140 #endif
00141 #ifdef WITH_FFMPEG
00142         {R_H264, "H264", ICON_FILE_MOVIE, "H.264", "Output video in H.264 format"},
00143         {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", "Output video in MPEG format"},
00144         {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", "Output video in Ogg format"},
00145 #endif
00146 #ifdef WITH_QUICKTIME
00147 #       ifdef USE_QTKIT
00148         {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"},
00149 #       else
00150         {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"},
00151 #       endif
00152 #endif
00153 #ifdef WITH_FFMPEG
00154         {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", "Output video in Xvid format"},
00155 #endif
00156         {0, NULL, 0, NULL, NULL}};
00157 
00158 #ifdef RNA_RUNTIME
00159 
00160 #include "DNA_anim_types.h"
00161 #include "DNA_node_types.h"
00162 #include "DNA_object_types.h"
00163 #include "DNA_mesh_types.h"
00164 
00165 #include "RNA_access.h"
00166 
00167 #include "MEM_guardedalloc.h"
00168 
00169 #include "BLI_threads.h"
00170 #include "BLI_editVert.h"
00171 #include "BLI_blenlib.h"
00172 
00173 #include "BKE_context.h"
00174 #include "BKE_global.h"
00175 #include "BKE_image.h"
00176 #include "BKE_main.h"
00177 #include "BKE_node.h"
00178 #include "BKE_pointcache.h"
00179 #include "BKE_scene.h"
00180 #include "BKE_depsgraph.h"
00181 #include "BKE_image.h"
00182 #include "BKE_mesh.h"
00183 #include "BKE_sound.h"
00184 #include "BKE_screen.h"
00185 #include "BKE_animsys.h"
00186 
00187 #include "WM_api.h"
00188 
00189 #include "ED_info.h"
00190 #include "ED_node.h"
00191 #include "ED_view3d.h"
00192 #include "ED_mesh.h"
00193 #include "ED_keyframing.h"
00194 
00195 #include "RE_pipeline.h"
00196 
00197 static int rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
00198 {
00199         Scene *scene= (Scene*)ptr->data;
00200         Base *base;
00201 
00202         for(base= scene->base.first; base; base= base->next) {
00203                 if(strncmp(base->object->id.name+2, key, sizeof(base->object->id.name)-2)==0) {
00204                         *r_ptr= rna_pointer_inherit_refine(ptr, &RNA_ObjectBase, base);
00205                         return TRUE;
00206                 }
00207         }
00208 
00209         return FALSE;
00210 }
00211 
00212 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
00213 {
00214         ListBaseIterator *internal= iter->internal;
00215 
00216         /* we are actually iterating a Base list, so override get */
00217         return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
00218 }
00219 
00220 static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
00221 {
00222         Scene *scene_act= CTX_data_scene(C);
00223         Base *base;
00224 
00225         if (object_in_scene(ob, scene)) {
00226                 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
00227                 return NULL;
00228         }
00229 
00230         base= scene_add_base(scene, ob);
00231         id_us_plus(&ob->id);
00232 
00233         /* this is similar to what object_add_type and add_object do */
00234         base->lay= scene->lay;
00235 
00236         /* when linking to an inactive scene dont touch the layer */
00237         if(scene == scene_act)
00238                 ob->lay= base->lay;
00239 
00240         ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
00241 
00242         /* slows down importers too much, run scene.update() */
00243         /* DAG_scene_sort(G.main, scene); */
00244 
00245         WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
00246 
00247         return base;
00248 }
00249 
00250 static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
00251 {
00252         Base *base= object_in_scene(ob, scene);
00253         if (!base) {
00254                 BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'.", ob->id.name+2, scene->id.name+2);
00255                 return;
00256         }
00257         if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
00258                 BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink.", ob->id.name+2);
00259                 return;
00260         }
00261         if(scene->basact==base) {
00262                 scene->basact= NULL;
00263         }
00264 
00265         BLI_remlink(&scene->base, base);
00266         MEM_freeN(base);
00267 
00268         ob->id.us--;
00269 
00270         /* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
00271         DAG_scene_sort(G.main, scene);
00272         DAG_ids_flush_update(G.main, 0);
00273 
00274         WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
00275 }
00276 
00277 static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
00278 {
00279         ToolSettings *ts = (ToolSettings*)ptr->data;
00280         if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
00281                 ts->skgen_template = value.data;
00282         else
00283                 ts->skgen_template = NULL;
00284 }
00285 
00286 static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
00287 {
00288         Scene *scene= (Scene*)ptr->data;
00289         return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
00290 }
00291 
00292 static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
00293 {
00294         Scene *scene= (Scene*)ptr->data;
00295         if(value.data)
00296                 scene->basact= object_in_scene((Object*)value.data, scene);
00297         else
00298                 scene->basact= NULL;
00299 }
00300 
00301 static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
00302 {
00303         Scene *scene= (Scene*)ptr->data;
00304         Scene *set= (Scene*)value.data;
00305         Scene *nested_set;
00306 
00307         for(nested_set= set; nested_set; nested_set= nested_set->set) {
00308                 if(nested_set==scene)
00309                         return;
00310         }
00311 
00312         scene->set= set;
00313 }
00314 
00315 static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
00316 {
00317         Scene *scene= (Scene*)ptr->data;
00318 
00319         scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
00320 }
00321 
00322 static void rna_Scene_view3d_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr)
00323 {
00324         Scene *scene= (Scene*)ptr->data;
00325 
00326         BKE_screen_view3d_main_sync(&bmain->screen, scene);
00327 }
00328 
00329 static void rna_Scene_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00330 {
00331         rna_Scene_view3d_update(bmain, scene, ptr);
00332         DAG_on_visible_update(bmain, FALSE);
00333 }
00334 
00335 static void rna_Scene_framelen_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
00336 {       
00337         scene->r.framelen= (float)scene->r.framapto/(float)scene->r.images;
00338 }
00339 
00340 
00341 static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
00342 {
00343         Scene *data= (Scene*)ptr->data;
00344         
00345         /* if negative frames aren't allowed, then we can't use them */
00346         FRAMENUMBER_MIN_CLAMP(value);
00347         data->r.cfra= value;
00348 }
00349 
00350 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
00351 {
00352         Scene *data= (Scene*)ptr->data;
00353         /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
00354         CLAMP(value, MINFRAME, data->r.efra); 
00355         data->r.sfra= value;
00356 }
00357 
00358 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
00359 {
00360         Scene *data= (Scene*)ptr->data;
00361         CLAMP(value, data->r.sfra, MAXFRAME);
00362         data->r.efra= value;
00363 }
00364 
00365 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
00366 {
00367         Scene *data= (Scene*)ptr->data;
00368         
00369         if (value) {
00370                 /* copy range from scene if not set before */
00371                 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
00372                         data->r.psfra= data->r.sfra;
00373                         data->r.pefra= data->r.efra;
00374                 }
00375                 
00376                 data->r.flag |= SCER_PRV_RANGE;
00377         }
00378         else
00379                 data->r.flag &= ~SCER_PRV_RANGE;
00380 }
00381 
00382 
00383 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
00384 {
00385         Scene *data= (Scene*)ptr->data;
00386         
00387         /* check if enabled already */
00388         if ((data->r.flag & SCER_PRV_RANGE) == 0) {
00389                 /* set end of preview range to end frame, then clamp as per normal */
00390                 // TODO: or just refuse to set instead?
00391                 data->r.pefra= data->r.efra;
00392         }
00393         
00394         /* now set normally */
00395         CLAMP(value, MINAFRAME, data->r.pefra);
00396         data->r.psfra= value;
00397 }
00398 
00399 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
00400 {
00401         Scene *data= (Scene*)ptr->data;
00402         
00403         /* check if enabled already */
00404         if ((data->r.flag & SCER_PRV_RANGE) == 0) {
00405                 /* set start of preview range to start frame, then clamp as per normal */
00406                 // TODO: or just refuse to set instead?
00407                 data->r.psfra= data->r.sfra; 
00408         }
00409         
00410         /* now set normally */
00411         CLAMP(value, data->r.psfra, MAXFRAME);
00412         data->r.pefra= value;
00413 }
00414 
00415 static void rna_Scene_frame_update(bContext *C, PointerRNA *UNUSED(ptr))
00416 {
00417         //Scene *scene= ptr->id.data;
00418         //ED_update_for_newframe(C);
00419         sound_seek_scene(C);
00420 }
00421 
00422 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
00423 {
00424         Scene *scene= (Scene *)ptr->data;
00425         return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
00426 }
00427 
00428 static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
00429 {
00430         Scene *scene= (Scene *)ptr->data;
00431         KeyingSet *ks= (KeyingSet*)value.data;
00432         
00433         scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
00434 }
00435 
00436 /* get KeyingSet index stuff for list of Keying Sets editing UI
00437  *      - active_keyingset-1 since 0 is reserved for 'none'
00438  *      - don't clamp, otherwise can never set builtins types as active... 
00439  */
00440 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
00441 {
00442         Scene *scene= (Scene *)ptr->data;       
00443         return scene->active_keyingset-1;
00444 }
00445 
00446 /* get KeyingSet index stuff for list of Keying Sets editing UI
00447  *      - value+1 since 0 is reserved for 'none'
00448  */
00449 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value) 
00450 {
00451         Scene *scene= (Scene *)ptr->data; 
00452         scene->active_keyingset= value+1;        
00453 }
00454 
00455 // XXX: evil... builtin_keyingsets is defined in keyingsets.c!
00456 // TODO: make API function to retrieve this...
00457 extern ListBase builtin_keyingsets;
00458 
00459 static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
00460 {
00461         Scene *scene= (Scene*)ptr->data;
00462         
00463         /* start going over the scene KeyingSets first, while we still have pointer to it 
00464          * but only if we have any Keying Sets to use...
00465          */
00466         if (scene->keyingsets.first)
00467                 rna_iterator_listbase_begin(iter, &scene->keyingsets, NULL);
00468         else
00469                 rna_iterator_listbase_begin(iter, &builtin_keyingsets, NULL);
00470 }
00471 
00472 static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
00473 {
00474         ListBaseIterator *internal= iter->internal;
00475         KeyingSet *ks= (KeyingSet*)internal->link;
00476         
00477         /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
00478         if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
00479                 internal->link= (Link*)builtin_keyingsets.first;
00480         else
00481                 internal->link= (Link*)ks->next;
00482                 
00483         iter->valid= (internal->link != NULL);
00484 }
00485 
00486 
00487 static char *rna_RenderSettings_path(PointerRNA *UNUSED(ptr))
00488 {
00489         return BLI_sprintfN("render");
00490 }
00491 
00492 static int rna_RenderSettings_threads_get(PointerRNA *ptr)
00493 {
00494         RenderData *rd= (RenderData*)ptr->data;
00495 
00496         if(rd->mode & R_FIXED_THREADS)
00497                 return rd->threads;
00498         else
00499                 return BLI_system_thread_count();
00500 }
00501 
00502 static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
00503 {
00504         RenderData *rd= (RenderData*)ptr->data;
00505         return BKE_imtype_is_movie(rd->imtype);
00506 }
00507 
00508 static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
00509 {
00510         RenderData *rd= (RenderData*)ptr->data;
00511         if(rd->mode & R_BORDER)
00512                 return 0;
00513         else
00514                 return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
00515 }
00516 
00517 static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
00518 {
00519         RenderData *rd= (RenderData*)ptr->data;
00520 
00521         return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
00522 }
00523 
00524 static void rna_RenderSettings_file_format_set(PointerRNA *ptr, int value)
00525 {
00526         RenderData *rd= (RenderData*)ptr->data;
00527 
00528         rd->imtype= value;
00529 #ifdef WITH_FFMPEG
00530         ffmpeg_verify_image_type(rd);
00531 #endif
00532 #ifdef WITH_QUICKTIME
00533         quicktime_verify_image_type(rd);
00534 #endif
00535 }
00536 
00537 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
00538 {
00539         RenderData *rd= (RenderData*)ptr->data;
00540         char ext[8];
00541         ext[0]= '\0';
00542         BKE_add_image_extension(ext, rd->imtype);
00543         return strlen(ext);
00544 }
00545 
00546 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
00547 {
00548         RenderData *rd= (RenderData*)ptr->data;
00549         BKE_add_image_extension(str, rd->imtype);
00550 }
00551 
00552 void rna_RenderSettings_jpeg2k_preset_update(RenderData *rd)
00553 {
00554         rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
00555         
00556         switch(rd->jp2_depth) {
00557         case 8:         break;
00558         case 12:        rd->subimtype |= R_JPEG2K_12BIT; break;
00559         case 16:        rd->subimtype |= R_JPEG2K_16BIT; break;
00560         }
00561         
00562         switch(rd->jp2_preset) {
00563         case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET;                                          break;
00564         case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS;      break;
00565         case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET;                                          break;
00566         case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET;                                          break;
00567         case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS;      break;
00568         case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET;                                          break;
00569         case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS;      break;
00570         }
00571 }
00572 
00573 #ifdef WITH_OPENJPEG
00574 static void rna_RenderSettings_jpeg2k_preset_set(PointerRNA *ptr, int value)
00575 {
00576         RenderData *rd= (RenderData*)ptr->data;
00577         rd->jp2_preset= value;
00578         rna_RenderSettings_jpeg2k_preset_update(rd);
00579 }
00580 
00581 static void rna_RenderSettings_jpeg2k_depth_set(PointerRNA *ptr, int value)
00582 {
00583         RenderData *rd= (RenderData*)ptr->data;
00584         rd->jp2_depth= value;
00585         rna_RenderSettings_jpeg2k_preset_update(rd);
00586 }
00587 #endif
00588 
00589 #ifdef WITH_QUICKTIME
00590 static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
00591 {
00592         RenderData *rd= (RenderData*)ptr->data;
00593         
00594         return quicktime_rnatmpvalue_from_videocodectype(rd->qtcodecsettings.codecType);
00595 }
00596 
00597 static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
00598 {
00599         RenderData *rd= (RenderData*)ptr->data;
00600 
00601         rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
00602 }
00603 
00604 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
00605 {
00606         EnumPropertyItem *item= NULL;
00607         EnumPropertyItem tmp = {0, "", 0, "", ""};
00608         QuicktimeCodecTypeDesc *codecTypeDesc;
00609         int i=1, totitem= 0;
00610         char id[5];
00611         
00612         for(i=0;i<quicktime_get_num_videocodecs();i++) {
00613                 codecTypeDesc = quicktime_get_videocodecType_desc(i);
00614                 if (!codecTypeDesc) break;
00615                 
00616                 tmp.value= codecTypeDesc->rnatmpvalue;
00617                 *((int*)id) = codecTypeDesc->codecType;
00618                 id[4] = 0;
00619                 tmp.identifier= id; 
00620                 tmp.name= codecTypeDesc->codecName;
00621                 RNA_enum_item_add(&item, &totitem, &tmp);
00622         }
00623         
00624         RNA_enum_item_end(&item, &totitem);
00625         *free= 1;
00626         
00627         return item;    
00628 }
00629 
00630 #ifdef USE_QTKIT
00631 static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
00632 {
00633         RenderData *rd= (RenderData*)ptr->data;
00634         
00635         return quicktime_rnatmpvalue_from_audiocodectype(rd->qtcodecsettings.audiocodecType);
00636 }
00637 
00638 static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
00639 {
00640         RenderData *rd= (RenderData*)ptr->data;
00641         
00642         rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
00643 }
00644 
00645 static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
00646 {
00647         EnumPropertyItem *item= NULL;
00648         EnumPropertyItem tmp = {0, "", 0, "", ""};
00649         QuicktimeCodecTypeDesc *codecTypeDesc;
00650         int i=1, totitem= 0;
00651         
00652         for(i=0;i<quicktime_get_num_audiocodecs();i++) {
00653                 codecTypeDesc = quicktime_get_audiocodecType_desc(i);
00654                 if (!codecTypeDesc) break;
00655                 
00656                 tmp.value= codecTypeDesc->rnatmpvalue;
00657                 tmp.identifier= codecTypeDesc->codecName; 
00658                 tmp.name= codecTypeDesc->codecName;
00659                 RNA_enum_item_add(&item, &totitem, &tmp);
00660         }
00661         
00662         RNA_enum_item_end(&item, &totitem);
00663         *free= 1;
00664         
00665         return item;    
00666 }       
00667 #endif
00668 #endif
00669 
00670 static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
00671 {
00672         RenderData *rd= (RenderData*)ptr->data;
00673         return rd->actlay;
00674 }
00675 
00676 static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
00677 {
00678         RenderData *rd= (RenderData*)ptr->data;
00679         rd->actlay= value;
00680 }
00681 
00682 static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
00683 {
00684         RenderData *rd= (RenderData*)ptr->data;
00685 
00686         *min= 0;
00687         *max= BLI_countlist(&rd->layers)-1;
00688         *max= MAX2(0, *max);
00689 }
00690 
00691 static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
00692 {
00693         RenderData *rd= (RenderData*)ptr->data;
00694         SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
00695         
00696         return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
00697 }
00698 
00699 static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
00700 {
00701         RenderData *rd= (RenderData*)ptr->data;
00702         SceneRenderLayer *srl= (SceneRenderLayer*)value.data;
00703         
00704         rd->actlay = BLI_findindex(&rd->layers, srl);
00705 }
00706 
00707 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
00708 {
00709         RenderData *rd= (RenderData*)ptr->data;
00710         RenderEngineType *type= BLI_findlink(&R_engines, value);
00711 
00712         if(type)
00713                 BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
00714 }
00715 
00716 static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
00717 {
00718         RenderEngineType *type;
00719         EnumPropertyItem *item= NULL;
00720         EnumPropertyItem tmp = {0, "", 0, "", ""};
00721         int a=0, totitem= 0;
00722 
00723         for(type=R_engines.first; type; type=type->next, a++) {
00724                 tmp.value= a;
00725                 tmp.identifier= type->idname;
00726                 tmp.name= type->name;
00727                 RNA_enum_item_add(&item, &totitem, &tmp);
00728         }
00729         
00730         RNA_enum_item_end(&item, &totitem);
00731         *free= 1;
00732 
00733         return item;
00734 }
00735 
00736 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
00737 {
00738         RenderData *rd= (RenderData*)ptr->data;
00739         RenderEngineType *type;
00740         int a= 0;
00741 
00742         for(type=R_engines.first; type; type=type->next, a++)
00743                 if(strcmp(type->idname, rd->engine) == 0)
00744                         return a;
00745         
00746         return 0;
00747 }
00748 
00749 static void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00750 {
00751         Scene *scene= (Scene*)ptr->id.data;
00752 
00753         DAG_id_tag_update(&scene->id, 0);
00754 }
00755 
00756 static void rna_RenderSettings_color_management_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
00757 {
00758         /* reset image nodes */
00759         Scene *scene= (Scene*)ptr->id.data;
00760         bNodeTree *ntree=scene->nodetree;
00761         bNode *node;
00762         
00763         if(ntree && scene->use_nodes) {
00764                 /* XXX images are freed here, stop render and preview threads, until Image is threadsafe */
00765                 WM_jobs_stop_all(bmain->wm.first);
00766                 
00767                 for (node=ntree->nodes.first; node; node=node->next) {
00768                         if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
00769                                 ED_node_changed_update(&scene->id, node);
00770                                 WM_main_add_notifier(NC_NODE|NA_EDITED, node);
00771                                 
00772                                 if (node->type == CMP_NODE_IMAGE)
00773                                         BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD);
00774                         }
00775                 }
00776         }
00777 
00778         rna_Scene_glsl_update(bmain, scene, ptr);
00779 }
00780 
00781 static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
00782 {
00783         Scene *scene= (Scene*)ptr->id.data;
00784         SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
00785 
00786         BLI_strncpy(rl->name, value, sizeof(rl->name));
00787 
00788         if(scene->nodetree) {
00789                 bNode *node;
00790                 int index= BLI_findindex(&scene->r.layers, rl);
00791 
00792                 for(node= scene->nodetree->nodes.first; node; node= node->next) {
00793                         if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
00794                                 if(node->custom1==index)
00795                                         BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
00796                         }
00797                 }
00798         }
00799 }
00800 
00801 static int rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr))
00802 {
00803         return (BLI_countlist(&R_engines) > 1);
00804 }
00805 
00806 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
00807 {
00808         RenderData *rd= (RenderData*)ptr->data;
00809         RenderEngineType *type;
00810 
00811         for(type=R_engines.first; type; type=type->next)
00812                 if(strcmp(type->idname, rd->engine) == 0)
00813                         return (type->flag & RE_GAME);
00814         
00815         return 0;
00816 }
00817 
00818 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
00819 {
00820         SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
00821         rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL);
00822 }
00823 
00824 static void rna_SceneRenderLayer_pass_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00825 {
00826         Scene *scene= (Scene*)ptr->id.data;
00827 
00828         if(scene->nodetree)
00829                 ntreeCompositForceHidden(scene->nodetree, scene);
00830 }
00831 
00832 static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
00833 {
00834         Scene *scene= (Scene*)ptr->data;
00835 
00836         scene->use_nodes= value;
00837         if(scene->use_nodes && scene->nodetree==NULL)
00838                 ED_node_composit_default(scene);
00839 }
00840 
00841 static void rna_Physics_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00842 {
00843         Scene *scene= (Scene*)ptr->id.data;
00844         Base *base;
00845 
00846         for(base = scene->base.first; base; base=base->next)
00847                 BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
00848 }
00849 
00850 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
00851 {
00852         Scene *scene= (Scene*)ptr->id.data;
00853         ToolSettings *ts = (ToolSettings*)ptr->data;
00854         int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
00855 
00856         if(flag) {
00857                 ts->selectmode = flag;
00858 
00859                 if(scene->basact) {
00860                         Mesh *me= get_mesh(scene->basact->object);
00861                         if(me && me->edit_mesh && me->edit_mesh->selectmode != flag) {
00862                                 me->edit_mesh->selectmode= flag;
00863                                 EM_selectmode_set(me->edit_mesh);
00864                         }
00865                 }
00866         }
00867 }
00868 
00869 static void rna_Scene_editmesh_select_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
00870 {
00871         Mesh *me= NULL;
00872 
00873         if(scene->basact) {
00874                 me= get_mesh(scene->basact->object);
00875                 if(me && me->edit_mesh==NULL)
00876                         me= NULL;
00877         }
00878 
00879         WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
00880         WM_main_add_notifier(NC_SCENE|ND_TOOLSETTINGS, NULL);
00881 }
00882 
00883 static void object_simplify_update(Object *ob)
00884 {
00885         ModifierData *md;
00886         ParticleSystem *psys;
00887 
00888         for(md=ob->modifiers.first; md; md=md->next)
00889                 if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
00890                         ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
00891 
00892         for(psys=ob->particlesystem.first; psys; psys=psys->next)
00893                 psys->recalc |= PSYS_RECALC_CHILD;
00894         
00895         if(ob->dup_group) {
00896                 GroupObject *gob;
00897 
00898                 for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
00899                         object_simplify_update(gob->ob);
00900         }
00901 }
00902 
00903 static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
00904 {
00905         Scene *sce_iter;
00906         Base *base;
00907 
00908         for(SETLOOPER(scene, sce_iter, base))
00909                 object_simplify_update(base->object);
00910         
00911         DAG_ids_flush_update(bmain, 0);
00912         WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
00913 }
00914 
00915 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00916 {
00917         if(scene->r.mode & R_SIMPLIFY)
00918                 rna_Scene_use_simplify_update(bmain, scene, ptr);
00919 }
00920 
00921 static int rna_Scene_use_audio_get(PointerRNA *ptr)
00922 {
00923         Scene *scene= (Scene*)ptr->data;
00924         return scene->audio.flag & AUDIO_MUTE;
00925 }
00926 
00927 static void rna_Scene_use_audio_set(PointerRNA *ptr, int value)
00928 {
00929         Scene *scene= (Scene*)ptr->data;
00930 
00931         if(value)
00932                 scene->audio.flag |= AUDIO_MUTE;
00933         else
00934                 scene->audio.flag &= ~AUDIO_MUTE;
00935 
00936         sound_mute_scene(scene, value);
00937 }
00938 
00939 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
00940 {
00941         Scene *scene= (Scene*)ptr->data;
00942         if(scene->audio.flag & AUDIO_SYNC)
00943                 return AUDIO_SYNC;
00944         return scene->flag & SCE_FRAME_DROP;
00945 }
00946 
00947 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
00948 {
00949         Scene *scene= (Scene*)ptr->data;
00950 
00951         if(value == AUDIO_SYNC)
00952                 scene->audio.flag |= AUDIO_SYNC;
00953         else if(value == SCE_FRAME_DROP)
00954         {
00955                 scene->audio.flag &= ~AUDIO_SYNC;
00956                 scene->flag |= SCE_FRAME_DROP;
00957         }
00958         else
00959         {
00960                 scene->audio.flag &= ~AUDIO_SYNC;
00961                 scene->flag &= ~SCE_FRAME_DROP;
00962         }
00963 }
00964 
00965 static int rna_GameSettings_auto_start_get(PointerRNA *UNUSED(ptr))
00966 {
00967         if (G.fileflags & G_FILE_AUTOPLAY)
00968                 return 1;
00969 
00970         return 0;
00971 }
00972 
00973 static void rna_GameSettings_auto_start_set(PointerRNA *UNUSED(ptr), int value)
00974 {
00975         if(value)
00976                 G.fileflags |= G_FILE_AUTOPLAY;
00977         else
00978                 G.fileflags &= ~G_FILE_AUTOPLAY;
00979 }
00980 
00981 
00982 static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[])
00983 {
00984         TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
00985         marker->flag= SELECT;
00986         marker->frame= 1;
00987         BLI_strncpy(marker->name, name, sizeof(marker->name));
00988         BLI_addtail(&scene->markers, marker);
00989         return marker;
00990 }
00991 
00992 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker)
00993 {
00994         /* try to remove the F-Curve from the action */
00995         if (!BLI_remlink_safe(&scene->markers, marker)) {
00996                 BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in action '%s'", marker->name, scene->id.name+2);
00997                 return;
00998         }
00999 
01000         /* XXX, invalidates PyObject */
01001         MEM_freeN(marker);
01002 }
01003 
01004 static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, const char name[])
01005 {
01006         KeyingSet *ks= NULL;
01007 
01008         /* call the API func, and set the active keyingset index */
01009         ks= BKE_keyingset_add(&sce->keyingsets, name, KEYINGSET_ABSOLUTE, 0);
01010         
01011         if (ks) {
01012                 sce->active_keyingset= BLI_countlist(&sce->keyingsets);
01013                 return ks;
01014         }
01015         else {
01016                 BKE_report(reports, RPT_ERROR, "Keying Set could not be added.");
01017                 return NULL;
01018         }
01019 }
01020 
01021 #else
01022 
01023 static void rna_def_transform_orientation(BlenderRNA *brna)
01024 {
01025         StructRNA *srna;
01026         PropertyRNA *prop;
01027 
01028         const int matrix_dimsize[]= {3, 3};
01029         
01030         srna= RNA_def_struct(brna, "TransformOrientation", NULL);
01031         
01032         prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
01033         RNA_def_property_float_sdna(prop, NULL, "mat");
01034         RNA_def_property_multi_array(prop, 2, matrix_dimsize);
01035         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01036         
01037         prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
01038         RNA_def_property_string_sdna(prop, NULL, "name");
01039         RNA_def_struct_name_property(srna, prop);
01040         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01041 }
01042 
01043 static void rna_def_tool_settings(BlenderRNA  *brna)
01044 {
01045         StructRNA *srna;
01046         PropertyRNA *prop;
01047 
01048         static EnumPropertyItem uv_select_mode_items[] = {
01049                 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
01050                 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
01051                 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
01052                 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
01053                 {0, NULL, 0, NULL, NULL}};
01054 
01055         static EnumPropertyItem auto_key_items[] = {
01056                 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
01057                 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
01058                 {0, NULL, 0, NULL, NULL}};
01059 
01060         static EnumPropertyItem retarget_roll_items[] = {
01061                 {SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
01062                 {SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
01063                 {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
01064                 {0, NULL, 0, NULL, NULL}};
01065         
01066         static EnumPropertyItem sketch_convert_items[] = {
01067                 {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
01068                 {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
01069                 {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts"},
01070                 {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
01071                 {0, NULL, 0, NULL, NULL}};
01072 
01073         static EnumPropertyItem edge_tag_items[] = {
01074                 {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
01075                 {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
01076                 {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
01077                 {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
01078                 {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
01079                 {0, NULL, 0, NULL, NULL}};
01080 
01081         srna= RNA_def_struct(brna, "ToolSettings", NULL);
01082         RNA_def_struct_ui_text(srna, "Tool Settings", "");
01083         
01084         prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
01085         RNA_def_property_struct_type(prop, "Sculpt");
01086         RNA_def_property_ui_text(prop, "Sculpt", "");
01087         
01088         prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
01089         RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
01090         RNA_def_property_ui_text(prop, "WPaint Auto-Normalize", 
01091                 "Ensure all bone-deforming vertex groups add up to 1.0 while "
01092                  "weight painting");
01093 
01094         prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
01095         RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
01096         RNA_def_property_ui_text(prop, "Vertex Paint", "");
01097 
01098         prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
01099         RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
01100         RNA_def_property_ui_text(prop, "Weight Paint", "");
01101 
01102         prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
01103         RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
01104         RNA_def_property_ui_text(prop, "Image Paint", "");
01105 
01106         prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
01107         RNA_def_property_pointer_sdna(prop, NULL, "particle");
01108         RNA_def_property_ui_text(prop, "Particle Edit", "");
01109 
01110         /* Transform */
01111         prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
01112         RNA_def_property_enum_sdna(prop, NULL, "proportional");
01113         RNA_def_property_enum_items(prop, proportional_editing_items);
01114         RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional Editing mode, allows transforms with distance fall-off");
01115         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
01116 
01117         prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
01118         RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
01119         RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing object mode");
01120         RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
01121         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
01122 
01123         prop= RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
01124         RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
01125         RNA_def_property_enum_items(prop, proportional_falloff_items);
01126         RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
01127         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
01128 
01129         prop= RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
01130         RNA_def_property_float_sdna(prop, NULL, "proportional_size");
01131         RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle");
01132         RNA_def_property_range(prop, 0.00001, 5000.0);
01133         
01134         prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
01135         RNA_def_property_float_sdna(prop, NULL, "normalsize");
01136         RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
01137         RNA_def_property_range(prop, 0.00001, 1000.0);
01138         RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
01139         RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
01140 
01141         prop= RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
01142         RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
01143         RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
01144 
01145         prop= RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
01146         RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
01147         RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
01148         RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
01149         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
01150 
01151         prop= RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
01152         RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
01153         RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
01154         RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
01155         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
01156 
01157         prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
01158         RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
01159         RNA_def_property_enum_items(prop, snap_element_items);
01160         RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
01161         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
01162 
01163         prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
01164         RNA_def_property_enum_sdna(prop, NULL, "snap_target");
01165         RNA_def_property_enum_items(prop, snap_target_items);
01166         RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
01167         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
01168 
01169         prop= RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
01170         RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
01171         RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
01172         RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
01173         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
01174         
01175         prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
01176         RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
01177         RNA_def_property_ui_text(prop, "Project Individual Elements", "Project individual elements on the surface of other objects");
01178         RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
01179         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
01180 
01181         prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
01182         RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
01183         RNA_def_property_ui_text(prop, "Project to Self", "Snap onto its self (editmode)");
01184         RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
01185         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
01186         
01187         /* Grease Pencil */
01188         prop = RNA_def_property(srna, "use_grease_pencil_sessions", PROP_BOOLEAN, PROP_NONE);
01189         RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINTSESSIONS_ON);
01190         RNA_def_property_ui_text(prop, "Use Sketching Sessions", "Allow drawing multiple strokes at a time with Grease Pencil");
01191         RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); // xxx: need toolbar to be redrawn...
01192         
01193         /* Auto Keying */
01194         prop= RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
01195         RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
01196         RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
01197         RNA_def_property_ui_icon(prop, ICON_REC, 0);
01198         
01199         prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
01200         RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
01201         RNA_def_property_enum_items(prop, auto_key_items);
01202         RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
01203         
01204         prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
01205         RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
01206         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");
01207         
01208         prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
01209         RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
01210         RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set only");
01211         RNA_def_property_ui_icon(prop, ICON_KEY_HLT, 0); // XXX: we need a dedicated icon
01212         
01213         /* UV */
01214         prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
01215         RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
01216         RNA_def_property_enum_items(prop, uv_select_mode_items);
01217         RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
01218         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01219 
01220         prop= RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
01221         RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
01222         RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
01223         RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
01224         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01225 
01226         prop= RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
01227         RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
01228         RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
01229         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01230 
01231         /* Mesh */
01232         prop= RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
01233         RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
01234         RNA_def_property_array(prop, 3);
01235         RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
01236         RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
01237         RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
01238 
01239         prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
01240         RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
01241         RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
01242 
01243         /* use with MESH_OT_select_shortest_path */
01244         prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
01245         RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
01246         RNA_def_property_enum_items(prop, edge_tag_items);
01247         RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
01248 
01249         prop= RNA_def_property(srna, "edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
01250         RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1);
01251         RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edges seam re-calculates UV unwrap");
01252 
01253         /* etch-a-ton */
01254         prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
01255         RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
01256         RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
01257 //      RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
01258 
01259         prop= RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
01260         RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
01261         RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
01262 
01263         prop= RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
01264         RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
01265         RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
01266         
01267         prop= RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
01268         RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
01269         RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
01270 
01271         prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
01272         RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
01273         RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
01274 
01275         prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
01276         RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
01277         RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
01278 
01279         prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
01280         RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
01281         RNA_def_property_flag(prop, PROP_EDITABLE);
01282         RNA_def_property_struct_type(prop, "Object");
01283         RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
01284         RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
01285 
01286         prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
01287         RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
01288         RNA_def_property_range(prop, 1, 255);
01289         RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
01290         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01291 
01292         prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
01293         RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
01294         RNA_def_property_range(prop, 0.00001, 1.0);
01295         RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
01296         RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
01297         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01298 
01299         prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
01300         RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
01301         RNA_def_property_range(prop, 0.00001, 100000.0);
01302         RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
01303         RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
01304         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01305 
01306         prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
01307         RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
01308         RNA_def_property_enum_items(prop, retarget_roll_items);
01309         RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
01310         
01311         prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
01312         RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
01313         RNA_def_property_enum_items(prop, sketch_convert_items);
01314         RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
01315         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01316 
01317         /* Sculpt/Paint Unified Size and Strength */
01318 
01319         prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
01320         RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
01321         RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius", "Instead of per brush radius, the radius is shared across brushes");
01322 
01323         prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
01324         RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
01325         RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength", "Instead of per brush strength, the strength is shared across brushes");
01326 }
01327 
01328 
01329 static void rna_def_unit_settings(BlenderRNA  *brna)
01330 {
01331         StructRNA *srna;
01332         PropertyRNA *prop;
01333 
01334         static EnumPropertyItem unit_systems[] = {
01335                 {USER_UNIT_NONE, "NONE", 0, "None", ""},
01336                 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
01337                 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
01338                 {0, NULL, 0, NULL, NULL}};
01339         
01340         static EnumPropertyItem rotation_units[] = {
01341                 {0, "DEGREES", 0, "Degrees", "Use degrees for measuring rotation"},
01342                 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
01343                 {0, NULL, 0, NULL, NULL}};
01344 
01345         srna= RNA_def_struct(brna, "UnitSettings", NULL);
01346         RNA_def_struct_ui_text(srna, "Unit Settings", "");
01347 
01348         /* Units */
01349         prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
01350         RNA_def_property_enum_items(prop, unit_systems);
01351         RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
01352         RNA_def_property_update(prop, NC_WINDOW, NULL);
01353         
01354         prop= RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
01355         RNA_def_property_enum_items(prop, rotation_units);
01356         RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
01357         RNA_def_property_update(prop, NC_WINDOW, NULL);
01358 
01359         prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
01360         RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
01361         RNA_def_property_range(prop, 0.00001, 100000.0);
01362         RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
01363         RNA_def_property_update(prop, NC_WINDOW, NULL);
01364 
01365         prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
01366         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
01367         RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs");
01368         RNA_def_property_update(prop, NC_WINDOW, NULL);
01369 }
01370 
01371 void rna_def_render_layer_common(StructRNA *srna, int scene)
01372 {
01373         PropertyRNA *prop;
01374 
01375         prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
01376         if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
01377         else RNA_def_property_string_sdna(prop, NULL, "name");
01378         RNA_def_property_ui_text(prop, "Name", "Render layer name");
01379         RNA_def_struct_name_property(srna, prop);
01380         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01381         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01382 
01383         prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
01384         RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
01385         RNA_def_property_struct_type(prop, "Material");
01386         RNA_def_property_flag(prop, PROP_EDITABLE);
01387         RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
01388         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01389         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01390 
01391         prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
01392         RNA_def_property_pointer_sdna(prop, NULL, "light_override");
01393         RNA_def_property_struct_type(prop, "Group");
01394         RNA_def_property_flag(prop, PROP_EDITABLE);
01395         RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
01396         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01397         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01398 
01399         /* layers */
01400         prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
01401         RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
01402         RNA_def_property_array(prop, 20);
01403         RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
01404         if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
01405         else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
01406         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01407         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01408 
01409         prop= RNA_def_property(srna, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
01410         RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
01411         RNA_def_property_array(prop, 20);
01412         RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers for solid faces");
01413         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01414         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01415 
01416         /* layer options */
01417         prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
01418         RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
01419         RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
01420         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01421         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01422 
01423         prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
01424         RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
01425         RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
01426         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01427         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01428 
01429         prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
01430         RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
01431         RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
01432         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01433         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01434 
01435         prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
01436         RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
01437         RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
01438         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01439         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01440 
01441         prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
01442         RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
01443         RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
01444         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01445         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01446 
01447         prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
01448         RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
01449         RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
01450         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01451         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01452 
01453         prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
01454         RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
01455         RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
01456         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01457         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01458 
01459         prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
01460         RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
01461         RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
01462         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01463         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01464 
01465         prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
01466         RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
01467         RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
01468         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01469         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01470 
01471         prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
01472         RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
01473         RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
01474         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01475         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01476 
01477         /* passes */
01478         prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
01479         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
01480         RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
01481         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01482         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01483 
01484         prop= RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
01485         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
01486         RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
01487         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01488         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01489         
01490         prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
01491         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
01492         RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
01493         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01494         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01495 
01496         prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
01497         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
01498         RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
01499         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01500         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01501 
01502         prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
01503         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
01504         RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
01505         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01506         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01507 
01508         prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
01509         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
01510         RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
01511         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01512         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01513 
01514         prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
01515         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
01516         RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
01517         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01518         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01519 
01520         prop= RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
01521         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXMA);
01522         RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
01523         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01524         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01525 
01526         prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
01527         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
01528         RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
01529         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01530         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01531 
01532         prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
01533         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
01534         RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
01535         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01536         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01537 
01538         prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
01539         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
01540         RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
01541         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01542         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01543 
01544         prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
01545         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
01546         RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
01547         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01548         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01549 
01550         prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
01551         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
01552         RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
01553         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01554         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01555         
01556         prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
01557         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
01558         RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
01559         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01560         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01561 
01562         prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
01563         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
01564         RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
01565         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01566         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01567 
01568         prop= RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
01569         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
01570         RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
01571         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01572         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01573 
01574         prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
01575         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
01576         RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
01577         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01578         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01579 
01580         prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
01581         RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
01582         RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
01583         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01584         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01585 
01586         prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
01587         RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
01588         RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
01589         RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
01590         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01591         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01592 
01593         prop= RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
01594         RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
01595         RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
01596         RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
01597         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01598         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01599 
01600         prop= RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
01601         RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
01602         RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
01603         RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
01604         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01605         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01606         
01607         prop= RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
01608         RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
01609         RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
01610         RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
01611         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01612         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01613 
01614         prop= RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
01615         RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
01616         RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
01617         RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
01618         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01619         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01620 
01621         prop= RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
01622         RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
01623         RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
01624         RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
01625         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01626         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01627 
01628         prop= RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
01629         RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
01630         RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
01631         RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
01632         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01633         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01634 
01635         prop= RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
01636         RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
01637         RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
01638         RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
01639         if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
01640         else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01641 }
01642 
01643 static void rna_def_scene_game_data(BlenderRNA *brna)
01644 {
01645         StructRNA *srna;
01646         PropertyRNA *prop;
01647 
01648         static EnumPropertyItem framing_types_items[] ={
01649                 {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
01650                 {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
01651                 {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
01652                 {0, NULL, 0, NULL, NULL}};
01653 
01654         static EnumPropertyItem dome_modes_items[] ={
01655                 {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
01656                 {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
01657                 {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
01658                 {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""},
01659                 {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
01660                 {0, NULL, 0, NULL, NULL}};
01661                 
01662          static EnumPropertyItem stereo_modes_items[] ={
01663                 {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
01664                 {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
01665                 {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
01666                 {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""},
01667                 {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""},
01668                 {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
01669                 {0, NULL, 0, NULL, NULL}};
01670                 
01671          static EnumPropertyItem stereo_items[] ={
01672                 {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
01673                 {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
01674                 {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
01675                 {0, NULL, 0, NULL, NULL}};
01676 
01677         static EnumPropertyItem physics_engine_items[] = {
01678                 {WOPHY_NONE, "NONE", 0, "None", "Don't use a physics engine"},
01679                 //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
01680                 //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
01681                 //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
01682                 //{WOPHY_ODE, "ODE", 0, "ODE", ""},
01683                 {WOPHY_BULLET, "BULLET", 0, "Bullet", "Use the Bullet physics engine"},
01684                 {0, NULL, 0, NULL, NULL}};
01685 
01686         static EnumPropertyItem material_items[] ={
01687                 {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials"},
01688                 {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
01689                 {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
01690                 {0, NULL, 0, NULL, NULL}};
01691 
01692         srna= RNA_def_struct(brna, "SceneGameData", NULL);
01693         RNA_def_struct_sdna(srna, "GameData");
01694         RNA_def_struct_nested(brna, srna, "Scene");
01695         RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
01696         
01697         prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
01698         RNA_def_property_int_sdna(prop, NULL, "xplay");
01699         RNA_def_property_range(prop, 4, 10000);
01700         RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
01701         RNA_def_property_update(prop, NC_SCENE, NULL);
01702         
01703         prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
01704         RNA_def_property_int_sdna(prop, NULL, "yplay");
01705         RNA_def_property_range(prop, 4, 10000);
01706         RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
01707         RNA_def_property_update(prop, NC_SCENE, NULL);
01708         
01709         prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
01710         RNA_def_property_int_sdna(prop, NULL, "depth");
01711         RNA_def_property_range(prop, 8, 32);
01712         RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
01713         RNA_def_property_update(prop, NC_SCENE, NULL);
01714         
01715         // Do we need it here ? (since we already have it in World
01716         prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
01717         RNA_def_property_int_sdna(prop, NULL, "freqplay");
01718         RNA_def_property_range(prop, 4, 2000);
01719         RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display");
01720         RNA_def_property_update(prop, NC_SCENE, NULL);
01721         
01722         prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
01723         RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
01724         RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
01725         RNA_def_property_update(prop, NC_SCENE, NULL);
01726 
01727         /* Framing */
01728         prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
01729         RNA_def_property_enum_sdna(prop, NULL, "framing.type");
01730         RNA_def_property_enum_items(prop, framing_types_items);
01731         RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
01732         RNA_def_property_update(prop, NC_SCENE, NULL);
01733 
01734         prop= RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
01735         RNA_def_property_float_sdna(prop, NULL, "framing.col");
01736         RNA_def_property_range(prop, 0.0f, 1.0f);
01737         RNA_def_property_array(prop, 3);
01738         RNA_def_property_ui_text(prop, "Framing Color", "Set color of the bars");
01739         RNA_def_property_update(prop, NC_SCENE, NULL);
01740         
01741         /* Stereo */
01742         prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
01743         RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
01744         RNA_def_property_enum_items(prop, stereo_items);
01745         RNA_def_property_ui_text(prop, "Stereo Options", "");
01746         RNA_def_property_update(prop, NC_SCENE, NULL);
01747 
01748         prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
01749         RNA_def_property_enum_sdna(prop, NULL, "stereomode");
01750         RNA_def_property_enum_items(prop, stereo_modes_items);
01751         RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
01752         RNA_def_property_update(prop, NC_SCENE, NULL);
01753 
01754         prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
01755         RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
01756         RNA_def_property_range(prop, 0.01, 5.0);
01757         RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
01758         RNA_def_property_update(prop, NC_SCENE, NULL);
01759         
01760         /* Dome */
01761         prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
01762         RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
01763         RNA_def_property_enum_items(prop, dome_modes_items);
01764         RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations");
01765         RNA_def_property_update(prop, NC_SCENE, NULL);
01766         
01767         prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
01768         RNA_def_property_int_sdna(prop, NULL, "dome.res");
01769         RNA_def_property_ui_range(prop, 1, 8, 1, 1);
01770         RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
01771         RNA_def_property_update(prop, NC_SCENE, NULL);
01772         
01773         prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
01774         RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
01775         RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
01776         RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
01777         RNA_def_property_update(prop, NC_SCENE, NULL);
01778         
01779         prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
01780         RNA_def_property_int_sdna(prop, NULL, "dome.angle");
01781         RNA_def_property_ui_range(prop, 90, 250, 1, 1);
01782         RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
01783         RNA_def_property_update(prop, NC_SCENE, NULL);
01784         
01785         prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
01786         RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
01787         RNA_def_property_ui_range(prop, -180, 180, 1, 1);
01788         RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
01789         RNA_def_property_update(prop, NC_SCENE, NULL);
01790         
01791         prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
01792         RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
01793         RNA_def_property_struct_type(prop, "Text");
01794         RNA_def_property_flag(prop, PROP_EDITABLE);
01795         RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file");
01796         RNA_def_property_update(prop, NC_SCENE, NULL);
01797         
01798         /* physics */
01799         prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
01800         RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
01801         RNA_def_property_enum_items(prop, physics_engine_items);
01802         RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
01803         RNA_def_property_update(prop, NC_SCENE, NULL);
01804 
01805         prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
01806         RNA_def_property_float_sdna(prop, NULL, "gravity");
01807         RNA_def_property_ui_range(prop, 0.0, 25.0, 1, 2);
01808         RNA_def_property_range(prop, 0.0, 10000.0);
01809         RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
01810         RNA_def_property_update(prop, NC_SCENE, NULL);
01811 
01812         prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_INT, PROP_NONE);
01813         RNA_def_property_int_sdna(prop, NULL, "occlusionRes");
01814         RNA_def_property_range(prop, 128.0, 1024.0);
01815         RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
01816         RNA_def_property_update(prop, NC_SCENE, NULL);
01817 
01818         prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
01819         RNA_def_property_int_sdna(prop, NULL, "ticrate");
01820         RNA_def_property_ui_range(prop, 1, 60, 1, 1);
01821         RNA_def_property_range(prop, 1, 250);
01822         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");
01823         RNA_def_property_update(prop, NC_SCENE, NULL);
01824 
01825         prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
01826         RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
01827         RNA_def_property_ui_range(prop, 1, 5, 1, 1);
01828         RNA_def_property_range(prop, 1, 5);
01829         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");
01830         RNA_def_property_update(prop, NC_SCENE, NULL);
01831 
01832         prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
01833         RNA_def_property_int_sdna(prop, NULL, "maxphystep");
01834         RNA_def_property_ui_range(prop, 1, 5, 1, 1);
01835         RNA_def_property_range(prop, 1, 5);
01836         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");
01837         RNA_def_property_update(prop, NC_SCENE, NULL);
01838 
01839         prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
01840         RNA_def_property_int_sdna(prop, NULL, "physubstep");
01841         RNA_def_property_ui_range(prop, 1, 5, 1, 1);
01842         RNA_def_property_range(prop, 1, 5);
01843         RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
01844         RNA_def_property_update(prop, NC_SCENE, NULL);
01845 
01846         /* mode */
01847         prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
01848         RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
01849         RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
01850         
01851         // not used // deprecated !!!!!!!!!!!!!
01852         prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
01853         RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
01854         RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
01855 
01856         // not used // deprecated !!!!!!!!!!!!!
01857         prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
01858         RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
01859         RNA_def_property_range(prop, 0.0, 1000.0);
01860         RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
01861 
01862         /* booleans */
01863         prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
01864         RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
01865         RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
01866 
01867         prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
01868         RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
01869         RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs");
01870 
01871         prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
01872         RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
01873         RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
01874 
01875         prop= RNA_def_property(srna, "show_mouse", PROP_BOOLEAN, PROP_NONE);
01876         RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_MOUSE);
01877         RNA_def_property_ui_text(prop, "Show Mouse", "Start player with a visible mouse cursor");
01878 
01879         prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
01880         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
01881         RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
01882 
01883         prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
01884         RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
01885         RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
01886 
01887         prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
01888         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
01889         RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
01890 
01891         prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
01892         RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
01893         RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
01894 
01895         prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
01896         RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
01897         RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
01898         
01899         /* materials */
01900         prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
01901         RNA_def_property_enum_sdna(prop, NULL, "matmode");
01902         RNA_def_property_enum_items(prop, material_items);
01903         RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
01904         RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
01905 
01906         prop= RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
01907         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
01908         RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
01909         RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
01910 
01911         prop= RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
01912         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
01913         RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
01914         RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
01915 
01916         prop= RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
01917         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
01918         RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
01919         RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
01920 
01921         prop= RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
01922         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
01923         RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
01924         RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
01925 
01926         prop= RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
01927         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
01928         RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
01929         RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
01930 
01931         prop= RNA_def_property(srna, "use_glsl_color_management", PROP_BOOLEAN, PROP_NONE);
01932         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_COLOR_MANAGEMENT);
01933         RNA_def_property_ui_text(prop, "GLSL Color Management", "Use color management for GLSL rendering");
01934         RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
01935 
01936         prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
01937         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
01938         RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
01939         RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
01940 }
01941 
01942 static void rna_def_scene_render_layer(BlenderRNA *brna)
01943 {
01944         StructRNA *srna;
01945 
01946         srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
01947         RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
01948         RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
01949 
01950         rna_def_render_layer_common(srna, 1);
01951 }
01952 
01953 /* curve.splines */
01954 static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
01955 {
01956         StructRNA *srna;
01957         PropertyRNA *prop;
01958 
01959         // FunctionRNA *func;
01960         // PropertyRNA *parm; 
01961 
01962         RNA_def_property_srna(cprop, "RenderLayers");
01963         srna= RNA_def_struct(brna, "RenderLayers", NULL);
01964         RNA_def_struct_sdna(srna, "RenderData");
01965         RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
01966 
01967         prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
01968         RNA_def_property_int_sdna(prop, NULL, "actlay");
01969         RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
01970         RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
01971         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01972         
01973         prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
01974         RNA_def_property_struct_type(prop, "SceneRenderLayer");
01975         RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get", "rna_RenderSettings_active_layer_set", NULL, NULL);
01976         RNA_def_property_flag(prop, PROP_EDITABLE);
01977         RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
01978         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
01979 
01980 }
01981 
01982 static void rna_def_scene_render_data(BlenderRNA *brna)
01983 {
01984         StructRNA *srna;
01985         PropertyRNA *prop;
01986         
01987         static EnumPropertyItem pixel_filter_items[] ={
01988                 {R_FILTER_BOX, "BOX", 0, "Box", "Use a box filter for anti-aliasing"},
01989                 {R_FILTER_TENT, "TENT", 0, "Tent", "Use a tent filter for anti-aliasing"},
01990                 {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", "Use a quadratic filter for anti-aliasing"},
01991                 {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", "Use a cubic filter for anti-aliasing"},
01992                 {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", "Use a Catmull-Rom filter for anti-aliasing"},
01993                 {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", "Use a Gaussian filter for anti-aliasing"},
01994                 {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", "Use a Mitchell-Netravali filter for anti-aliasing"},
01995                 {0, NULL, 0, NULL, NULL}};
01996                 
01997         static EnumPropertyItem alpha_mode_items[] ={
01998                 {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
01999                 {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
02000                 {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
02001                 {0, NULL, 0, NULL, NULL}};
02002                 
02003         static EnumPropertyItem color_mode_items[] ={
02004                 {R_PLANESBW, "BW", 0, "BW", "Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)"},
02005                 {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
02006                 {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
02007                 {0, NULL, 0, NULL, NULL}};
02008         
02009         static EnumPropertyItem display_mode_items[] ={
02010                 {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"},
02011                 {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"},
02012                 {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
02013                 {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes, optionally showing result"},
02014                 {0, NULL, 0, NULL, NULL}};
02015         
02016         /* Bake */
02017         static EnumPropertyItem bake_mode_items[] ={
02018                 {RE_BAKE_ALL, "FULL", 0, "Full Render", "Bake everything"},
02019                 {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"},
02020                 {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", "Bake shadows"},
02021                 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"},
02022                 {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", "Bake textures"},
02023                 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"},
02024                 {RE_BAKE_EMIT, "EMIT", 0, "Emission", "Bake Emit values (glow)"},
02025                 {RE_BAKE_ALPHA, "ALPHA", 0, "Alpha", "Bake Alpha values (transparency)"},
02026                 {RE_BAKE_MIRROR_INTENSITY, "MIRROR_INTENSITY", 0, "Mirror Intensity", "Bake Mirror values"},
02027                 {RE_BAKE_MIRROR_COLOR, "MIRROR_COLOR", 0, "Mirror Colors", "Bake Mirror colors"},
02028                 {RE_BAKE_SPEC_INTENSITY, "SPEC_INTENSITY", 0, "Specular Intensity", "Bake Specular values"},
02029                 {RE_BAKE_SPEC_COLOR, "SPEC_COLOR", 0, "Specular Colors", "Bake Specular colors"},
02030                 {0, NULL, 0, NULL, NULL}};
02031 
02032         static EnumPropertyItem bake_normal_space_items[] ={
02033                 {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", "Bake the normals in camera space"},
02034                 {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", "Bake the normals in world space"},
02035                 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"},
02036                 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"},
02037                 {0, NULL, 0, NULL, NULL}};
02038 
02039         static EnumPropertyItem bake_qyad_split_items[] ={
02040                 {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
02041                 {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
02042                 {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
02043                 {0, NULL, 0, NULL, NULL}};
02044         
02045         static EnumPropertyItem octree_resolution_items[] = {
02046                 {64, "64", 0, "64", ""},
02047                 {128, "128", 0, "128", ""},
02048                 {256, "256", 0, "256", ""},
02049                 {512, "512", 0, "512", ""},
02050                 {0, NULL, 0, NULL, NULL}};
02051 
02052         static EnumPropertyItem raytrace_structure_items[] = {
02053                 {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", "Automatically select acceleration structure"},
02054                 {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"},
02055                 {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
02056                 {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", "Use vBVH"},
02057                 {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", "Use SIMD SVBVH"},
02058                 {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", "Use SIMD QBVH"},
02059                 {0, NULL, 0, NULL, NULL}
02060                 };
02061 
02062         static EnumPropertyItem fixed_oversample_items[] = {
02063                 {5, "5", 0, "5", ""},
02064                 {8, "8", 0, "8", ""},
02065                 {11, "11", 0, "11", ""},
02066                 {16, "16", 0, "16", ""},
02067                 {0, NULL, 0, NULL, NULL}};
02068                 
02069         static EnumPropertyItem field_order_items[] = {
02070                 {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"},
02071                 {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"},
02072                 {0, NULL, 0, NULL, NULL}};
02073                 
02074         static EnumPropertyItem threads_mode_items[] = {
02075                 {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
02076                 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
02077                 {0, NULL, 0, NULL, NULL}};
02078                 
02079 #ifdef WITH_OPENEXR     
02080         static EnumPropertyItem exr_codec_items[] = {
02081                 {0, "NONE", 0, "None", ""},
02082                 {1, "PXR24", 0, "Pxr24 (lossy)", ""},
02083                 {2, "ZIP", 0, "ZIP (lossless)", ""},
02084                 {3, "PIZ", 0, "PIZ (lossless)", ""},
02085                 {4, "RLE", 0, "RLE (lossless)", ""},
02086                 {0, NULL, 0, NULL, NULL}};
02087 #endif
02088 
02089 #ifdef WITH_OPENJPEG
02090         static EnumPropertyItem jp2_preset_items[] = {
02091                 {0, "NO_PRESET", 0, "No Preset", ""},
02092                 {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
02093                 {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
02094                 {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
02095                 {4, "CINE_SCOPE_24FPS", 0, "Cine-Scope 24fps 2048x858", ""},
02096                 {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
02097                 {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
02098                 {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
02099                 {0, NULL, 0, NULL, NULL}};
02100                 
02101         static EnumPropertyItem jp2_depth_items[] = {
02102                 {8, "8", 0, "8", "8 bit color channels"},
02103                 {12, "12", 0, "12", "12 bit color channels"},
02104                 {16, "16", 0, "16", "16 bit color channels"},
02105                 {0, NULL, 0, NULL, NULL}};
02106 #endif
02107         
02108 #ifdef  WITH_QUICKTIME
02109         static EnumPropertyItem quicktime_codec_type_items[] = {
02110                 {0, "codec", 0, "codec", ""},
02111                 {0, NULL, 0, NULL, NULL}};
02112         
02113 #ifdef USE_QTKIT
02114         static EnumPropertyItem quicktime_audio_samplerate_items[] = {
02115                 {22050, "22050", 0, "22kHz", ""},
02116                 {44100, "44100", 0, "44.1kHz", ""},
02117                 {48000, "48000", 0, "48kHz", ""},
02118                 {88200, "88200", 0, "88.2kHz", ""},
02119                 {96000, "96000", 0, "96kHz", ""},
02120                 {192000, "192000", 0, "192kHz", ""},
02121                 {0, NULL, 0, NULL, NULL}};
02122         
02123         static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
02124                 {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
02125                 {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
02126                 {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
02127                 {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
02128                 {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
02129                 {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
02130                 {0, NULL, 0, NULL, NULL}};
02131         
02132         static EnumPropertyItem quicktime_audio_bitrate_items[] = {
02133                 {64000, "64000", 0, "64kbps", ""},
02134                 {112000, "112000", 0, "112kpbs", ""},
02135                 {128000, "128000", 0, "128kbps", ""},
02136                 {192000, "192000", 0, "192kbps", ""},
02137                 {256000, "256000", 0, "256kbps", ""},
02138                 {320000, "320000", 0, "320kbps", ""},
02139                 {0, NULL, 0, NULL, NULL}};
02140 #endif
02141 #endif
02142 
02143 #ifdef WITH_FFMPEG
02144         static EnumPropertyItem ffmpeg_format_items[] = {
02145                 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
02146                 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
02147                 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
02148                 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
02149                 {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""},
02150                 {FFMPEG_DV, "DV", 0, "DV", ""},
02151                 {FFMPEG_H264, "H264", 0, "H.264", ""},
02152                 {FFMPEG_XVID, "XVID", 0, "Xvid", ""},
02153                 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
02154                 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
02155                 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
02156                 {FFMPEG_WAV, "WAV", 0, "Wav", ""},
02157                 {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
02158                 {0, NULL, 0, NULL, NULL}};
02159 
02160         static EnumPropertyItem ffmpeg_codec_items[] = {
02161                 {CODEC_ID_NONE, "NONE", 0, "None", ""},
02162                 {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
02163                 {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
02164                 {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
02165                 {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
02166                 {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
02167                 {CODEC_ID_H264, "H264", 0, "H.264", ""},
02168                 {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
02169                 {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
02170                 {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
02171                 {0, NULL, 0, NULL, NULL}};
02172 
02173         static EnumPropertyItem ffmpeg_audio_codec_items[] = {
02174                 {CODEC_ID_NONE, "NONE", 0, "None", ""},
02175                 {CODEC_ID_MP2, "MP2", 0, "MP2", ""},
02176                 {CODEC_ID_MP3, "MP3", 0, "MP3", ""},
02177                 {CODEC_ID_AC3, "AC3", 0, "AC3", ""},
02178                 {CODEC_ID_AAC, "AAC", 0, "AAC", ""},
02179                 {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
02180                 {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
02181                 {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
02182                 {0, NULL, 0, NULL, NULL}};
02183 #endif
02184 
02185         static EnumPropertyItem engine_items[] = {
02186                 {0, "BLENDER_RENDER", 0, "Blender Render", "Use the Blender internal rendering engine for rendering"},
02187                 {0, NULL, 0, NULL, NULL}};
02188 
02189         srna= RNA_def_struct(brna, "RenderSettings", NULL);
02190         RNA_def_struct_sdna(srna, "RenderData");
02191         RNA_def_struct_nested(brna, srna, "Scene");
02192         RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
02193         RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
02194         
02195         prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
02196         RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
02197         RNA_def_property_enum_items(prop, color_mode_items);
02198         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");
02199         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02200 
02201         prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
02202         RNA_def_property_int_sdna(prop, NULL, "xsch");
02203         RNA_def_property_range(prop, 4, 10000);
02204         RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
02205         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02206         
02207         prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
02208         RNA_def_property_int_sdna(prop, NULL, "ysch");
02209         RNA_def_property_range(prop, 4, 10000);
02210         RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
02211         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02212         
02213         prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
02214         RNA_def_property_int_sdna(prop, NULL, "size");
02215         RNA_def_property_range(prop, 1, SHRT_MAX);
02216         RNA_def_property_ui_range(prop, 1, 100, 10, 1);
02217         RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
02218         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02219         
02220         prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
02221         RNA_def_property_int_sdna(prop, NULL, "xparts");
02222         RNA_def_property_range(prop, 1, 512);
02223         RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
02224         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02225         
02226         prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
02227         RNA_def_property_int_sdna(prop, NULL, "yparts");
02228         RNA_def_property_range(prop, 1, 512);
02229         RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
02230         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02231         
02232         prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
02233         RNA_def_property_float_sdna(prop, NULL, "xasp");
02234         RNA_def_property_range(prop, 1.0f, 200.0f);
02235         RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
02236         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02237         
02238         prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
02239         RNA_def_property_float_sdna(prop, NULL, "yasp");
02240         RNA_def_property_range(prop, 1.0f, 200.0f);
02241         RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
02242         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02243         
02244         /* JPEG and AVI JPEG */
02245         
02246         prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
02247         RNA_def_property_int_sdna(prop, NULL, "quality");
02248         RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
02249         RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, Compression for PNG's");
02250         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02251         
02252         /* Tiff */
02253         
02254         prop= RNA_def_property(srna, "use_tiff_16bit", PROP_BOOLEAN, PROP_NONE);
02255         RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
02256         RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
02257         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02258         
02259         /* Cineon and DPX */
02260         
02261         prop= RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
02262         RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
02263         RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
02264         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02265         
02266         prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
02267         RNA_def_property_int_sdna(prop, NULL, "cineonblack");
02268         RNA_def_property_range(prop, 0, 1024);
02269         RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
02270         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02271         
02272         prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
02273         RNA_def_property_int_sdna(prop, NULL, "cineonwhite");
02274         RNA_def_property_range(prop, 0, 1024);
02275         RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
02276         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02277         
02278         prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
02279         RNA_def_property_float_sdna(prop, NULL, "cineongamma");
02280         RNA_def_property_range(prop, 0.0f, 10.0f);
02281         RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
02282         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02283 
02284 #ifdef WITH_OPENEXR     
02285         /* OpenEXR */
02286 
02287         prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
02288         RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality");
02289         RNA_def_property_enum_items(prop, exr_codec_items);
02290         RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
02291         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02292         
02293         prop= RNA_def_property(srna, "use_exr_half", PROP_BOOLEAN, PROP_NONE);
02294         RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
02295         RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
02296         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02297         
02298         prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE);
02299         RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF);
02300         RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int z-buffer)");
02301         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02302         
02303         prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE);
02304         RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG);
02305         RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
02306         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02307 #endif
02308 
02309 #ifdef WITH_OPENJPEG
02310         /* Jpeg 2000 */
02311 
02312         prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
02313         RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
02314         RNA_def_property_enum_items(prop, jp2_preset_items);
02315         RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_preset_set", NULL);
02316         RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
02317         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02318         
02319         prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
02320         RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
02321         RNA_def_property_enum_items(prop, jp2_depth_items);
02322         RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_jpeg2k_depth_set", NULL);
02323         RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
02324         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02325         
02326         prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
02327         RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
02328         RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
02329         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02330 #endif
02331 
02332 #ifdef WITH_QUICKTIME
02333         /* QuickTime */
02334         
02335         prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
02336         RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
02337         RNA_def_property_enum_items(prop, quicktime_codec_type_items);
02338         RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
02339                                                                 "rna_RenderSettings_qtcodecsettings_codecType_set",
02340                                                                 "rna_RenderSettings_qtcodecsettings_codecType_itemf");
02341         RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
02342         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02343         
02344         prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
02345         RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
02346         RNA_def_property_range(prop, 0, 100);
02347         RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
02348         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02349 
02350 #ifdef USE_QTKIT
02351         prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE);
02352         RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType");
02353         RNA_def_property_enum_items(prop, quicktime_codec_type_items);
02354         RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
02355                                                                 "rna_RenderSettings_qtcodecsettings_audiocodecType_set",
02356                                                                 "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
02357         RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
02358         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02359         
02360         prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE);
02361         RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate");
02362         RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
02363         RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
02364         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02365         
02366         prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE);
02367         RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth");
02368         RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
02369         RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
02370         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02371         
02372         prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
02373         RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
02374         RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
02375         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02376         
02377         prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
02378         RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
02379         RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
02380         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02381 
02382         prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE);
02383         RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate");
02384         RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
02385         RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
02386         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);        
02387 #endif
02388 #endif
02389         
02390 #ifdef WITH_FFMPEG
02391         /* FFMPEG Video*/
02392         
02393         prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE);
02394         RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type");
02395         RNA_def_property_enum_items(prop, ffmpeg_format_items);
02396         RNA_def_property_ui_text(prop, "Format", "Output file format");
02397         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02398         
02399         prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE);
02400         RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec");
02401         RNA_def_property_enum_items(prop, ffmpeg_codec_items);
02402         RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use");
02403         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02404         
02405         prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
02406         RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
02407         RNA_def_property_range(prop, 1, 14000);
02408         RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
02409         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02410         
02411         prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
02412         RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
02413         RNA_def_property_range(prop, 0, 9000);
02414         RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
02415         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02416         
02417         prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
02418         RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
02419         RNA_def_property_range(prop, 1, 14000);
02420         RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
02421         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02422         
02423         prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
02424         RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate");
02425         RNA_def_property_range(prop, 0, 100000000);
02426         RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))");
02427         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02428         
02429         prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE);
02430         RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size");
02431         RNA_def_property_range(prop, 0, 100);
02432         RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames");
02433         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02434         
02435         prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE);
02436         RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size");
02437         RNA_def_property_range(prop, 0, 2000);
02438         RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
02439         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02440         
02441         prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE);
02442         RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size");
02443         RNA_def_property_range(prop, 0, 16384);
02444         RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
02445         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02446         
02447         prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE);
02448         RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT);
02449         RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
02450         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02451         
02452         /* FFMPEG Audio*/
02453         prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
02454         RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
02455         RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
02456         RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
02457         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02458         
02459         prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
02460         RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
02461         RNA_def_property_range(prop, 32, 384);
02462         RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
02463         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02464         
02465         prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
02466         RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
02467         RNA_def_property_range(prop, 8000, 192000);
02468         RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
02469         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02470 
02471         prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
02472         RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
02473         RNA_def_property_range(prop, 0.0f, 1.0f);
02474         RNA_def_property_ui_text(prop, "Volume", "Audio volume");
02475         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02476 
02477 #endif
02478 
02479         prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
02480         RNA_def_property_int_sdna(prop, NULL, "frs_sec");
02481         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02482         RNA_def_property_range(prop, 1, 120);
02483         RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
02484         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02485         
02486         prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
02487         RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
02488         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02489         RNA_def_property_range(prop, 0.1f, 120.0f);
02490         RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
02491         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02492         
02493         /* frame mapping */
02494         prop= RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
02495         RNA_def_property_int_sdna(prop, NULL, "framapto");
02496         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02497         RNA_def_property_range(prop, 1, 900);
02498         RNA_def_property_ui_text(prop, "Frame Map Old", "Specify old mapping value in frames");
02499         RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
02500         
02501         prop= RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
02502         RNA_def_property_int_sdna(prop, NULL, "images");
02503         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02504         RNA_def_property_range(prop, 1, 900);
02505         RNA_def_property_ui_text(prop, "Frame Map New", "Specify how many frames the Map Old will last");
02506         RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
02507 
02508         
02509         prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
02510         RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
02511         RNA_def_property_range(prop, 0.0f, 2.0f);
02512         RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding");
02513         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02514         
02515         prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
02516         RNA_def_property_enum_sdna(prop, NULL, "filtertype");
02517         RNA_def_property_enum_items(prop, pixel_filter_items);
02518         RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
02519         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02520         
02521         prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
02522         RNA_def_property_float_sdna(prop, NULL, "gauss");
02523         RNA_def_property_range(prop, 0.5f, 1.5f);
02524         RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
02525         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02526         
02527         prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
02528         RNA_def_property_enum_sdna(prop, NULL, "alphamode");
02529         RNA_def_property_enum_items(prop, alpha_mode_items);
02530         RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
02531         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02532         
02533         prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
02534         RNA_def_property_enum_sdna(prop, NULL, "ocres");
02535         RNA_def_property_enum_items(prop, octree_resolution_items);
02536         RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes");
02537         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02538 
02539         prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
02540         RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
02541         RNA_def_property_enum_items(prop, raytrace_structure_items);
02542         RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
02543         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02544 
02545         prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
02546         RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
02547         RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates");
02548         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02549 
02550         prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
02551         RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
02552         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");
02553         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02554 
02555         prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
02556         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
02557         RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
02558         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02559         
02560         prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
02561         RNA_def_property_enum_sdna(prop, NULL, "osa");
02562         RNA_def_property_enum_items(prop, fixed_oversample_items);
02563         RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
02564         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02565         
02566         prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
02567         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
02568         RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
02569         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02570         
02571         prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
02572         RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
02573         RNA_def_property_enum_items(prop, field_order_items);
02574         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");
02575         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02576         
02577         prop= RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
02578         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
02579         RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
02580         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02581         
02582         /* rendering features */
02583         prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
02584         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
02585         RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
02586         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02587         
02588         prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
02589         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
02590         RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
02591         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02592         
02593         prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
02594         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
02595         RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
02596         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02597         
02598         prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
02599         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
02600         RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
02601         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02602         
02603         prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
02604         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
02605         RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
02606         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02607         
02608         prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
02609         RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
02610         RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
02611         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02612         
02613         prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
02614         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
02615         RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
02616         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02617         
02618         prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
02619         RNA_def_property_int_sdna(prop, NULL, "edgeint");
02620         RNA_def_property_range(prop, 0, 255);
02621         RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
02622         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02623         
02624         prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
02625         RNA_def_property_float_sdna(prop, NULL, "edgeR");
02626         RNA_def_property_array(prop, 3);
02627         RNA_def_property_ui_text(prop, "Edge Color", "Edge color");
02628         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02629         
02630         /* threads */
02631         prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
02632         RNA_def_property_int_sdna(prop, NULL, "threads");
02633         RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
02634         RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
02635         RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
02636         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02637         
02638         prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
02639         RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
02640         RNA_def_property_enum_items(prop, threads_mode_items);
02641         RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
02642         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02643         
02644         /* motion blur */
02645         prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
02646         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
02647         RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
02648         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02649         
02650         prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
02651         RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
02652         RNA_def_property_range(prop, 1, 32);
02653         RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
02654         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02655         
02656         prop= RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
02657         RNA_def_property_float_sdna(prop, NULL, "blurfac");
02658         RNA_def_property_range(prop, 0.01f, 10.0f);
02659         RNA_def_property_ui_range(prop, 0.01, 2.0f, 1, 0);
02660         RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
02661         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02662         
02663         /* border */
02664         prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
02665         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
02666         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");
02667         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02668 
02669         prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
02670         RNA_def_property_float_sdna(prop, NULL, "border.xmin");
02671         RNA_def_property_range(prop, 0.0f, 1.0f);
02672         RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border");
02673         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02674 
02675         prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
02676         RNA_def_property_float_sdna(prop, NULL, "border.ymin");
02677         RNA_def_property_range(prop, 0.0f, 1.0f);
02678         RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
02679         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02680 
02681         prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
02682         RNA_def_property_float_sdna(prop, NULL, "border.xmax");
02683         RNA_def_property_range(prop, 0.0f, 1.0f);
02684         RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
02685         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02686 
02687         prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
02688         RNA_def_property_float_sdna(prop, NULL, "border.ymax");
02689         RNA_def_property_range(prop, 0.0f, 1.0f);
02690         RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
02691         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02692         
02693         prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
02694         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
02695         RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
02696         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02697         
02698         prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
02699         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
02700         RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
02701         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02702         
02703         prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
02704         RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
02705         RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
02706         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02707         
02708         prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
02709         RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
02710         RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled");
02711         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02712         
02713         prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
02714         RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
02715         RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist");
02716         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02717         
02718         prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
02719         RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
02720         RNA_def_property_ui_text(prop, "Color Management", "Use linear workflow - gamma corrected imaging pipeline");
02721         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_RenderSettings_color_management_update");
02722 
02723         
02724         prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
02725         RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
02726         RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
02727         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02728         
02729         prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
02730         RNA_def_property_enum_sdna(prop, NULL, "imtype");
02731         RNA_def_property_enum_items(prop, image_type_items);
02732         RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
02733         RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
02734         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02735 
02736         prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
02737         RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
02738         RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
02739         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02740 
02741         prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
02742         RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
02743         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02744         RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
02745 
02746         prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
02747         RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
02748         RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing");
02749         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02750 
02751         prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
02752         RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
02753         RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
02754         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02755 
02756         prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
02757         RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
02758         RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
02759         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)");
02760         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02761         
02762         prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
02763         RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
02764          RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
02765         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");
02766         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02767 
02768         prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
02769         RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
02770         RNA_def_property_enum_items(prop, display_mode_items);
02771         RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
02772         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02773         
02774         prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
02775         RNA_def_property_string_sdna(prop, NULL, "pic");
02776         RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers");
02777         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02778 
02779         /* Bake */
02780         
02781         prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
02782         RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
02783         RNA_def_property_enum_items(prop, bake_mode_items);
02784         RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
02785         
02786         prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
02787         RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
02788         RNA_def_property_enum_items(prop, bake_normal_space_items);
02789         RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
02790         
02791         prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
02792         RNA_def_property_enum_items(prop, bake_qyad_split_items);
02793         RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
02794         
02795         prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
02796         RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
02797         RNA_def_property_enum_items(prop, fixed_oversample_items);
02798         RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
02799         
02800         prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
02801         RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
02802         RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
02803         
02804         prop= RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
02805         RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
02806         RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings");
02807         
02808         prop= RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
02809         RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
02810         RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
02811         
02812         prop= RNA_def_property(srna, "use_bake_antialiasing", PROP_BOOLEAN, PROP_NONE);
02813         RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
02814         RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
02815         
02816         prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
02817         RNA_def_property_int_sdna(prop, NULL, "bake_filter");
02818         RNA_def_property_range(prop, 0, 64);
02819         RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
02820 
02821         prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
02822         RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
02823         RNA_def_property_range(prop, 0.0, 1000.0);
02824         RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
02825         
02826         prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
02827         RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
02828         RNA_def_property_range(prop, 0.0, 1000.0);
02829         RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
02830         
02831         prop= RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE);
02832         RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_MULTIRES);
02833         RNA_def_property_ui_text(prop, "Bake from Multires", "Bake directly from multires object");
02834 
02835         prop= RNA_def_property(srna, "use_bake_lores_mesh", PROP_BOOLEAN, PROP_NONE);
02836         RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_LORES_MESH);
02837         RNA_def_property_ui_text(prop, "Low Resolution Mesh", "Calculate heights against unsubdivided low resolution mesh");
02838 
02839         /* stamp */
02840         
02841         prop= RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
02842         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
02843         RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
02844         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02845         
02846         prop= RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
02847         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
02848         RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
02849         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02850         
02851         prop= RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
02852         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
02853         RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
02854         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02855         
02856         prop= RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
02857         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
02858         RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
02859         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02860 
02861         prop= RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
02862         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERALENS);
02863         RNA_def_property_ui_text(prop, "Stamp Lens", "Include the name of the active cameras lens in image metadata");
02864         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02865         
02866         prop= RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
02867         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
02868         RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
02869         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02870         
02871         prop= RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
02872         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
02873         RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
02874         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02875         
02876         prop= RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
02877         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
02878         RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
02879         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02880         
02881         prop= RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
02882         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
02883         RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
02884         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02885         
02886         prop= RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
02887         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
02888         RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
02889         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02890 
02891         prop= RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
02892         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
02893         RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
02894         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02895         
02896         prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
02897         RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
02898         RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
02899         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02900 
02901         prop= RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
02902         RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
02903         RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
02904         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02905         
02906         prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
02907         RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
02908         RNA_def_property_range(prop, 8, 64);
02909         RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
02910         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02911 
02912         prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
02913         RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
02914         RNA_def_property_array(prop, 4);
02915         RNA_def_property_range(prop,0.0,1.0);
02916         RNA_def_property_ui_text(prop, "Stamp Text Color", "Color to use for stamp text");
02917         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02918         
02919         prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
02920         RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
02921         RNA_def_property_array(prop, 4);
02922         RNA_def_property_range(prop,0.0,1.0);
02923         RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
02924         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02925 
02926         /* sequencer draw options */
02927 
02928         prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
02929         RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV);
02930         RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
02931 
02932         prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
02933         RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND);
02934         RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
02935 
02936 
02937         prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
02938         RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
02939         RNA_def_property_enum_items(prop, viewport_shade_items);
02940         RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
02941 
02942         prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
02943         RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
02944         RNA_def_property_enum_items(prop, viewport_shade_items);
02945         RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
02946 
02947         /* layers */
02948         
02949         prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
02950         RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
02951         RNA_def_property_struct_type(prop, "SceneRenderLayer");
02952         RNA_def_property_ui_text(prop, "Render Layers", "");
02953         rna_def_render_layers(brna, prop);
02954 
02955         
02956         prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
02957         RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
02958         RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
02959         RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
02960         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
02961 
02962         /* engine */
02963         prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
02964         RNA_def_property_enum_items(prop, engine_items);
02965         RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set", "rna_RenderSettings_engine_itemf");
02966         RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
02967         RNA_def_property_update(prop, NC_WINDOW, NULL);
02968 
02969         prop= RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
02970         RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
02971         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02972         RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
02973 
02974         prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
02975         RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
02976         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02977         RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine");
02978 
02979         /* simplify */
02980         prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
02981         RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
02982         RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
02983         RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
02984 
02985         prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
02986         RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
02987         RNA_def_property_ui_range(prop, 0, 6, 1, 0);
02988         RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
02989         RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
02990 
02991         prop= RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
02992         RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
02993         RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
02994         RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
02995 
02996         prop= RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
02997         RNA_def_property_int_sdna(prop, NULL, "simplify_shadowsamples");
02998         RNA_def_property_ui_range(prop, 1, 16, 1, 0);
02999         RNA_def_property_ui_text(prop, "Simplify Shadow Samples", "Global maximum shadow samples");
03000         RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
03001 
03002         prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
03003         RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
03004         RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor");
03005         RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
03006 
03007         prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
03008         RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
03009         RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated");
03010 
03011         /* Scene API */
03012         RNA_api_scene_render(srna);
03013 }
03014 
03015 /* scene.objects */
03016 static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
03017 {
03018         StructRNA *srna;
03019         PropertyRNA *prop;
03020 
03021         FunctionRNA *func;
03022         PropertyRNA *parm;
03023         
03024         RNA_def_property_srna(cprop, "SceneObjects");
03025         srna= RNA_def_struct(brna, "SceneObjects", NULL);
03026         RNA_def_struct_sdna(srna, "Scene");
03027         RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
03028 
03029         func= RNA_def_function(srna, "link", "rna_Scene_object_link");
03030         RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after.");
03031         RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
03032         parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
03033         RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
03034         parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
03035         RNA_def_function_return(func, parm);
03036 
03037         func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
03038         RNA_def_function_ui_description(func, "Unlink object from scene.");
03039         RNA_def_function_flag(func, FUNC_USE_REPORTS);
03040         parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
03041         RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
03042 
03043         prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
03044         RNA_def_property_struct_type(prop, "Object");
03045         RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL, NULL);
03046         RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
03047         RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene");
03048         /* Could call: ED_base_object_activate(C, scene->basact);
03049          * but would be a bad level call and it seems the notifier is enough */
03050         RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
03051 }
03052 
03053 
03054 /* scene.bases.* */
03055 static void rna_def_scene_bases(BlenderRNA *brna, PropertyRNA *cprop)
03056 {
03057         StructRNA *srna;
03058         PropertyRNA *prop;
03059 
03060 //      FunctionRNA *func;
03061 //      PropertyRNA *parm;
03062 
03063         RNA_def_property_srna(cprop, "SceneBases");
03064         srna= RNA_def_struct(brna, "SceneBases", NULL);
03065         RNA_def_struct_sdna(srna, "Scene");
03066         RNA_def_struct_ui_text(srna, "Scene Bases", "Collection of scene bases");
03067 
03068         prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
03069         RNA_def_property_struct_type(prop, "ObjectBase");
03070         RNA_def_property_pointer_sdna(prop, NULL, "basact");
03071         RNA_def_property_flag(prop, PROP_EDITABLE);
03072         RNA_def_property_ui_text(prop, "Active Base", "Active object base in the scene");
03073         RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
03074 }
03075 
03076 /* scene.timeline_markers */
03077 static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
03078 {
03079         StructRNA *srna;
03080 
03081         FunctionRNA *func;
03082         PropertyRNA *parm;
03083 
03084         RNA_def_property_srna(cprop, "TimelineMarkers");
03085         srna= RNA_def_struct(brna, "TimelineMarkers", NULL);
03086         RNA_def_struct_sdna(srna, "Scene");
03087         RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
03088 
03089         func= RNA_def_function(srna, "new", "rna_TimeLine_add");
03090         RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
03091         parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
03092         RNA_def_property_flag(parm, PROP_REQUIRED);
03093 
03094         parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
03095         RNA_def_function_return(func, parm);
03096 
03097 
03098         func= RNA_def_function(srna, "remove", "rna_TimeLine_remove");
03099         RNA_def_function_ui_description(func, "Remove a timeline marker.");
03100         RNA_def_function_flag(func, FUNC_USE_REPORTS);
03101         parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
03102         RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
03103 }
03104 
03105 /* scene.keying_sets */
03106 static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
03107 {
03108         StructRNA *srna;
03109         PropertyRNA *prop;
03110 
03111         FunctionRNA *func;
03112         PropertyRNA *parm;
03113 
03114         RNA_def_property_srna(cprop, "KeyingSets");
03115         srna= RNA_def_struct(brna, "KeyingSets", NULL);
03116         RNA_def_struct_sdna(srna, "Scene");
03117         RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
03118 
03119         /* Add Keying Set */
03120         func= RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
03121         RNA_def_function_ui_description(func, "Add a new Keying Set to Scene.");
03122         RNA_def_function_flag(func, FUNC_USE_REPORTS);
03123         /* name */
03124         RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
03125 
03126         /* returns the new KeyingSet */
03127         parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set.");
03128         RNA_def_function_return(func, parm);
03129 
03130         prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
03131         RNA_def_property_struct_type(prop, "KeyingSet");
03132         RNA_def_property_flag(prop, PROP_EDITABLE);
03133         RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
03134         RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
03135         RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
03136         
03137         prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
03138         RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
03139         RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
03140         RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
03141         RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
03142 }
03143 
03144 static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
03145 {
03146         StructRNA *srna;
03147         PropertyRNA *prop;
03148         
03149         RNA_def_property_srna(cprop, "KeyingSetsAll");
03150         srna= RNA_def_struct(brna, "KeyingSetsAll", NULL);
03151         RNA_def_struct_sdna(srna, "Scene");
03152         RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
03153         
03154         /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
03155         
03156         prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
03157         RNA_def_property_struct_type(prop, "KeyingSet");
03158         RNA_def_property_flag(prop, PROP_EDITABLE);
03159         RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
03160         RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
03161         RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
03162         
03163         prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
03164         RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
03165         RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
03166         RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
03167         RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
03168 }
03169 
03170 void RNA_def_scene(BlenderRNA *brna)
03171 {
03172         StructRNA *srna;
03173         PropertyRNA *prop;
03174         FunctionRNA *func;
03175         
03176         static EnumPropertyItem audio_distance_model_items[] = {
03177                 {0, "NONE", 0, "None", "No distance attenuation"},
03178                 {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
03179                 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
03180                 {3, "LINEAR", 0, "Linear", "Linear distance model"},
03181                 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
03182                 {5, "EXPONENT", 0, "Exponent", "Exponent distance model"},
03183                 {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping"},
03184                 {0, NULL, 0, NULL, NULL}};
03185 
03186         static EnumPropertyItem sync_mode_items[] = {
03187                 {0, "NONE", 0, "No Sync", "Do not sync, play every frame"},
03188                 {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
03189                 {AUDIO_SYNC, "AUDIO_SYNC", 0, "AV-sync", "Sync to audio playback, dropping frames"},
03190                 {0, NULL, 0, NULL, NULL}};
03191 
03192         /* Struct definition */
03193         srna= RNA_def_struct(brna, "Scene", "ID");
03194         RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings");
03195         RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
03196         RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
03197         
03198         /* Global Settings */
03199         prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
03200         RNA_def_property_flag(prop, PROP_EDITABLE);
03201         RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
03202         RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene");
03203         RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_view3d_update");
03204 
03205         prop= RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
03206         RNA_def_property_pointer_sdna(prop, NULL, "set");
03207         RNA_def_property_struct_type(prop, "Scene");
03208         RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
03209         RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL, NULL);
03210         RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
03211         RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
03212 
03213         prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
03214         RNA_def_property_flag(prop, PROP_EDITABLE);
03215         RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
03216         RNA_def_property_update(prop, NC_SCENE|ND_WORLD, NULL);
03217 
03218         prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
03219         RNA_def_property_float_sdna(prop, NULL, "cursor");
03220         RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location");
03221         RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
03222         RNA_def_property_update(prop, NC_WINDOW, NULL);
03223         
03224         /* Bases/Objects */
03225         prop= RNA_def_property(srna, "object_bases", PROP_COLLECTION, PROP_NONE);
03226         RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
03227         RNA_def_property_struct_type(prop, "ObjectBase");
03228         RNA_def_property_ui_text(prop, "Bases", "");
03229         RNA_def_property_collection_funcs(prop, 0, 0, 0, 0, 0, 0, "rna_Scene_object_bases_lookup_string");
03230         rna_def_scene_bases(brna, prop);
03231 
03232         prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
03233         RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
03234         RNA_def_property_struct_type(prop, "Object");
03235         RNA_def_property_ui_text(prop, "Objects", "");
03236         RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0);
03237         rna_def_scene_objects(brna, prop);
03238 
03239         /* Layers */
03240         prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
03241         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); // this seems to be too much trouble with depsgraph updates/etc. currently (20110420)
03242         RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
03243         RNA_def_property_array(prop, 20);
03244         RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
03245         RNA_def_property_ui_text(prop, "Layers", "Layers visible when rendering the scene");
03246         RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_layer_update");
03247         
03248         /* Frame Range Stuff */
03249         prop= RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
03250         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03251         RNA_def_property_int_sdna(prop, NULL, "r.cfra");
03252         RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
03253         RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL);
03254         RNA_def_property_ui_text(prop, "Current Frame", "Current Frame, to update animation data from python frame_set() instead");
03255         RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
03256         RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
03257         
03258         prop= RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME);
03259         RNA_def_property_float_sdna(prop, NULL, "r.subframe");
03260         RNA_def_property_ui_text(prop, "Current Sub-Frame", "");
03261         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
03262         
03263         prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
03264         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03265         RNA_def_property_int_sdna(prop, NULL, "r.sfra");
03266         RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
03267         RNA_def_property_range(prop, MINFRAME, MAXFRAME);
03268         RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
03269         RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL);
03270         
03271         prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
03272         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03273         RNA_def_property_int_sdna(prop, NULL, "r.efra");
03274         RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
03275         RNA_def_property_range(prop, MINFRAME, MAXFRAME);
03276         RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
03277         RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL);
03278         
03279         prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
03280         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03281         RNA_def_property_int_sdna(prop, NULL, "r.frame_step");
03282         RNA_def_property_range(prop, 0, MAXFRAME);
03283         RNA_def_property_ui_range(prop, 1, 100, 1, 0);
03284         RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
03285         RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
03286         
03287         /* Preview Range (frame-range for UI playback) */
03288         prop=RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE); 
03289         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03290         RNA_def_property_boolean_sdna(prop, NULL, "r.flag", SCER_PRV_RANGE);
03291         RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_preview_range_set");
03292         RNA_def_property_ui_text(prop, "Use Preview Range", "Use an alternative start/end frame for UI playback, rather than the scene start/end frame");
03293         RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
03294         RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
03295         
03296         prop= RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME);
03297         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03298         RNA_def_property_int_sdna(prop, NULL, "r.psfra");
03299         RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
03300         RNA_def_property_ui_text(prop, "Preview Range Start Frame", "Alternative start frame for UI playback");
03301         RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
03302         
03303         prop= RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME);
03304         RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03305         RNA_def_property_int_sdna(prop, NULL, "r.pefra");
03306         RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
03307         RNA_def_property_ui_text(prop, "Preview Range End Frame", "Alternative end frame for UI playback");
03308         RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
03309         
03310         /* Stamp */
03311         prop= RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
03312         RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
03313         RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping");
03314         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
03315         
03316         /* Animation Data (for Scene) */
03317         rna_def_animdata_common(srna);
03318         
03319         /* Readonly Properties */
03320         prop= RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE);
03321         RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_NLA_EDIT_ON);
03322         RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
03323         RNA_def_property_ui_text(prop, "NLA TweakMode", "Indicates whether there is any action referenced by NLA being edited. Strictly read-only");
03324         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
03325         
03326         /* Frame dropping flag for playback and sync enum */
03327         prop= RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
03328         RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_FRAME_DROP);
03329         RNA_def_property_ui_text(prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
03330         RNA_def_property_update(prop, NC_SCENE, NULL);
03331 
03332         prop= RNA_def_property(srna, "sync_mode", PROP_ENUM, PROP_NONE);
03333         RNA_def_property_enum_funcs(prop, "rna_Scene_sync_mode_get", "rna_Scene_sync_mode_set", NULL);
03334         RNA_def_property_enum_items(prop, sync_mode_items);
03335         RNA_def_property_ui_text(prop, "Sync Mode", "How to sync playback");
03336         RNA_def_property_update(prop, NC_SCENE, NULL);
03337 
03338 
03339         /* Nodes (Compositing) */
03340         prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
03341         RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
03342         RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree");
03343 
03344         prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
03345         RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
03346         RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_nodes_set");
03347         RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree");
03348         RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
03349         
03350         /* Sequencer */
03351         prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
03352         RNA_def_property_pointer_sdna(prop, NULL, "ed");
03353         RNA_def_property_struct_type(prop, "SequenceEditor");
03354         RNA_def_property_ui_text(prop, "Sequence Editor", "");
03355         
03356         /* Keying Sets */
03357         prop= RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
03358         RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
03359         RNA_def_property_struct_type(prop, "KeyingSet");
03360         RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene");
03361         RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
03362         rna_def_scene_keying_sets(brna, prop);
03363         
03364         prop= RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE);
03365         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);
03366         RNA_def_property_struct_type(prop, "KeyingSet");
03367         RNA_def_property_ui_text(prop, "All Keying Sets", "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)");
03368         RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
03369         rna_def_scene_keying_sets_all(brna, prop);
03370         
03371         /* Tool Settings */
03372         prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
03373         RNA_def_property_flag(prop, PROP_NEVER_NULL);
03374         RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
03375         RNA_def_property_struct_type(prop, "ToolSettings");
03376         RNA_def_property_ui_text(prop, "Tool Settings", "");
03377 
03378         /* Unit Settings */
03379         prop= RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
03380         RNA_def_property_flag(prop, PROP_NEVER_NULL);
03381         RNA_def_property_pointer_sdna(prop, NULL, "unit");
03382         RNA_def_property_struct_type(prop, "UnitSettings");
03383         RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
03384 
03385         /* Physics Settings */
03386         prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
03387         RNA_def_property_float_sdna(prop, NULL, "physics_settings.gravity");
03388         RNA_def_property_array(prop, 3);
03389         RNA_def_property_range(prop, -200.0f, 200.0f);
03390         RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
03391         RNA_def_property_update(prop, 0, "rna_Physics_update");
03392 
03393         prop= RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
03394         RNA_def_property_boolean_sdna(prop, NULL, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
03395         RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics");
03396         RNA_def_property_update(prop, 0, "rna_Physics_update");
03397         
03398         /* Render Data */
03399         prop= RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
03400         RNA_def_property_flag(prop, PROP_NEVER_NULL);
03401         RNA_def_property_pointer_sdna(prop, NULL, "r");
03402         RNA_def_property_struct_type(prop, "RenderSettings");
03403         RNA_def_property_ui_text(prop, "Render Data", "");
03404         
03405         /* Markers */
03406         prop= RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
03407         RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
03408         RNA_def_property_struct_type(prop, "TimelineMarker");
03409         RNA_def_property_ui_text(prop, "Timeline Markers", "Markers used in all timelines for the current scene");
03410         rna_def_timeline_markers(brna, prop);
03411 
03412         /* Audio Settings */
03413         prop= RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE);
03414         RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set");
03415         RNA_def_property_ui_text(prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted");
03416         RNA_def_property_update(prop, NC_SCENE, NULL);
03417 
03418         prop= RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
03419         RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
03420         RNA_def_property_ui_text(prop, "Audio Sync", "Play back and sync with audio clock, dropping frames if frame display is too slow");
03421         RNA_def_property_update(prop, NC_SCENE, NULL);
03422 
03423         prop= RNA_def_property(srna, "use_audio_scrub", PROP_BOOLEAN, PROP_NONE);
03424         RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SCRUB);
03425         RNA_def_property_ui_text(prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing");
03426         RNA_def_property_update(prop, NC_SCENE, NULL);
03427 
03428         prop= RNA_def_property(srna, "audio_doppler_speed", PROP_FLOAT, PROP_NONE);
03429         RNA_def_property_float_sdna(prop, NULL, "audio.speed_of_sound");
03430         RNA_def_property_range(prop, 0.01f, FLT_MAX);
03431         RNA_def_property_ui_text(prop, "Speed of Sound", "Speed of sound for Doppler effect calculation");
03432         RNA_def_property_update(prop, NC_SCENE, NULL);
03433 
03434         prop= RNA_def_property(srna, "audio_doppler_factor", PROP_FLOAT, PROP_NONE);
03435         RNA_def_property_float_sdna(prop, NULL, "audio.doppler_factor");
03436         RNA_def_property_range(prop, 0.0, FLT_MAX);
03437         RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for Doppler effect calculation");
03438         RNA_def_property_update(prop, NC_SCENE, NULL);
03439 
03440         prop= RNA_def_property(srna, "audio_distance_model", PROP_ENUM, PROP_NONE);
03441         RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio.distance_model");
03442         RNA_def_property_enum_items(prop, audio_distance_model_items);
03443         RNA_def_property_ui_text(prop, "Distance Model", "Distance model for distance attenuation calculation");
03444         RNA_def_property_update(prop, NC_SCENE, NULL);
03445 
03446         /* Game Settings */
03447         prop= RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE);
03448         RNA_def_property_flag(prop, PROP_NEVER_NULL);
03449         RNA_def_property_pointer_sdna(prop, NULL, "gm");
03450         RNA_def_property_struct_type(prop, "SceneGameData");
03451         RNA_def_property_ui_text(prop, "Game Data", "");
03452 
03453         /* Statistics */
03454         func= RNA_def_function(srna, "statistics", "ED_info_stats_string");
03455         prop= RNA_def_string(func, "statistics", "", 0, "Statistics", "");
03456         RNA_def_function_return(func, prop);
03457         
03458         /* Grease Pencil */
03459         prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
03460         RNA_def_property_pointer_sdna(prop, NULL, "gpd");
03461         RNA_def_property_flag(prop, PROP_EDITABLE);
03462         RNA_def_property_struct_type(prop, "GreasePencil");
03463         RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock");
03464         
03465         /* Transform Orientations */
03466         prop= RNA_def_property(srna, "orientations", PROP_COLLECTION, PROP_NONE);
03467         RNA_def_property_collection_sdna(prop, NULL, "transform_spaces", NULL);
03468         RNA_def_property_struct_type(prop, "TransformOrientation");
03469         RNA_def_property_ui_text(prop, "Transform Orientations", "");
03470 
03471         /* Nestled Data  */
03472         rna_def_tool_settings(brna);
03473         rna_def_unit_settings(brna);
03474         rna_def_scene_render_data(brna);
03475         rna_def_scene_game_data(brna);
03476         rna_def_scene_render_layer(brna);
03477         rna_def_transform_orientation(brna);
03478         
03479         /* Scene API */
03480         RNA_api_scene(srna);
03481 }
03482 
03483 #endif
03484