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 * The Original Code is Copyright (C) 2009 Blender Foundation. 00019 * All rights reserved. 00020 * 00021 * 00022 * Contributor(s): Blender Foundation 00023 * 00024 * ***** END GPL LICENSE BLOCK ***** 00025 */ 00026 00032 #include <stdlib.h> 00033 #include <stdio.h> 00034 #include <errno.h> 00035 00036 #include "RNA_define.h" 00037 #include "RNA_access.h" 00038 #include "RNA_enum_types.h" 00039 #include "rna_internal.h" 00040 00041 #include "BKE_utildefines.h" 00042 00043 #ifdef RNA_RUNTIME 00044 00045 #include "BKE_main.h" 00046 #include "BKE_camera.h" 00047 #include "BKE_curve.h" 00048 #include "BKE_mesh.h" 00049 #include "BKE_armature.h" 00050 #include "BKE_lamp.h" 00051 #include "BKE_library.h" 00052 #include "BKE_object.h" 00053 #include "BKE_material.h" 00054 #include "BKE_image.h" 00055 #include "BKE_texture.h" 00056 #include "BKE_scene.h" 00057 #include "BKE_text.h" 00058 #include "BKE_action.h" 00059 #include "BKE_group.h" 00060 #include "BKE_brush.h" 00061 #include "BKE_lattice.h" 00062 #include "BKE_mball.h" 00063 #include "BKE_world.h" 00064 #include "BKE_particle.h" 00065 #include "BKE_font.h" 00066 #include "BKE_node.h" 00067 #include "BKE_depsgraph.h" 00068 #include "BKE_speaker.h" 00069 #include "BKE_movieclip.h" 00070 00071 #include "DNA_armature_types.h" 00072 #include "DNA_camera_types.h" 00073 #include "DNA_curve_types.h" 00074 #include "DNA_lamp_types.h" 00075 #include "DNA_material_types.h" 00076 #include "DNA_mesh_types.h" 00077 #include "DNA_object_types.h" 00078 #include "DNA_speaker_types.h" 00079 #include "DNA_text_types.h" 00080 #include "DNA_texture_types.h" 00081 #include "DNA_group_types.h" 00082 #include "DNA_brush_types.h" 00083 #include "DNA_lattice_types.h" 00084 #include "DNA_meta_types.h" 00085 #include "DNA_world_types.h" 00086 #include "DNA_particle_types.h" 00087 #include "DNA_vfont_types.h" 00088 #include "DNA_node_types.h" 00089 #include "DNA_movieclip_types.h" 00090 00091 #include "ED_screen.h" 00092 00093 Tex *rna_Main_add_texture(Main *UNUSED(bmain), const char *name) 00094 { 00095 return add_texture(name); 00096 } 00097 00098 Camera *rna_Main_cameras_new(Main *UNUSED(bmain), const char *name) 00099 { 00100 ID *id= add_camera(name); 00101 id_us_min(id); 00102 return (Camera *)id; 00103 } 00104 void rna_Main_cameras_remove(Main *bmain, ReportList *reports, struct Camera *camera) 00105 { 00106 if(ID_REAL_USERS(camera) <= 0) 00107 free_libblock(&bmain->camera, camera); 00108 else 00109 BKE_reportf(reports, RPT_ERROR, "Camera \"%s\" must have zero users to be removed, found %d", 00110 camera->id.name+2, ID_REAL_USERS(camera)); 00111 00112 /* XXX python now has invalid pointer? */ 00113 } 00114 00115 Scene *rna_Main_scenes_new(Main *UNUSED(bmain), const char *name) 00116 { 00117 return add_scene(name); 00118 } 00119 void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struct Scene *scene) 00120 { 00121 /* dont call free_libblock(...) directly */ 00122 Scene *newscene; 00123 00124 if(scene->id.prev) 00125 newscene= scene->id.prev; 00126 else if(scene->id.next) 00127 newscene= scene->id.next; 00128 else { 00129 BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed", scene->id.name+2); 00130 return; 00131 } 00132 00133 if(CTX_wm_screen(C)->scene == scene) 00134 ED_screen_set_scene(C, newscene); 00135 00136 unlink_scene(bmain, scene, newscene); 00137 } 00138 00139 Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, const char *name, ID *data) 00140 { 00141 Object *ob; 00142 int type= OB_EMPTY; 00143 if(data) { 00144 switch(GS(data->name)) { 00145 case ID_ME: 00146 type= OB_MESH; 00147 break; 00148 case ID_CU: 00149 type= curve_type((struct Curve *)data); 00150 break; 00151 case ID_MB: 00152 type= OB_MBALL; 00153 break; 00154 case ID_LA: 00155 type= OB_LAMP; 00156 break; 00157 case ID_SPK: 00158 type= OB_SPEAKER; 00159 break; 00160 case ID_CA: 00161 type= OB_CAMERA; 00162 break; 00163 case ID_LT: 00164 type= OB_LATTICE; 00165 break; 00166 case ID_AR: 00167 type= OB_ARMATURE; 00168 break; 00169 default: 00170 { 00171 const char *idname; 00172 if(RNA_enum_id_from_value(id_type_items, GS(data->name), &idname) == 0) 00173 idname= "UNKNOWN"; 00174 00175 BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for a object", idname); 00176 return NULL; 00177 } 00178 } 00179 00180 id_us_plus(data); 00181 } 00182 00183 ob= add_only_object(type, name); 00184 id_us_min(&ob->id); 00185 00186 ob->data= data; 00187 test_object_materials(ob->data); 00188 00189 return ob; 00190 } 00191 00192 void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *object) 00193 { 00194 if(ID_REAL_USERS(object) <= 0) { 00195 unlink_object(object); /* needed or ID pointers to this are not cleared */ 00196 free_libblock(&bmain->object, object); 00197 } 00198 else { 00199 BKE_reportf(reports, RPT_ERROR, "Object \"%s\" must have zero users to be removed, found %d", 00200 object->id.name+2, ID_REAL_USERS(object)); 00201 } 00202 } 00203 00204 struct Material *rna_Main_materials_new(Main *UNUSED(bmain), const char *name) 00205 { 00206 ID *id= (ID *)add_material(name); 00207 id_us_min(id); 00208 return (Material *)id; 00209 } 00210 void rna_Main_materials_remove(Main *bmain, ReportList *reports, struct Material *material) 00211 { 00212 if(ID_REAL_USERS(material) <= 0) 00213 free_libblock(&bmain->mat, material); 00214 else 00215 BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d", 00216 material->id.name+2, ID_REAL_USERS(material)); 00217 00218 /* XXX python now has invalid pointer? */ 00219 } 00220 00221 struct bNodeTree *rna_Main_nodetree_new(Main *UNUSED(bmain), const char *name, int type) 00222 { 00223 bNodeTree *tree = ntreeAddTree(name, type, NODE_GROUP); 00224 00225 id_us_min(&tree->id); 00226 return tree; 00227 } 00228 void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, struct bNodeTree *tree) 00229 { 00230 if(ID_REAL_USERS(tree) <= 0) 00231 free_libblock(&bmain->nodetree, tree); 00232 else 00233 BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d", 00234 tree->id.name+2, ID_REAL_USERS(tree)); 00235 00236 /* XXX python now has invalid pointer? */ 00237 } 00238 00239 Mesh *rna_Main_meshes_new(Main *UNUSED(bmain), const char *name) 00240 { 00241 Mesh *me= add_mesh(name); 00242 id_us_min(&me->id); 00243 return me; 00244 } 00245 void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh) 00246 { 00247 if(ID_REAL_USERS(mesh) <= 0) 00248 free_libblock(&bmain->mesh, mesh); 00249 else 00250 BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d", 00251 mesh->id.name+2, ID_REAL_USERS(mesh)); 00252 00253 /* XXX python now has invalid pointer? */ 00254 } 00255 00256 Lamp *rna_Main_lamps_new(Main *UNUSED(bmain), const char *name, int type) 00257 { 00258 Lamp *lamp= add_lamp(name); 00259 lamp->type= type; 00260 id_us_min(&lamp->id); 00261 return lamp; 00262 } 00263 void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp) 00264 { 00265 if(ID_REAL_USERS(lamp) <= 0) 00266 free_libblock(&bmain->lamp, lamp); 00267 else 00268 BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d", 00269 lamp->id.name+2, ID_REAL_USERS(lamp)); 00270 00271 /* XXX python now has invalid pointer? */ 00272 } 00273 00274 Image *rna_Main_images_new(Main *UNUSED(bmain), const char *name, int width, int height, int alpha, int float_buffer) 00275 { 00276 float color[4]= {0.0, 0.0, 0.0, 1.0}; 00277 Image *image= BKE_add_image_size(width, height, name, alpha ? 32:24, float_buffer, 0, color); 00278 id_us_min(&image->id); 00279 return image; 00280 } 00281 Image *rna_Main_images_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath) 00282 { 00283 Image *ima; 00284 00285 errno= 0; 00286 ima= BKE_add_image_file(filepath); 00287 00288 if(!ima) 00289 BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, 00290 errno ? strerror(errno) : "Unsupported image format"); 00291 00292 return ima; 00293 } 00294 void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image) 00295 { 00296 if(ID_REAL_USERS(image) <= 0) 00297 free_libblock(&bmain->image, image); 00298 else 00299 BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d", 00300 image->id.name+2, ID_REAL_USERS(image)); 00301 00302 /* XXX python now has invalid pointer? */ 00303 } 00304 00305 Lattice *rna_Main_lattices_new(Main *UNUSED(bmain), const char *name) 00306 { 00307 Lattice *lt= add_lattice(name); 00308 id_us_min(<->id); 00309 return lt; 00310 } 00311 void rna_Main_lattices_remove(Main *bmain, ReportList *reports, struct Lattice *lt) 00312 { 00313 if(ID_REAL_USERS(lt) <= 0) 00314 free_libblock(&bmain->latt, lt); 00315 else 00316 BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d", 00317 lt->id.name+2, ID_REAL_USERS(lt)); 00318 } 00319 00320 Curve *rna_Main_curves_new(Main *UNUSED(bmain), const char *name, int type) 00321 { 00322 Curve *cu= add_curve(name, type); 00323 id_us_min(&cu->id); 00324 return cu; 00325 } 00326 void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu) 00327 { 00328 if(ID_REAL_USERS(cu) <= 0) 00329 free_libblock(&bmain->curve, cu); 00330 else 00331 BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d", 00332 cu->id.name+2, ID_REAL_USERS(cu)); 00333 } 00334 00335 MetaBall *rna_Main_metaballs_new(Main *UNUSED(bmain), const char *name) 00336 { 00337 MetaBall *mb= add_mball(name); 00338 id_us_min(&mb->id); 00339 return mb; 00340 } 00341 void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall *mb) 00342 { 00343 if(ID_REAL_USERS(mb) <= 0) 00344 free_libblock(&bmain->mball, mb); 00345 else 00346 BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d", 00347 mb->id.name+2, ID_REAL_USERS(mb)); 00348 } 00349 00350 VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepath) 00351 { 00352 VFont *font; 00353 00354 errno= 0; 00355 font= load_vfont(bmain, filepath); 00356 00357 if(!font) 00358 BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, 00359 errno ? strerror(errno) : "Unsupported font format"); 00360 00361 return font; 00362 00363 } 00364 void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont) 00365 { 00366 if(ID_REAL_USERS(vfont) <= 0) 00367 free_libblock(&bmain->vfont, vfont); 00368 else 00369 BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d", 00370 vfont->id.name+2, ID_REAL_USERS(vfont)); 00371 00372 /* XXX python now has invalid pointer? */ 00373 } 00374 00375 Tex *rna_Main_textures_new(Main *UNUSED(bmain), const char *name, int type) 00376 { 00377 Tex *tex= add_texture(name); 00378 tex_set_type(tex, type); 00379 id_us_min(&tex->id); 00380 return tex; 00381 } 00382 void rna_Main_textures_remove(Main *bmain, ReportList *reports, struct Tex *tex) 00383 { 00384 if(ID_REAL_USERS(tex) <= 0) 00385 free_libblock(&bmain->tex, tex); 00386 else 00387 BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d", 00388 tex->id.name+2, ID_REAL_USERS(tex)); 00389 } 00390 00391 Brush *rna_Main_brushes_new(Main *UNUSED(bmain), const char *name) 00392 { 00393 Brush *brush = add_brush(name); 00394 id_us_min(&brush->id); 00395 return brush; 00396 } 00397 void rna_Main_brushes_remove(Main *bmain, ReportList *reports, struct Brush *brush) 00398 { 00399 if(ID_REAL_USERS(brush) <= 0) 00400 free_libblock(&bmain->brush, brush); 00401 else 00402 BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d", 00403 brush->id.name+2, ID_REAL_USERS(brush)); 00404 } 00405 00406 World *rna_Main_worlds_new(Main *UNUSED(bmain), const char *name) 00407 { 00408 World *world = add_world(name); 00409 id_us_min(&world->id); 00410 return world; 00411 } 00412 void rna_Main_worlds_remove(Main *bmain, ReportList *reports, struct World *world) 00413 { 00414 if(ID_REAL_USERS(world) <= 0) 00415 free_libblock(&bmain->world, world); 00416 else 00417 BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d", 00418 world->id.name+2, ID_REAL_USERS(world)); 00419 } 00420 00421 Group *rna_Main_groups_new(Main *UNUSED(bmain), const char *name) 00422 { 00423 return add_group(name); 00424 } 00425 void rna_Main_groups_remove(Main *bmain, Group *group) 00426 { 00427 unlink_group(group); 00428 free_libblock(&bmain->group, group); 00429 /* XXX python now has invalid pointer? */ 00430 } 00431 00432 Speaker *rna_Main_speakers_new(Main *UNUSED(bmain), const char *name) 00433 { 00434 Speaker *speaker= add_speaker(name); 00435 id_us_min(&speaker->id); 00436 return speaker; 00437 } 00438 void rna_Main_speakers_remove(Main *bmain, ReportList *reports, Speaker *speaker) 00439 { 00440 if(ID_REAL_USERS(speaker) <= 0) 00441 free_libblock(&bmain->speaker, speaker); 00442 else 00443 BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d", 00444 speaker->id.name+2, ID_REAL_USERS(speaker)); 00445 00446 /* XXX python now has invalid pointer? */ 00447 } 00448 00449 Text *rna_Main_texts_new(Main *UNUSED(bmain), const char *name) 00450 { 00451 return add_empty_text(name); 00452 } 00453 void rna_Main_texts_remove(Main *bmain, Text *text) 00454 { 00455 unlink_text(bmain, text); 00456 free_libblock(&bmain->text, text); 00457 /* XXX python now has invalid pointer? */ 00458 } 00459 00460 Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *filepath) 00461 { 00462 Text *txt; 00463 00464 errno= 0; 00465 txt= add_text(filepath, bmain->name); 00466 00467 if(!txt) 00468 BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, 00469 errno ? strerror(errno) : "Unable to load text"); 00470 00471 return txt; 00472 } 00473 00474 bArmature *rna_Main_armatures_new(Main *UNUSED(bmain), const char *name) 00475 { 00476 bArmature *arm= add_armature(name); 00477 id_us_min(&arm->id); 00478 return arm; 00479 } 00480 void rna_Main_armatures_remove(Main *bmain, ReportList *reports, bArmature *arm) 00481 { 00482 if(ID_REAL_USERS(arm) <= 0) 00483 free_libblock(&bmain->armature, arm); 00484 else 00485 BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d", 00486 arm->id.name+2, ID_REAL_USERS(arm)); 00487 00488 /* XXX python now has invalid pointer? */ 00489 } 00490 00491 bAction *rna_Main_actions_new(Main *UNUSED(bmain), const char *name) 00492 { 00493 bAction *act= add_empty_action(name); 00494 id_us_min(&act->id); 00495 act->id.flag &= ~LIB_FAKEUSER; 00496 return act; 00497 } 00498 void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act) 00499 { 00500 if(ID_REAL_USERS(act) <= 0) 00501 free_libblock(&bmain->action, act); 00502 else 00503 BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d", 00504 act->id.name+2, ID_REAL_USERS(act)); 00505 00506 /* XXX python now has invalid pointer? */ 00507 } 00508 00509 ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name) 00510 { 00511 ParticleSettings *part = psys_new_settings(name, bmain); 00512 id_us_min(&part->id); 00513 return part; 00514 } 00515 void rna_Main_particles_remove(Main *bmain, ReportList *reports, ParticleSettings *part) 00516 { 00517 if(ID_REAL_USERS(part) <= 0) 00518 free_libblock(&bmain->particle, part); 00519 else 00520 BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d", 00521 part->id.name+2, ID_REAL_USERS(part)); 00522 00523 /* XXX python now has invalid pointer? */ 00524 } 00525 00526 MovieClip *rna_Main_movieclip_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath) 00527 { 00528 MovieClip *clip; 00529 00530 errno= 0; 00531 clip= BKE_add_movieclip_file(filepath); 00532 00533 if(!clip) 00534 BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to load movie clip"); 00535 00536 return clip; 00537 } 00538 00539 void rna_Main_movieclips_remove(Main *bmain, MovieClip *clip) 00540 { 00541 unlink_movieclip(bmain, clip); 00542 free_libblock(&bmain->movieclip, clip); 00543 /* XXX python now has invalid pointer? */ 00544 } 00545 00546 /* tag functions, all the same */ 00547 void rna_Main_cameras_tag(Main *bmain, int value) { tag_main_lb(&bmain->camera, value); } 00548 void rna_Main_scenes_tag(Main *bmain, int value) { tag_main_lb(&bmain->scene, value); } 00549 void rna_Main_objects_tag(Main *bmain, int value) { tag_main_lb(&bmain->object, value); } 00550 void rna_Main_materials_tag(Main *bmain, int value) { tag_main_lb(&bmain->mat, value); } 00551 void rna_Main_node_groups_tag(Main *bmain, int value) { tag_main_lb(&bmain->nodetree, value); } 00552 void rna_Main_meshes_tag(Main *bmain, int value) { tag_main_lb(&bmain->mesh, value); } 00553 void rna_Main_lamps_tag(Main *bmain, int value) { tag_main_lb(&bmain->lamp, value); } 00554 void rna_Main_libraries_tag(Main *bmain, int value) { tag_main_lb(&bmain->library, value); } 00555 void rna_Main_screens_tag(Main *bmain, int value) { tag_main_lb(&bmain->screen, value); } 00556 void rna_Main_window_managers_tag(Main *bmain, int value) { tag_main_lb(&bmain->wm, value); } 00557 void rna_Main_images_tag(Main *bmain, int value) { tag_main_lb(&bmain->image, value); } 00558 void rna_Main_lattices_tag(Main *bmain, int value) { tag_main_lb(&bmain->latt, value); } 00559 void rna_Main_curves_tag(Main *bmain, int value) { tag_main_lb(&bmain->curve, value); } 00560 void rna_Main_metaballs_tag(Main *bmain, int value) { tag_main_lb(&bmain->mball, value); } 00561 void rna_Main_fonts_tag(Main *bmain, int value) { tag_main_lb(&bmain->vfont, value); } 00562 void rna_Main_textures_tag(Main *bmain, int value) { tag_main_lb(&bmain->tex, value); } 00563 void rna_Main_brushes_tag(Main *bmain, int value) { tag_main_lb(&bmain->brush, value); } 00564 void rna_Main_worlds_tag(Main *bmain, int value) { tag_main_lb(&bmain->world, value); } 00565 void rna_Main_groups_tag(Main *bmain, int value) { tag_main_lb(&bmain->group, value); } 00566 void rna_Main_shape_keys_tag(Main *bmain, int value) { tag_main_lb(&bmain->key, value); } 00567 void rna_Main_scripts_tag(Main *bmain, int value) { tag_main_lb(&bmain->script, value); } 00568 void rna_Main_texts_tag(Main *bmain, int value) { tag_main_lb(&bmain->text, value); } 00569 void rna_Main_speakers_tag(Main *bmain, int value) { tag_main_lb(&bmain->speaker, value); } 00570 void rna_Main_sounds_tag(Main *bmain, int value) { tag_main_lb(&bmain->sound, value); } 00571 void rna_Main_armatures_tag(Main *bmain, int value) { tag_main_lb(&bmain->armature, value); } 00572 void rna_Main_actions_tag(Main *bmain, int value) { tag_main_lb(&bmain->action, value); } 00573 void rna_Main_particles_tag(Main *bmain, int value) { tag_main_lb(&bmain->particle, value); } 00574 void rna_Main_gpencil_tag(Main *bmain, int value) { tag_main_lb(&bmain->gpencil, value); } 00575 void rna_Main_movieclips_tag(Main *bmain, int value) { tag_main_lb(&bmain->movieclip, value); } 00576 00577 static int rna_Main_cameras_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CA); } 00578 static int rna_Main_scenes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCE); } 00579 static int rna_Main_objects_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_OB); } 00580 static int rna_Main_materials_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_MA); } 00581 static int rna_Main_node_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_NT); } 00582 static int rna_Main_meshes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_ME); } 00583 static int rna_Main_lamps_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LA); } 00584 static int rna_Main_libraries_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LI); } 00585 static int rna_Main_screens_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCR); } 00586 static int rna_Main_window_managers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WM); } 00587 static int rna_Main_images_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_IM); } 00588 static int rna_Main_lattices_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LT); } 00589 static int rna_Main_curves_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CU); } 00590 static int rna_Main_metaballs_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_MB); } 00591 static int rna_Main_fonts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_VF); } 00592 static int rna_Main_textures_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TE); } 00593 static int rna_Main_brushes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_BR); } 00594 static int rna_Main_worlds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WO); } 00595 static int rna_Main_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GR); } 00596 static int rna_Main_texts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TXT); } 00597 static int rna_Main_speakers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SPK); } 00598 static int rna_Main_sounds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SO); } 00599 static int rna_Main_armatures_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_AR); } 00600 static int rna_Main_actions_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_AC); } 00601 static int rna_Main_particles_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_PA); } 00602 static int rna_Main_gpencil_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GD); } 00603 00604 #else 00605 00606 void RNA_api_main(StructRNA *srna) 00607 { 00608 /* 00609 FunctionRNA *func; 00610 PropertyRNA *parm; 00611 */ 00612 /* maybe we want to add functions in 'bpy.data' still? 00613 * for now they are all in collections bpy.data.images.new(...) */ 00614 /* 00615 func= RNA_def_function(srna, "add_image", "rna_Main_add_image"); 00616 RNA_def_function_ui_description(func, "Add a new image"); 00617 parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from"); 00618 RNA_def_property_flag(parm, PROP_REQUIRED); 00619 parm= RNA_def_pointer(func, "image", "Image", "", "New image"); 00620 RNA_def_function_return(func, parm); 00621 */ 00622 00623 } 00624 00625 void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop) 00626 { 00627 StructRNA *srna; 00628 FunctionRNA *func; 00629 PropertyRNA *parm; 00630 PropertyRNA *prop; 00631 00632 RNA_def_property_srna(cprop, "BlendDataCameras"); 00633 srna= RNA_def_struct(brna, "BlendDataCameras", NULL); 00634 RNA_def_struct_sdna(srna, "Main"); 00635 RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras"); 00636 00637 func= RNA_def_function(srna, "new", "rna_Main_cameras_new"); 00638 RNA_def_function_ui_description(func, "Add a new camera to the main database"); 00639 parm= RNA_def_string(func, "name", "Camera", 0, "", "New name for the datablock"); 00640 RNA_def_property_flag(parm, PROP_REQUIRED); 00641 /* return type */ 00642 parm= RNA_def_pointer(func, "camera", "Camera", "", "New camera datablock"); 00643 RNA_def_function_return(func, parm); 00644 00645 func= RNA_def_function(srna, "remove", "rna_Main_cameras_remove"); 00646 RNA_def_function_flag(func, FUNC_USE_REPORTS); 00647 RNA_def_function_ui_description(func, "Remove a camera from the current blendfile"); 00648 parm= RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove"); 00649 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 00650 00651 func= RNA_def_function(srna, "tag", "rna_Main_cameras_tag"); 00652 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 00653 RNA_def_property_flag(parm, PROP_REQUIRED); 00654 00655 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00656 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00657 RNA_def_property_boolean_funcs(prop, "rna_Main_cameras_is_updated_get", NULL); 00658 } 00659 00660 void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop) 00661 { 00662 StructRNA *srna; 00663 FunctionRNA *func; 00664 PropertyRNA *parm; 00665 PropertyRNA *prop; 00666 00667 RNA_def_property_srna(cprop, "BlendDataScenes"); 00668 srna= RNA_def_struct(brna, "BlendDataScenes", NULL); 00669 RNA_def_struct_sdna(srna, "Main"); 00670 RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes"); 00671 00672 func= RNA_def_function(srna, "new", "rna_Main_scenes_new"); 00673 RNA_def_function_ui_description(func, "Add a new scene to the main database"); 00674 parm= RNA_def_string(func, "name", "Scene", 0, "", "New name for the datablock"); 00675 RNA_def_property_flag(parm, PROP_REQUIRED); 00676 /* return type */ 00677 parm= RNA_def_pointer(func, "scene", "Scene", "", "New scene datablock"); 00678 RNA_def_function_return(func, parm); 00679 00680 func= RNA_def_function(srna, "remove", "rna_Main_scenes_remove"); 00681 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); 00682 RNA_def_function_ui_description(func, "Remove a scene from the current blendfile"); 00683 parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove"); 00684 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 00685 00686 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00687 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00688 RNA_def_property_boolean_funcs(prop, "rna_Main_scenes_is_updated_get", NULL); 00689 } 00690 00691 void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop) 00692 { 00693 StructRNA *srna; 00694 FunctionRNA *func; 00695 PropertyRNA *parm; 00696 PropertyRNA *prop; 00697 00698 RNA_def_property_srna(cprop, "BlendDataObjects"); 00699 srna= RNA_def_struct(brna, "BlendDataObjects", NULL); 00700 RNA_def_struct_sdna(srna, "Main"); 00701 RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects"); 00702 00703 func= RNA_def_function(srna, "new", "rna_Main_objects_new"); 00704 RNA_def_function_flag(func, FUNC_USE_REPORTS); 00705 RNA_def_function_ui_description(func, "Add a new object to the main database"); 00706 parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock"); 00707 RNA_def_property_flag(parm, PROP_REQUIRED); 00708 parm= RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object"); 00709 RNA_def_property_flag(parm, PROP_REQUIRED); 00710 00711 /* return type */ 00712 parm= RNA_def_pointer(func, "object", "Object", "", "New object datablock"); 00713 RNA_def_function_return(func, parm); 00714 00715 func= RNA_def_function(srna, "remove", "rna_Main_objects_remove"); 00716 RNA_def_function_ui_description(func, "Remove a object from the current blendfile"); 00717 RNA_def_function_flag(func, FUNC_USE_REPORTS); 00718 parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove"); 00719 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 00720 00721 func= RNA_def_function(srna, "tag", "rna_Main_objects_tag"); 00722 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 00723 RNA_def_property_flag(parm, PROP_REQUIRED); 00724 00725 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00726 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00727 RNA_def_property_boolean_funcs(prop, "rna_Main_objects_is_updated_get", NULL); 00728 } 00729 00730 void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop) 00731 { 00732 StructRNA *srna; 00733 FunctionRNA *func; 00734 PropertyRNA *parm; 00735 PropertyRNA *prop; 00736 00737 RNA_def_property_srna(cprop, "BlendDataMaterials"); 00738 srna= RNA_def_struct(brna, "BlendDataMaterials", NULL); 00739 RNA_def_struct_sdna(srna, "Main"); 00740 RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials"); 00741 00742 func= RNA_def_function(srna, "new", "rna_Main_materials_new"); 00743 RNA_def_function_ui_description(func, "Add a new material to the main database"); 00744 parm= RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock"); 00745 RNA_def_property_flag(parm, PROP_REQUIRED); 00746 /* return type */ 00747 parm= RNA_def_pointer(func, "material", "Material", "", "New material datablock"); 00748 RNA_def_function_return(func, parm); 00749 00750 func= RNA_def_function(srna, "remove", "rna_Main_materials_remove"); 00751 RNA_def_function_flag(func, FUNC_USE_REPORTS); 00752 RNA_def_function_ui_description(func, "Remove a material from the current blendfile"); 00753 parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove"); 00754 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 00755 00756 func= RNA_def_function(srna, "tag", "rna_Main_materials_tag"); 00757 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 00758 RNA_def_property_flag(parm, PROP_REQUIRED); 00759 00760 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00761 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00762 RNA_def_property_boolean_funcs(prop, "rna_Main_materials_is_updated_get", NULL); 00763 } 00764 void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop) 00765 { 00766 StructRNA *srna; 00767 FunctionRNA *func; 00768 PropertyRNA *parm; 00769 PropertyRNA *prop; 00770 00771 static EnumPropertyItem node_nodetree_items[] = { 00772 {0, "SHADER", 0, "Shader", ""}, 00773 {1, "COMPOSITE", 0, "Composite", ""}, 00774 {2, "TEXTURE", 0, "Texture", ""}, 00775 {0, NULL, 0, NULL, NULL}}; 00776 00777 RNA_def_property_srna(cprop, "BlendDataNodeTrees"); 00778 srna= RNA_def_struct(brna, "BlendDataNodeTrees", NULL); 00779 RNA_def_struct_sdna(srna, "Main"); 00780 RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees"); 00781 00782 func= RNA_def_function(srna, "new", "rna_Main_nodetree_new"); 00783 RNA_def_function_ui_description(func, "Add a new node tree to the main database"); 00784 parm= RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the datablock"); 00785 RNA_def_property_flag(parm, PROP_REQUIRED); 00786 parm= RNA_def_enum(func, "type", node_nodetree_items, 0, "Type", "The type of node_group to add"); 00787 RNA_def_property_flag(parm, PROP_REQUIRED); 00788 /* return type */ 00789 parm= RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock"); 00790 RNA_def_function_return(func, parm); 00791 00792 func= RNA_def_function(srna, "remove", "rna_Main_nodetree_remove"); 00793 RNA_def_function_flag(func, FUNC_USE_REPORTS); 00794 RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile"); 00795 parm= RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove"); 00796 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 00797 00798 func= RNA_def_function(srna, "tag", "rna_Main_node_groups_tag"); 00799 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 00800 RNA_def_property_flag(parm, PROP_REQUIRED); 00801 00802 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00803 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00804 RNA_def_property_boolean_funcs(prop, "rna_Main_node_groups_is_updated_get", NULL); 00805 } 00806 void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop) 00807 { 00808 StructRNA *srna; 00809 FunctionRNA *func; 00810 PropertyRNA *parm; 00811 PropertyRNA *prop; 00812 00813 RNA_def_property_srna(cprop, "BlendDataMeshes"); 00814 srna= RNA_def_struct(brna, "BlendDataMeshes", NULL); 00815 RNA_def_struct_sdna(srna, "Main"); 00816 RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes"); 00817 00818 func= RNA_def_function(srna, "new", "rna_Main_meshes_new"); 00819 RNA_def_function_ui_description(func, "Add a new mesh to the main database"); 00820 parm= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock"); 00821 RNA_def_property_flag(parm, PROP_REQUIRED); 00822 /* return type */ 00823 parm= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock"); 00824 RNA_def_function_return(func, parm); 00825 00826 func= RNA_def_function(srna, "remove", "rna_Main_meshes_remove"); 00827 RNA_def_function_flag(func, FUNC_USE_REPORTS); 00828 RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile"); 00829 parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove"); 00830 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 00831 00832 func= RNA_def_function(srna, "tag", "rna_Main_meshes_tag"); 00833 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 00834 RNA_def_property_flag(parm, PROP_REQUIRED); 00835 00836 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00837 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00838 RNA_def_property_boolean_funcs(prop, "rna_Main_meshes_is_updated_get", NULL); 00839 } 00840 void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop) 00841 { 00842 StructRNA *srna; 00843 FunctionRNA *func; 00844 PropertyRNA *parm; 00845 PropertyRNA *prop; 00846 00847 RNA_def_property_srna(cprop, "BlendDataLamps"); 00848 srna= RNA_def_struct(brna, "BlendDataLamps", NULL); 00849 RNA_def_struct_sdna(srna, "Main"); 00850 RNA_def_struct_ui_text(srna, "Main Lamps", "Collection of lamps"); 00851 00852 func= RNA_def_function(srna, "new", "rna_Main_lamps_new"); 00853 RNA_def_function_ui_description(func, "Add a new lamp to the main database"); 00854 parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock"); 00855 RNA_def_property_flag(parm, PROP_REQUIRED); 00856 parm= RNA_def_enum(func, "type", lamp_type_items, 0, "Type", "The type of texture to add"); 00857 RNA_def_property_flag(parm, PROP_REQUIRED); 00858 /* return type */ 00859 parm= RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock"); 00860 RNA_def_function_return(func, parm); 00861 00862 func= RNA_def_function(srna, "remove", "rna_Main_lamps_remove"); 00863 RNA_def_function_flag(func, FUNC_USE_REPORTS); 00864 RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile"); 00865 parm= RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove"); 00866 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 00867 00868 func= RNA_def_function(srna, "tag", "rna_Main_lamps_tag"); 00869 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 00870 RNA_def_property_flag(parm, PROP_REQUIRED); 00871 00872 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00873 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00874 RNA_def_property_boolean_funcs(prop, "rna_Main_lamps_is_updated_get", NULL); 00875 } 00876 00877 void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop) 00878 { 00879 StructRNA *srna; 00880 FunctionRNA *func; 00881 PropertyRNA *parm; 00882 PropertyRNA *prop; 00883 00884 RNA_def_property_srna(cprop, "BlendDataLibraries"); 00885 srna= RNA_def_struct(brna, "BlendDataLibraries", NULL); 00886 RNA_def_struct_sdna(srna, "Main"); 00887 RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries"); 00888 00889 func= RNA_def_function(srna, "tag", "rna_Main_libraries_tag"); 00890 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 00891 RNA_def_property_flag(parm, PROP_REQUIRED); 00892 00893 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00894 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00895 RNA_def_property_boolean_funcs(prop, "rna_Main_libraries_is_updated_get", NULL); 00896 } 00897 00898 void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop) 00899 { 00900 StructRNA *srna; 00901 FunctionRNA *func; 00902 PropertyRNA *parm; 00903 PropertyRNA *prop; 00904 00905 RNA_def_property_srna(cprop, "BlendDataScreens"); 00906 srna= RNA_def_struct(brna, "BlendDataScreens", NULL); 00907 RNA_def_struct_sdna(srna, "Main"); 00908 RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens"); 00909 00910 func= RNA_def_function(srna, "tag", "rna_Main_screens_tag"); 00911 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 00912 RNA_def_property_flag(parm, PROP_REQUIRED); 00913 00914 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00915 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00916 RNA_def_property_boolean_funcs(prop, "rna_Main_screens_is_updated_get", NULL); 00917 } 00918 00919 void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop) 00920 { 00921 StructRNA *srna; 00922 FunctionRNA *func; 00923 PropertyRNA *parm; 00924 PropertyRNA *prop; 00925 00926 RNA_def_property_srna(cprop, "BlendDataWindowManagers"); 00927 srna= RNA_def_struct(brna, "BlendDataWindowManagers", NULL); 00928 RNA_def_struct_sdna(srna, "Main"); 00929 RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers"); 00930 00931 func= RNA_def_function(srna, "tag", "rna_Main_window_managers_tag"); 00932 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 00933 RNA_def_property_flag(parm, PROP_REQUIRED); 00934 00935 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00936 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00937 RNA_def_property_boolean_funcs(prop, "rna_Main_window_managers_is_updated_get", NULL); 00938 } 00939 void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop) 00940 { 00941 StructRNA *srna; 00942 FunctionRNA *func; 00943 PropertyRNA *parm; 00944 PropertyRNA *prop; 00945 00946 RNA_def_property_srna(cprop, "BlendDataImages"); 00947 srna= RNA_def_struct(brna, "BlendDataImages", NULL); 00948 RNA_def_struct_sdna(srna, "Main"); 00949 RNA_def_struct_ui_text(srna, "Main Images", "Collection of images"); 00950 00951 func= RNA_def_function(srna, "new", "rna_Main_images_new"); 00952 RNA_def_function_ui_description(func, "Add a new image to the main database"); 00953 parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock"); 00954 RNA_def_property_flag(parm, PROP_REQUIRED); 00955 parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 0, INT_MAX); 00956 RNA_def_property_flag(parm, PROP_REQUIRED); 00957 parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 0, INT_MAX); 00958 RNA_def_property_flag(parm, PROP_REQUIRED); 00959 RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel"); 00960 RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color"); 00961 /* return type */ 00962 parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock"); 00963 RNA_def_function_return(func, parm); 00964 00965 func= RNA_def_function(srna, "load", "rna_Main_images_load"); 00966 RNA_def_function_flag(func, FUNC_USE_REPORTS); 00967 RNA_def_function_ui_description(func, "Load a new image into the main database"); 00968 parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the file to load"); 00969 RNA_def_property_flag(parm, PROP_REQUIRED); 00970 /* return type */ 00971 parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock"); 00972 RNA_def_function_return(func, parm); 00973 00974 func= RNA_def_function(srna, "remove", "rna_Main_images_remove"); 00975 RNA_def_function_flag(func, FUNC_USE_REPORTS); 00976 RNA_def_function_ui_description(func, "Remove an image from the current blendfile"); 00977 parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove"); 00978 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 00979 00980 func= RNA_def_function(srna, "tag", "rna_Main_images_tag"); 00981 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 00982 RNA_def_property_flag(parm, PROP_REQUIRED); 00983 00984 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 00985 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00986 RNA_def_property_boolean_funcs(prop, "rna_Main_images_is_updated_get", NULL); 00987 } 00988 00989 void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop) 00990 { 00991 StructRNA *srna; 00992 FunctionRNA *func; 00993 PropertyRNA *parm; 00994 PropertyRNA *prop; 00995 00996 RNA_def_property_srna(cprop, "BlendDataLattices"); 00997 srna= RNA_def_struct(brna, "BlendDataLattices", NULL); 00998 RNA_def_struct_sdna(srna, "Main"); 00999 RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices"); 01000 01001 func= RNA_def_function(srna, "new", "rna_Main_lattices_new"); 01002 RNA_def_function_ui_description(func, "Add a new lattice to the main database"); 01003 parm= RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock"); 01004 RNA_def_property_flag(parm, PROP_REQUIRED); 01005 /* return type */ 01006 parm= RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock"); 01007 RNA_def_function_return(func, parm); 01008 01009 func= RNA_def_function(srna, "remove", "rna_Main_lattices_remove"); 01010 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01011 RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile"); 01012 parm= RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove"); 01013 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01014 01015 func= RNA_def_function(srna, "tag", "rna_Main_lattices_tag"); 01016 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01017 RNA_def_property_flag(parm, PROP_REQUIRED); 01018 01019 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01020 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01021 RNA_def_property_boolean_funcs(prop, "rna_Main_lattices_is_updated_get", NULL); 01022 } 01023 void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop) 01024 { 01025 StructRNA *srna; 01026 FunctionRNA *func; 01027 PropertyRNA *parm; 01028 PropertyRNA *prop; 01029 01030 RNA_def_property_srna(cprop, "BlendDataCurves"); 01031 srna= RNA_def_struct(brna, "BlendDataCurves", NULL); 01032 RNA_def_struct_sdna(srna, "Main"); 01033 RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves"); 01034 01035 func= RNA_def_function(srna, "new", "rna_Main_curves_new"); 01036 RNA_def_function_ui_description(func, "Add a new curve to the main database"); 01037 parm= RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock"); 01038 RNA_def_property_flag(parm, PROP_REQUIRED); 01039 parm= RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve to add"); 01040 RNA_def_property_flag(parm, PROP_REQUIRED); 01041 /* return type */ 01042 parm= RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock"); 01043 RNA_def_function_return(func, parm); 01044 01045 func= RNA_def_function(srna, "remove", "rna_Main_curves_remove"); 01046 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01047 RNA_def_function_ui_description(func, "Remove a curve from the current blendfile"); 01048 parm= RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove"); 01049 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01050 01051 func= RNA_def_function(srna, "tag", "rna_Main_curves_tag"); 01052 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01053 RNA_def_property_flag(parm, PROP_REQUIRED); 01054 01055 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01056 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01057 RNA_def_property_boolean_funcs(prop, "rna_Main_curves_is_updated_get", NULL); 01058 } 01059 void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop) 01060 { 01061 StructRNA *srna; 01062 FunctionRNA *func; 01063 PropertyRNA *parm; 01064 PropertyRNA *prop; 01065 01066 RNA_def_property_srna(cprop, "BlendDataMetaBalls"); 01067 srna= RNA_def_struct(brna, "BlendDataMetaBalls", NULL); 01068 RNA_def_struct_sdna(srna, "Main"); 01069 RNA_def_struct_ui_text(srna, "Main MetaBalls", "Collection of metaballs"); 01070 01071 func= RNA_def_function(srna, "new", "rna_Main_metaballs_new"); 01072 RNA_def_function_ui_description(func, "Add a new metaball to the main database"); 01073 parm= RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock"); 01074 RNA_def_property_flag(parm, PROP_REQUIRED); 01075 /* return type */ 01076 parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock"); 01077 RNA_def_function_return(func, parm); 01078 01079 func= RNA_def_function(srna, "remove", "rna_Main_metaballs_remove"); 01080 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01081 RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile"); 01082 parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove"); 01083 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01084 01085 func= RNA_def_function(srna, "tag", "rna_Main_metaballs_tag"); 01086 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01087 RNA_def_property_flag(parm, PROP_REQUIRED); 01088 01089 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01090 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01091 RNA_def_property_boolean_funcs(prop, "rna_Main_metaballs_is_updated_get", NULL); 01092 } 01093 void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop) 01094 { 01095 StructRNA *srna; 01096 FunctionRNA *func; 01097 PropertyRNA *parm; 01098 PropertyRNA *prop; 01099 01100 RNA_def_property_srna(cprop, "BlendDataFonts"); 01101 srna= RNA_def_struct(brna, "BlendDataFonts", NULL); 01102 RNA_def_struct_sdna(srna, "Main"); 01103 RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts"); 01104 01105 func= RNA_def_function(srna, "load", "rna_Main_fonts_load"); 01106 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01107 RNA_def_function_ui_description(func, "Load a new font into the main database"); 01108 parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the font to load"); 01109 RNA_def_property_flag(parm, PROP_REQUIRED); 01110 /* return type */ 01111 parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock"); 01112 RNA_def_function_return(func, parm); 01113 01114 func= RNA_def_function(srna, "remove", "rna_Main_fonts_remove"); 01115 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01116 RNA_def_function_ui_description(func, "Remove a font from the current blendfile"); 01117 parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove"); 01118 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01119 01120 func= RNA_def_function(srna, "tag", "rna_Main_fonts_tag"); 01121 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01122 RNA_def_property_flag(parm, PROP_REQUIRED); 01123 01124 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01125 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01126 RNA_def_property_boolean_funcs(prop, "rna_Main_fonts_is_updated_get", NULL); 01127 } 01128 void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop) 01129 { 01130 StructRNA *srna; 01131 FunctionRNA *func; 01132 PropertyRNA *parm; 01133 PropertyRNA *prop; 01134 01135 RNA_def_property_srna(cprop, "BlendDataTextures"); 01136 srna= RNA_def_struct(brna, "BlendDataTextures", NULL); 01137 RNA_def_struct_sdna(srna, "Main"); 01138 RNA_def_struct_ui_text(srna, "Main Textures", "Collection of groups"); 01139 01140 func= RNA_def_function(srna, "new", "rna_Main_textures_new"); 01141 RNA_def_function_ui_description(func, "Add a new texture to the main database"); 01142 parm= RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock"); 01143 RNA_def_property_flag(parm, PROP_REQUIRED); 01144 parm= RNA_def_enum(func, "type", texture_type_items, 0, "Type", "The type of texture to add"); 01145 RNA_def_property_flag(parm, PROP_REQUIRED); 01146 /* return type */ 01147 parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock"); 01148 RNA_def_function_return(func, parm); 01149 01150 func= RNA_def_function(srna, "remove", "rna_Main_textures_remove"); 01151 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01152 RNA_def_function_ui_description(func, "Remove a texture from the current blendfile"); 01153 parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove"); 01154 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01155 01156 func= RNA_def_function(srna, "tag", "rna_Main_textures_tag"); 01157 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01158 RNA_def_property_flag(parm, PROP_REQUIRED); 01159 01160 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01161 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01162 RNA_def_property_boolean_funcs(prop, "rna_Main_textures_is_updated_get", NULL); 01163 } 01164 void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop) 01165 { 01166 StructRNA *srna; 01167 FunctionRNA *func; 01168 PropertyRNA *parm; 01169 PropertyRNA *prop; 01170 01171 RNA_def_property_srna(cprop, "BlendDataBrushes"); 01172 srna= RNA_def_struct(brna, "BlendDataBrushes", NULL); 01173 RNA_def_struct_sdna(srna, "Main"); 01174 RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes"); 01175 01176 func= RNA_def_function(srna, "new", "rna_Main_brushes_new"); 01177 RNA_def_function_ui_description(func, "Add a new brush to the main database"); 01178 parm= RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock"); 01179 RNA_def_property_flag(parm, PROP_REQUIRED); 01180 /* return type */ 01181 parm= RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock"); 01182 RNA_def_function_return(func, parm); 01183 01184 func= RNA_def_function(srna, "remove", "rna_Main_brushes_remove"); 01185 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01186 RNA_def_function_ui_description(func, "Remove a brush from the current blendfile"); 01187 parm= RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove"); 01188 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01189 01190 func= RNA_def_function(srna, "tag", "rna_Main_brushes_tag"); 01191 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01192 RNA_def_property_flag(parm, PROP_REQUIRED); 01193 01194 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01195 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01196 RNA_def_property_boolean_funcs(prop, "rna_Main_brushes_is_updated_get", NULL); 01197 } 01198 01199 void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop) 01200 { 01201 StructRNA *srna; 01202 FunctionRNA *func; 01203 PropertyRNA *parm; 01204 PropertyRNA *prop; 01205 01206 RNA_def_property_srna(cprop, "BlendDataWorlds"); 01207 srna= RNA_def_struct(brna, "BlendDataWorlds", NULL); 01208 RNA_def_struct_sdna(srna, "Main"); 01209 RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds"); 01210 01211 func= RNA_def_function(srna, "new", "rna_Main_worlds_new"); 01212 RNA_def_function_ui_description(func, "Add a new world to the main database"); 01213 parm= RNA_def_string(func, "name", "World", 0, "", "New name for the datablock"); 01214 RNA_def_property_flag(parm, PROP_REQUIRED); 01215 /* return type */ 01216 parm= RNA_def_pointer(func, "world", "World", "", "New world datablock"); 01217 RNA_def_function_return(func, parm); 01218 01219 func= RNA_def_function(srna, "remove", "rna_Main_worlds_remove"); 01220 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01221 RNA_def_function_ui_description(func, "Remove a world from the current blendfile"); 01222 parm= RNA_def_pointer(func, "world", "World", "", "World to remove"); 01223 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01224 01225 func= RNA_def_function(srna, "tag", "rna_Main_worlds_tag"); 01226 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01227 RNA_def_property_flag(parm, PROP_REQUIRED); 01228 01229 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01230 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01231 RNA_def_property_boolean_funcs(prop, "rna_Main_worlds_is_updated_get", NULL); 01232 } 01233 01234 void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop) 01235 { 01236 StructRNA *srna; 01237 FunctionRNA *func; 01238 PropertyRNA *parm; 01239 PropertyRNA *prop; 01240 01241 RNA_def_property_srna(cprop, "BlendDataGroups"); 01242 srna= RNA_def_struct(brna, "BlendDataGroups", NULL); 01243 RNA_def_struct_sdna(srna, "Main"); 01244 RNA_def_struct_ui_text(srna, "Main Groups", "Collection of groups"); 01245 01246 func= RNA_def_function(srna, "new", "rna_Main_groups_new"); 01247 RNA_def_function_ui_description(func, "Add a new group to the main database"); 01248 parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock"); 01249 RNA_def_property_flag(parm, PROP_REQUIRED); 01250 /* return type */ 01251 parm= RNA_def_pointer(func, "group", "Group", "", "New group datablock"); 01252 RNA_def_function_return(func, parm); 01253 01254 func= RNA_def_function(srna, "remove", "rna_Main_groups_remove"); 01255 RNA_def_function_ui_description(func, "Remove a group from the current blendfile"); 01256 parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove"); 01257 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01258 01259 func= RNA_def_function(srna, "tag", "rna_Main_groups_tag"); 01260 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01261 RNA_def_property_flag(parm, PROP_REQUIRED); 01262 01263 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01264 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01265 RNA_def_property_boolean_funcs(prop, "rna_Main_groups_is_updated_get", NULL); 01266 } 01267 01268 void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop) 01269 { 01270 StructRNA *srna; 01271 FunctionRNA *func; 01272 PropertyRNA *parm; 01273 PropertyRNA *prop; 01274 01275 RNA_def_property_srna(cprop, "BlendDataSpeakers"); 01276 srna= RNA_def_struct(brna, "BlendDataSpeakers", NULL); 01277 RNA_def_struct_sdna(srna, "Main"); 01278 RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers"); 01279 01280 func= RNA_def_function(srna, "new", "rna_Main_speakers_new"); 01281 RNA_def_function_ui_description(func, "Add a new speaker to the main database"); 01282 parm= RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock"); 01283 RNA_def_property_flag(parm, PROP_REQUIRED); 01284 /* return type */ 01285 parm= RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock"); 01286 RNA_def_function_return(func, parm); 01287 01288 func= RNA_def_function(srna, "remove", "rna_Main_speakers_remove"); 01289 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01290 RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile"); 01291 parm= RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove"); 01292 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01293 01294 func= RNA_def_function(srna, "tag", "rna_Main_speakers_tag"); 01295 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01296 RNA_def_property_flag(parm, PROP_REQUIRED); 01297 01298 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01299 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01300 RNA_def_property_boolean_funcs(prop, "rna_Main_speakers_is_updated_get", NULL); 01301 } 01302 01303 void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop) 01304 { 01305 StructRNA *srna; 01306 FunctionRNA *func; 01307 PropertyRNA *parm; 01308 PropertyRNA *prop; 01309 01310 RNA_def_property_srna(cprop, "BlendDataTexts"); 01311 srna= RNA_def_struct(brna, "BlendDataTexts", NULL); 01312 RNA_def_struct_sdna(srna, "Main"); 01313 RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts"); 01314 01315 func= RNA_def_function(srna, "new", "rna_Main_texts_new"); 01316 RNA_def_function_ui_description(func, "Add a new text to the main database"); 01317 parm= RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock"); 01318 RNA_def_property_flag(parm, PROP_REQUIRED); 01319 /* return type */ 01320 parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock"); 01321 RNA_def_function_return(func, parm); 01322 01323 func= RNA_def_function(srna, "remove", "rna_Main_texts_remove"); 01324 RNA_def_function_ui_description(func, "Remove a text from the current blendfile"); 01325 parm= RNA_def_pointer(func, "text", "Text", "", "Text to remove"); 01326 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01327 01328 /* load func */ 01329 func= RNA_def_function(srna, "load", "rna_Main_texts_load"); 01330 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01331 RNA_def_function_ui_description(func, "Add a new text to the main database from a file"); 01332 parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock"); 01333 RNA_def_property_flag(parm, PROP_REQUIRED); 01334 /* return type */ 01335 parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock"); 01336 RNA_def_function_return(func, parm); 01337 01338 func= RNA_def_function(srna, "tag", "rna_Main_texts_tag"); 01339 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01340 RNA_def_property_flag(parm, PROP_REQUIRED); 01341 01342 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01343 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01344 RNA_def_property_boolean_funcs(prop, "rna_Main_texts_is_updated_get", NULL); 01345 } 01346 01347 void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop) 01348 { 01349 StructRNA *srna; 01350 FunctionRNA *func; 01351 PropertyRNA *parm; 01352 PropertyRNA *prop; 01353 01354 RNA_def_property_srna(cprop, "BlendDataSounds"); 01355 srna= RNA_def_struct(brna, "BlendDataSounds", NULL); 01356 RNA_def_struct_sdna(srna, "Main"); 01357 RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds"); 01358 01359 /* TODO, 'load' */ 01360 01361 func= RNA_def_function(srna, "tag", "rna_Main_sounds_tag"); 01362 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01363 RNA_def_property_flag(parm, PROP_REQUIRED); 01364 01365 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01366 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01367 RNA_def_property_boolean_funcs(prop, "rna_Main_sounds_is_updated_get", NULL); 01368 } 01369 01370 void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop) 01371 { 01372 StructRNA *srna; 01373 FunctionRNA *func; 01374 PropertyRNA *parm; 01375 PropertyRNA *prop; 01376 01377 RNA_def_property_srna(cprop, "BlendDataArmatures"); 01378 srna= RNA_def_struct(brna, "BlendDataArmatures", NULL); 01379 RNA_def_struct_sdna(srna, "Main"); 01380 RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures"); 01381 01382 func= RNA_def_function(srna, "new", "rna_Main_armatures_new"); 01383 RNA_def_function_ui_description(func, "Add a new armature to the main database"); 01384 parm= RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock"); 01385 RNA_def_property_flag(parm, PROP_REQUIRED); 01386 /* return type */ 01387 parm= RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock"); 01388 RNA_def_function_return(func, parm); 01389 01390 func= RNA_def_function(srna, "remove", "rna_Main_armatures_remove"); 01391 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01392 RNA_def_function_ui_description(func, "Remove a armature from the current blendfile"); 01393 parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove"); 01394 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01395 01396 func= RNA_def_function(srna, "tag", "rna_Main_armatures_tag"); 01397 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01398 RNA_def_property_flag(parm, PROP_REQUIRED); 01399 01400 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01401 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01402 RNA_def_property_boolean_funcs(prop, "rna_Main_armatures_is_updated_get", NULL); 01403 } 01404 void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop) 01405 { 01406 StructRNA *srna; 01407 FunctionRNA *func; 01408 PropertyRNA *parm; 01409 PropertyRNA *prop; 01410 01411 RNA_def_property_srna(cprop, "BlendDataActions"); 01412 srna= RNA_def_struct(brna, "BlendDataActions", NULL); 01413 RNA_def_struct_sdna(srna, "Main"); 01414 RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions"); 01415 01416 func= RNA_def_function(srna, "new", "rna_Main_actions_new"); 01417 RNA_def_function_ui_description(func, "Add a new action to the main database"); 01418 parm= RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock"); 01419 RNA_def_property_flag(parm, PROP_REQUIRED); 01420 /* return type */ 01421 parm= RNA_def_pointer(func, "action", "Action", "", "New action datablock"); 01422 RNA_def_function_return(func, parm); 01423 01424 func= RNA_def_function(srna, "remove", "rna_Main_actions_remove"); 01425 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01426 RNA_def_function_ui_description(func, "Remove a action from the current blendfile"); 01427 parm= RNA_def_pointer(func, "action", "Action", "", "Action to remove"); 01428 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01429 01430 func= RNA_def_function(srna, "tag", "rna_Main_actions_tag"); 01431 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01432 RNA_def_property_flag(parm, PROP_REQUIRED); 01433 01434 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01435 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01436 RNA_def_property_boolean_funcs(prop, "rna_Main_actions_is_updated_get", NULL); 01437 } 01438 void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop) 01439 { 01440 StructRNA *srna; 01441 FunctionRNA *func; 01442 PropertyRNA *parm; 01443 PropertyRNA *prop; 01444 01445 RNA_def_property_srna(cprop, "BlendDataParticles"); 01446 srna= RNA_def_struct(brna, "BlendDataParticles", NULL); 01447 RNA_def_struct_sdna(srna, "Main"); 01448 RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings"); 01449 01450 func= RNA_def_function(srna, "new", "rna_Main_particles_new"); 01451 RNA_def_function_ui_description(func, "Add a new particle settings instance to the main database"); 01452 parm= RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock"); 01453 RNA_def_property_flag(parm, PROP_REQUIRED); 01454 /* return type */ 01455 parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock"); 01456 RNA_def_function_return(func, parm); 01457 01458 func= RNA_def_function(srna, "remove", "rna_Main_particles_remove"); 01459 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01460 RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile"); 01461 parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove"); 01462 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01463 01464 func= RNA_def_function(srna, "tag", "rna_Main_particles_tag"); 01465 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01466 RNA_def_property_flag(parm, PROP_REQUIRED); 01467 01468 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01469 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01470 RNA_def_property_boolean_funcs(prop, "rna_Main_particles_is_updated_get", NULL); 01471 } 01472 01473 void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop) 01474 { 01475 StructRNA *srna; 01476 FunctionRNA *func; 01477 PropertyRNA *parm; 01478 PropertyRNA *prop; 01479 01480 RNA_def_property_srna(cprop, "BlendDataGreasePencils"); 01481 srna= RNA_def_struct(brna, "BlendDataGreasePencils", NULL); 01482 RNA_def_struct_sdna(srna, "Main"); 01483 RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils"); 01484 01485 func= RNA_def_function(srna, "tag", "rna_Main_gpencil_tag"); 01486 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01487 RNA_def_property_flag(parm, PROP_REQUIRED); 01488 01489 prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); 01490 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01491 RNA_def_property_boolean_funcs(prop, "rna_Main_gpencil_is_updated_get", NULL); 01492 } 01493 01494 void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop) 01495 { 01496 StructRNA *srna; 01497 FunctionRNA *func; 01498 PropertyRNA *parm; 01499 01500 RNA_def_property_srna(cprop, "BlendDataMovieClips"); 01501 srna= RNA_def_struct(brna, "BlendDataMovieClips", NULL); 01502 RNA_def_struct_sdna(srna, "Main"); 01503 RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips"); 01504 01505 func= RNA_def_function(srna, "tag", "rna_Main_movieclips_tag"); 01506 parm= RNA_def_boolean(func, "value", 0, "Value", ""); 01507 RNA_def_property_flag(parm, PROP_REQUIRED); 01508 01509 func= RNA_def_function(srna, "remove", "rna_Main_movieclips_remove"); 01510 RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile."); 01511 parm= RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove"); 01512 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); 01513 01514 /* load func */ 01515 func= RNA_def_function(srna, "load", "rna_Main_movieclip_load"); 01516 RNA_def_function_flag(func, FUNC_USE_REPORTS); 01517 RNA_def_function_ui_description(func, "Add a new movie clip to the main database from a file"); 01518 parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock"); 01519 RNA_def_property_flag(parm, PROP_REQUIRED); 01520 /* return type */ 01521 parm= RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip datablock"); 01522 RNA_def_function_return(func, parm); 01523 } 01524 01525 #endif 01526