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