174
187
void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *object)
177
NOTE: the following example shows when this function should _not_ be called
179
ob = bpy.data.add_object()
183
scene.remove_object(ob)
185
# don't do this since ob is already freed!
186
bpy.data.remove_object(ob)
188
if(ID_REAL_USERS(object) <= 0)
189
if (ID_REAL_USERS(object) <= 0) {
190
unlink_object(object); /* needed or ID pointers to this are not cleared */
189
191
free_libblock(&bmain->object, object);
191
BKE_reportf(reports, RPT_ERROR, "Object \"%s\" must have zero users to be removed, found %d.", object->id.name+2, ID_REAL_USERS(object));
194
BKE_reportf(reports, RPT_ERROR, "Object \"%s\" must have zero users to be removed, found %d",
195
object->id.name+2, ID_REAL_USERS(object));
194
struct Material *rna_Main_materials_new(Main *bmain, char* name)
199
struct Material *rna_Main_materials_new(Main *UNUSED(bmain), const char *name)
196
return add_material(name);
201
ID *id = (ID *)add_material(name);
203
return (Material *)id;
198
205
void rna_Main_materials_remove(Main *bmain, ReportList *reports, struct Material *material)
200
if(ID_REAL_USERS(material) <= 0)
207
if (ID_REAL_USERS(material) <= 0)
201
208
free_libblock(&bmain->mat, material);
203
BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d.", material->id.name+2, ID_REAL_USERS(material));
210
BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d",
211
material->id.name+2, ID_REAL_USERS(material));
205
213
/* XXX python now has invalid pointer? */
208
// XXX, commended for now, need to see how this can be used with node groups.
209
struct bNodeTree *rna_Main_nodetree_new(Main *bmain, int type)
216
struct bNodeTree *rna_Main_nodetree_new(Main *UNUSED(bmain), const char *name, int type)
211
bNodeTree *tree = ntreeAddTree(type);
218
bNodeTree *tree = ntreeAddTree(name, type, NODE_GROUP);
220
id_us_min(&tree->id);
215
223
void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, struct bNodeTree *tree)
217
if(ID_REAL_USERS(tree) <= 0)
225
if (ID_REAL_USERS(tree) <= 0)
218
226
free_libblock(&bmain->nodetree, tree);
220
BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d.", tree->id.name+2, ID_REAL_USERS(tree));
228
BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d",
229
tree->id.name+2, ID_REAL_USERS(tree));
222
231
/* XXX python now has invalid pointer? */
225
Mesh *rna_Main_meshes_new(Main *bmain, char* name)
234
Mesh *rna_Main_meshes_new(Main *UNUSED(bmain), const char *name)
227
Mesh *me= add_mesh(name);
236
Mesh *me = add_mesh(name);
231
240
void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh)
233
if(ID_REAL_USERS(mesh) <= 0)
242
if (ID_REAL_USERS(mesh) <= 0)
234
243
free_libblock(&bmain->mesh, mesh);
236
BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d.", mesh->id.name+2, ID_REAL_USERS(mesh));
245
BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d",
246
mesh->id.name+2, ID_REAL_USERS(mesh));
238
248
/* XXX python now has invalid pointer? */
241
Lamp *rna_Main_lamps_new(Main *bmain, char* name)
251
Lamp *rna_Main_lamps_new(Main *UNUSED(bmain), const char *name, int type)
243
Lamp *lamp= add_lamp(name);
253
Lamp *lamp = add_lamp(name);
255
id_us_min(&lamp->id);
247
258
void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
249
if(ID_REAL_USERS(lamp) <= 0)
260
if (ID_REAL_USERS(lamp) <= 0)
250
261
free_libblock(&bmain->lamp, lamp);
252
BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d.", lamp->id.name+2, ID_REAL_USERS(lamp));
263
BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d",
264
lamp->id.name+2, ID_REAL_USERS(lamp));
254
266
/* XXX python now has invalid pointer? */
257
Image *rna_Main_images_new(Main *bmain, char* name, int width, int height, int alpha, int float_buffer)
269
Image *rna_Main_images_new(Main *UNUSED(bmain), const char *name, int width, int height, int alpha, int float_buffer)
259
float color[4]= {0.0, 0.0, 0.0, 1.0};
260
Image *image= BKE_add_image_size(width, height, name, alpha ? 32:24, float_buffer, 0, color);
271
float color[4] = {0.0, 0.0, 0.0, 1.0};
272
Image *image = BKE_add_image_size(width, height, name, alpha ? 32:24, float_buffer, 0, color);
273
id_us_min(&image->id);
264
Image *rna_Main_images_load(Main *bmain, ReportList *reports, char *filepath)
276
Image *rna_Main_images_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath)
269
ima= BKE_add_image_file(filepath, 0);
281
ima = BKE_add_image_file(filepath);
272
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported image format");
284
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
285
errno ? strerror(errno) : "Unsupported image format");
276
289
void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
278
if(ID_REAL_USERS(image) <= 0)
291
if (ID_REAL_USERS(image) <= 0)
279
292
free_libblock(&bmain->image, image);
281
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d.", image->id.name+2, ID_REAL_USERS(image));
294
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d",
295
image->id.name+2, ID_REAL_USERS(image));
283
297
/* XXX python now has invalid pointer? */
286
Lattice *rna_Main_lattices_new(Main *bmain, char* name)
300
Lattice *rna_Main_lattices_new(Main *UNUSED(bmain), const char *name)
288
Lattice *lt= add_lattice(name);
302
Lattice *lt = add_lattice(name);
292
306
void rna_Main_lattices_remove(Main *bmain, ReportList *reports, struct Lattice *lt)
294
if(ID_REAL_USERS(lt) <= 0)
308
if (ID_REAL_USERS(lt) <= 0)
295
309
free_libblock(&bmain->latt, lt);
297
BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d.", lt->id.name+2, ID_REAL_USERS(lt));
311
BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d",
312
lt->id.name+2, ID_REAL_USERS(lt));
300
Curve *rna_Main_curves_new(Main *bmain, char* name, int type)
315
Curve *rna_Main_curves_new(Main *UNUSED(bmain), const char *name, int type)
302
Curve *cu= add_curve(name, type);
317
Curve *cu = add_curve(name, type);
306
321
void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu)
308
if(ID_REAL_USERS(cu) <= 0)
323
if (ID_REAL_USERS(cu) <= 0)
309
324
free_libblock(&bmain->curve, cu);
311
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d.", cu->id.name+2, ID_REAL_USERS(cu));
326
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d",
327
cu->id.name+2, ID_REAL_USERS(cu));
314
MetaBall *rna_Main_metaballs_new(Main *bmain, char* name)
330
MetaBall *rna_Main_metaballs_new(Main *UNUSED(bmain), const char *name)
316
MetaBall *mb= add_mball(name);
332
MetaBall *mb = add_mball(name);
320
336
void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall *mb)
322
if(ID_REAL_USERS(mb) <= 0)
338
if (ID_REAL_USERS(mb) <= 0)
323
339
free_libblock(&bmain->mball, mb);
325
BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d.", mb->id.name+2, ID_REAL_USERS(mb));
341
BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" must have zero users to be removed, found %d",
342
mb->id.name+2, ID_REAL_USERS(mb));
328
VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, char *filepath)
345
VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepath)
333
font= load_vfont(filepath);
350
font = load_vfont(bmain, filepath);
336
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported font format");
353
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
354
errno ? strerror(errno) : "Unsupported font format");
341
359
void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont)
343
if(ID_REAL_USERS(vfont) <= 0)
361
if (ID_REAL_USERS(vfont) <= 0)
344
362
free_libblock(&bmain->vfont, vfont);
346
BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d.", vfont->id.name+2, ID_REAL_USERS(vfont));
364
BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d",
365
vfont->id.name+2, ID_REAL_USERS(vfont));
348
367
/* XXX python now has invalid pointer? */
351
Tex *rna_Main_textures_new(Main *bmain, char* name)
370
Tex *rna_Main_textures_new(Main *UNUSED(bmain), const char *name, int type)
353
Tex *tex= add_texture(name);
372
Tex *tex = add_texture(name);
373
tex_set_type(tex, type);
357
377
void rna_Main_textures_remove(Main *bmain, ReportList *reports, struct Tex *tex)
359
if(ID_REAL_USERS(tex) <= 0)
379
if (ID_REAL_USERS(tex) <= 0)
360
380
free_libblock(&bmain->tex, tex);
362
BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d.", tex->id.name+2, ID_REAL_USERS(tex));
382
BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d",
383
tex->id.name+2, ID_REAL_USERS(tex));
365
Brush *rna_Main_brushes_new(Main *bmain, char* name)
386
Brush *rna_Main_brushes_new(Main *UNUSED(bmain), const char *name)
367
388
Brush *brush = add_brush(name);
389
id_us_min(&brush->id);
371
392
void rna_Main_brushes_remove(Main *bmain, ReportList *reports, struct Brush *brush)
373
if(ID_REAL_USERS(brush) <= 0)
394
if (ID_REAL_USERS(brush) <= 0)
374
395
free_libblock(&bmain->brush, brush);
376
BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d.", brush->id.name+2, ID_REAL_USERS(brush));
397
BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d",
398
brush->id.name+2, ID_REAL_USERS(brush));
379
World *rna_Main_worlds_new(Main *bmain, char* name)
401
World *rna_Main_worlds_new(Main *UNUSED(bmain), const char *name)
381
403
World *world = add_world(name);
404
id_us_min(&world->id);
385
407
void rna_Main_worlds_remove(Main *bmain, ReportList *reports, struct World *world)
387
if(ID_REAL_USERS(world) <= 0)
409
if (ID_REAL_USERS(world) <= 0)
388
410
free_libblock(&bmain->world, world);
390
BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d.", world->id.name+2, ID_REAL_USERS(world));
412
BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d",
413
world->id.name+2, ID_REAL_USERS(world));
393
Group *rna_Main_groups_new(Main *bmain, char* name)
416
Group *rna_Main_groups_new(Main *UNUSED(bmain), const char *name)
395
418
return add_group(name);
397
void rna_Main_groups_remove(Main *bmain, ReportList *reports, Group *group)
420
void rna_Main_groups_remove(Main *bmain, Group *group)
399
422
unlink_group(group);
400
423
free_libblock(&bmain->group, group);
401
424
/* XXX python now has invalid pointer? */
404
Text *rna_Main_texts_new(Main *bmain, char* name)
427
Speaker *rna_Main_speakers_new(Main *UNUSED(bmain), const char *name)
429
Speaker *speaker = add_speaker(name);
430
id_us_min(&speaker->id);
433
void rna_Main_speakers_remove(Main *bmain, ReportList *reports, Speaker *speaker)
435
if (ID_REAL_USERS(speaker) <= 0)
436
free_libblock(&bmain->speaker, speaker);
438
BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d",
439
speaker->id.name+2, ID_REAL_USERS(speaker));
441
/* XXX python now has invalid pointer? */
444
Text *rna_Main_texts_new(Main *UNUSED(bmain), const char *name)
406
446
return add_empty_text(name);
408
void rna_Main_texts_remove(Main *bmain, ReportList *reports, Text *text)
448
void rna_Main_texts_remove(Main *bmain, Text *text)
410
450
unlink_text(bmain, text);
411
451
free_libblock(&bmain->text, text);
412
452
/* XXX python now has invalid pointer? */
415
Text *rna_Main_texts_load(Main *bmain, ReportList *reports, char* filepath)
455
Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *filepath)
420
txt= add_text(filepath, bmain->name);
460
txt = add_text(filepath, bmain->name);
423
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to load text");
463
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
464
errno ? strerror(errno) : "Unable to load text");
428
bArmature *rna_Main_armatures_new(Main *bmain, char* name)
469
bArmature *rna_Main_armatures_new(Main *UNUSED(bmain), const char *name)
430
bArmature *arm= add_armature(name);
471
bArmature *arm = add_armature(name);
434
475
void rna_Main_armatures_remove(Main *bmain, ReportList *reports, bArmature *arm)
436
if(ID_REAL_USERS(arm) <= 0)
477
if (ID_REAL_USERS(arm) <= 0)
437
478
free_libblock(&bmain->armature, arm);
439
BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d.", arm->id.name+2, ID_REAL_USERS(arm));
480
BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d",
481
arm->id.name+2, ID_REAL_USERS(arm));
441
483
/* XXX python now has invalid pointer? */
444
bAction *rna_Main_actions_new(Main *bmain, char* name)
486
bAction *rna_Main_actions_new(Main *UNUSED(bmain), const char *name)
446
bAction *act= add_empty_action(name);
488
bAction *act = add_empty_action(name);
448
490
act->id.flag &= ~LIB_FAKEUSER;
451
493
void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act)
453
if(ID_REAL_USERS(act) <= 0)
495
if (ID_REAL_USERS(act) <= 0)
454
496
free_libblock(&bmain->action, act);
456
BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d.", act->id.name+2, ID_REAL_USERS(act));
498
BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d",
499
act->id.name+2, ID_REAL_USERS(act));
458
501
/* XXX python now has invalid pointer? */
461
ParticleSettings *rna_Main_particles_new(Main *bmain, char* name)
504
ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
463
506
ParticleSettings *part = psys_new_settings(name, bmain);
507
id_us_min(&part->id);
467
510
void rna_Main_particles_remove(Main *bmain, ReportList *reports, ParticleSettings *part)
469
if(ID_REAL_USERS(part) <= 0)
512
if (ID_REAL_USERS(part) <= 0)
470
513
free_libblock(&bmain->particle, part);
472
BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d.", part->id.name+2, ID_REAL_USERS(part));
474
/* XXX python now has invalid pointer? */
515
BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d",
516
part->id.name+2, ID_REAL_USERS(part));
518
/* XXX python now has invalid pointer? */
521
MovieClip *rna_Main_movieclip_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath)
526
clip = BKE_add_movieclip_file(filepath);
529
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath,
530
errno ? strerror(errno) : "Unable to load movie clip");
535
void rna_Main_movieclips_remove(Main *bmain, MovieClip *clip)
537
unlink_movieclip(bmain, clip);
538
free_libblock(&bmain->movieclip, clip);
539
/* XXX python now has invalid pointer? */
542
/* tag functions, all the same */
543
void rna_Main_cameras_tag(Main *bmain, int value) { tag_main_lb(&bmain->camera, value); }
544
void rna_Main_scenes_tag(Main *bmain, int value) { tag_main_lb(&bmain->scene, value); }
545
void rna_Main_objects_tag(Main *bmain, int value) { tag_main_lb(&bmain->object, value); }
546
void rna_Main_materials_tag(Main *bmain, int value) { tag_main_lb(&bmain->mat, value); }
547
void rna_Main_node_groups_tag(Main *bmain, int value) { tag_main_lb(&bmain->nodetree, value); }
548
void rna_Main_meshes_tag(Main *bmain, int value) { tag_main_lb(&bmain->mesh, value); }
549
void rna_Main_lamps_tag(Main *bmain, int value) { tag_main_lb(&bmain->lamp, value); }
550
void rna_Main_libraries_tag(Main *bmain, int value) { tag_main_lb(&bmain->library, value); }
551
void rna_Main_screens_tag(Main *bmain, int value) { tag_main_lb(&bmain->screen, value); }
552
void rna_Main_window_managers_tag(Main *bmain, int value) { tag_main_lb(&bmain->wm, value); }
553
void rna_Main_images_tag(Main *bmain, int value) { tag_main_lb(&bmain->image, value); }
554
void rna_Main_lattices_tag(Main *bmain, int value) { tag_main_lb(&bmain->latt, value); }
555
void rna_Main_curves_tag(Main *bmain, int value) { tag_main_lb(&bmain->curve, value); }
556
void rna_Main_metaballs_tag(Main *bmain, int value) { tag_main_lb(&bmain->mball, value); }
557
void rna_Main_fonts_tag(Main *bmain, int value) { tag_main_lb(&bmain->vfont, value); }
558
void rna_Main_textures_tag(Main *bmain, int value) { tag_main_lb(&bmain->tex, value); }
559
void rna_Main_brushes_tag(Main *bmain, int value) { tag_main_lb(&bmain->brush, value); }
560
void rna_Main_worlds_tag(Main *bmain, int value) { tag_main_lb(&bmain->world, value); }
561
void rna_Main_groups_tag(Main *bmain, int value) { tag_main_lb(&bmain->group, value); }
562
void rna_Main_shape_keys_tag(Main *bmain, int value) { tag_main_lb(&bmain->key, value); }
563
void rna_Main_scripts_tag(Main *bmain, int value) { tag_main_lb(&bmain->script, value); }
564
void rna_Main_texts_tag(Main *bmain, int value) { tag_main_lb(&bmain->text, value); }
565
void rna_Main_speakers_tag(Main *bmain, int value) { tag_main_lb(&bmain->speaker, value); }
566
void rna_Main_sounds_tag(Main *bmain, int value) { tag_main_lb(&bmain->sound, value); }
567
void rna_Main_armatures_tag(Main *bmain, int value) { tag_main_lb(&bmain->armature, value); }
568
void rna_Main_actions_tag(Main *bmain, int value) { tag_main_lb(&bmain->action, value); }
569
void rna_Main_particles_tag(Main *bmain, int value) { tag_main_lb(&bmain->particle, value); }
570
void rna_Main_gpencil_tag(Main *bmain, int value) { tag_main_lb(&bmain->gpencil, value); }
571
void rna_Main_movieclips_tag(Main *bmain, int value) { tag_main_lb(&bmain->movieclip, value); }
573
static int rna_Main_cameras_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CA); }
574
static int rna_Main_scenes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCE); }
575
static int rna_Main_objects_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_OB); }
576
static int rna_Main_materials_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_MA); }
577
static int rna_Main_node_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_NT); }
578
static int rna_Main_meshes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_ME); }
579
static int rna_Main_lamps_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LA); }
580
static int rna_Main_libraries_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LI); }
581
static int rna_Main_screens_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCR); }
582
static int rna_Main_window_managers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WM); }
583
static int rna_Main_images_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_IM); }
584
static int rna_Main_lattices_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LT); }
585
static int rna_Main_curves_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CU); }
586
static int rna_Main_metaballs_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_MB); }
587
static int rna_Main_fonts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_VF); }
588
static int rna_Main_textures_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TE); }
589
static int rna_Main_brushes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_BR); }
590
static int rna_Main_worlds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WO); }
591
static int rna_Main_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GR); }
592
static int rna_Main_texts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TXT); }
593
static int rna_Main_speakers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SPK); }
594
static int rna_Main_sounds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SO); }
595
static int rna_Main_armatures_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_AR); }
596
static int rna_Main_actions_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_AC); }
597
static int rna_Main_particles_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_PA); }
598
static int rna_Main_gpencil_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GD); }
479
602
void RNA_api_main(StructRNA *srna)
482
605
FunctionRNA *func;
483
606
PropertyRNA *parm;
485
607
/* maybe we want to add functions in 'bpy.data' still?
486
608
* for now they are all in collections bpy.data.images.new(...) */
488
609
func= RNA_def_function(srna, "add_image", "rna_Main_add_image");
489
RNA_def_function_ui_description(func, "Add a new image.");
490
parm= RNA_def_string(func, "filepath", "", 0, "", "File path to load image from.");
610
RNA_def_function_ui_description(func, "Add a new image");
611
parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from");
491
612
RNA_def_property_flag(parm, PROP_REQUIRED);
492
parm= RNA_def_pointer(func, "image", "Image", "", "New image.");
613
parm= RNA_def_pointer(func, "image", "Image", "", "New image");
493
614
RNA_def_function_return(func, parm);
498
618
void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
581
730
FunctionRNA *func;
582
731
PropertyRNA *parm;
584
RNA_def_property_srna(cprop, "MainMaterials");
585
srna= RNA_def_struct(brna, "MainMaterials", NULL);
586
RNA_def_struct_ui_text(srna, "Main Material", "Collection of materials");
588
func= RNA_def_function(srna, "new", "rna_Main_materials_new");
734
RNA_def_property_srna(cprop, "BlendDataMaterials");
735
srna = RNA_def_struct(brna, "BlendDataMaterials", NULL);
736
RNA_def_struct_sdna(srna, "Main");
737
RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials");
739
func = RNA_def_function(srna, "new", "rna_Main_materials_new");
589
740
RNA_def_function_ui_description(func, "Add a new material to the main database");
590
parm= RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock.");
741
parm = RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock");
591
742
RNA_def_property_flag(parm, PROP_REQUIRED);
592
743
/* return type */
593
parm= RNA_def_pointer(func, "material", "Material", "", "New material datablock.");
744
parm = RNA_def_pointer(func, "material", "Material", "", "New material datablock");
594
745
RNA_def_function_return(func, parm);
596
func= RNA_def_function(srna, "remove", "rna_Main_materials_remove");
747
func = RNA_def_function(srna, "remove", "rna_Main_materials_remove");
597
748
RNA_def_function_flag(func, FUNC_USE_REPORTS);
598
RNA_def_function_ui_description(func, "Remove a material from the current blendfile.");
599
parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove.");
749
RNA_def_function_ui_description(func, "Remove a material from the current blendfile");
750
parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
751
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
753
func = RNA_def_function(srna, "tag", "rna_Main_materials_tag");
754
parm = RNA_def_boolean(func, "value", 0, "Value", "");
600
755
RNA_def_property_flag(parm, PROP_REQUIRED);
757
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
758
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
759
RNA_def_property_boolean_funcs(prop, "rna_Main_materials_is_updated_get", NULL);
602
761
void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
605
// FunctionRNA *func;
606
// PropertyRNA *parm;
608
/* static EnumPropertyItem node_nodetree_items[] = {
768
static EnumPropertyItem node_nodetree_items[] = {
609
769
{0, "SHADER", 0, "Shader", ""},
610
770
{1, "COMPOSITE", 0, "Composite", ""},
611
771
{2, "TEXTURE", 0, "Texture", ""},
612
{0, NULL, 0, NULL, NULL}}; */
772
{0, NULL, 0, NULL, NULL}};
614
RNA_def_property_srna(cprop, "MainNodeTrees");
615
srna= RNA_def_struct(brna, "MainNodeTrees", NULL);
774
RNA_def_property_srna(cprop, "BlendDataNodeTrees");
775
srna = RNA_def_struct(brna, "BlendDataNodeTrees", NULL);
776
RNA_def_struct_sdna(srna, "Main");
616
777
RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees");
618
#if 0 // need to see some examples of using these functions before enabling.
619
func= RNA_def_function(srna, "new", "rna_Main_nodetree_new");
779
func = RNA_def_function(srna, "new", "rna_Main_nodetree_new");
620
780
RNA_def_function_ui_description(func, "Add a new node tree to the main database");
621
parm= RNA_def_enum(func, "type", node_nodetree_items, 0, "Type", "The type of curve object to add");
781
parm = RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the datablock");
782
RNA_def_property_flag(parm, PROP_REQUIRED);
783
parm = RNA_def_enum(func, "type", node_nodetree_items, 0, "Type", "The type of node_group to add");
622
784
RNA_def_property_flag(parm, PROP_REQUIRED);
623
785
/* return type */
624
parm= RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock.");
786
parm = RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock");
625
787
RNA_def_function_return(func, parm);
627
func= RNA_def_function(srna, "remove", "rna_Main_nodetree_remove");
789
func = RNA_def_function(srna, "remove", "rna_Main_nodetree_remove");
628
790
RNA_def_function_flag(func, FUNC_USE_REPORTS);
629
RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile.");
630
parm= RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove.");
791
RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile");
792
parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
793
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
795
func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
796
parm = RNA_def_boolean(func, "value", 0, "Value", "");
631
797
RNA_def_property_flag(parm, PROP_REQUIRED);
799
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
800
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
801
RNA_def_property_boolean_funcs(prop, "rna_Main_node_groups_is_updated_get", NULL);
634
803
void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
637
806
FunctionRNA *func;
638
807
PropertyRNA *parm;
640
RNA_def_property_srna(cprop, "MainMeshes");
641
srna= RNA_def_struct(brna, "MainMeshes", NULL);
810
RNA_def_property_srna(cprop, "BlendDataMeshes");
811
srna = RNA_def_struct(brna, "BlendDataMeshes", NULL);
812
RNA_def_struct_sdna(srna, "Main");
642
813
RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes");
644
func= RNA_def_function(srna, "new", "rna_Main_meshes_new");
815
func = RNA_def_function(srna, "new", "rna_Main_meshes_new");
645
816
RNA_def_function_ui_description(func, "Add a new mesh to the main database");
646
parm= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock.");
817
parm = RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock");
647
818
RNA_def_property_flag(parm, PROP_REQUIRED);
648
819
/* return type */
649
parm= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock.");
820
parm = RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock");
650
821
RNA_def_function_return(func, parm);
652
func= RNA_def_function(srna, "remove", "rna_Main_meshes_remove");
823
func = RNA_def_function(srna, "remove", "rna_Main_meshes_remove");
653
824
RNA_def_function_flag(func, FUNC_USE_REPORTS);
654
RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile.");
655
parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove.");
825
RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
826
parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
827
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
829
func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
830
parm = RNA_def_boolean(func, "value", 0, "Value", "");
656
831
RNA_def_property_flag(parm, PROP_REQUIRED);
833
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
834
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
835
RNA_def_property_boolean_funcs(prop, "rna_Main_meshes_is_updated_get", NULL);
658
837
void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
661
840
FunctionRNA *func;
662
841
PropertyRNA *parm;
664
RNA_def_property_srna(cprop, "MainLamps");
665
srna= RNA_def_struct(brna, "MainLamps", NULL);
844
RNA_def_property_srna(cprop, "BlendDataLamps");
845
srna = RNA_def_struct(brna, "BlendDataLamps", NULL);
846
RNA_def_struct_sdna(srna, "Main");
666
847
RNA_def_struct_ui_text(srna, "Main Lamps", "Collection of lamps");
668
func= RNA_def_function(srna, "new", "rna_Main_lamps_new");
849
func = RNA_def_function(srna, "new", "rna_Main_lamps_new");
669
850
RNA_def_function_ui_description(func, "Add a new lamp to the main database");
670
parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock.");
851
parm = RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock");
852
RNA_def_property_flag(parm, PROP_REQUIRED);
853
parm = RNA_def_enum(func, "type", lamp_type_items, 0, "Type", "The type of texture to add");
671
854
RNA_def_property_flag(parm, PROP_REQUIRED);
672
855
/* return type */
673
parm= RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock.");
856
parm = RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock");
674
857
RNA_def_function_return(func, parm);
676
func= RNA_def_function(srna, "remove", "rna_Main_lamps_remove");
859
func = RNA_def_function(srna, "remove", "rna_Main_lamps_remove");
677
860
RNA_def_function_flag(func, FUNC_USE_REPORTS);
678
RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile.");
679
parm= RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove.");
861
RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile");
862
parm = RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove");
863
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
865
func = RNA_def_function(srna, "tag", "rna_Main_lamps_tag");
866
parm = RNA_def_boolean(func, "value", 0, "Value", "");
680
867
RNA_def_property_flag(parm, PROP_REQUIRED);
869
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
870
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
871
RNA_def_property_boolean_funcs(prop, "rna_Main_lamps_is_updated_get", NULL);
682
874
void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
881
RNA_def_property_srna(cprop, "BlendDataLibraries");
882
srna = RNA_def_struct(brna, "BlendDataLibraries", NULL);
883
RNA_def_struct_sdna(srna, "Main");
884
RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
886
func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
887
parm = RNA_def_boolean(func, "value", 0, "Value", "");
888
RNA_def_property_flag(parm, PROP_REQUIRED);
890
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
891
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
892
RNA_def_property_boolean_funcs(prop, "rna_Main_libraries_is_updated_get", NULL);
686
895
void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)
902
RNA_def_property_srna(cprop, "BlendDataScreens");
903
srna = RNA_def_struct(brna, "BlendDataScreens", NULL);
904
RNA_def_struct_sdna(srna, "Main");
905
RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
907
func = RNA_def_function(srna, "tag", "rna_Main_screens_tag");
908
parm = RNA_def_boolean(func, "value", 0, "Value", "");
909
RNA_def_property_flag(parm, PROP_REQUIRED);
911
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
912
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
913
RNA_def_property_boolean_funcs(prop, "rna_Main_screens_is_updated_get", NULL);
690
916
void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
923
RNA_def_property_srna(cprop, "BlendDataWindowManagers");
924
srna = RNA_def_struct(brna, "BlendDataWindowManagers", NULL);
925
RNA_def_struct_sdna(srna, "Main");
926
RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
928
func = RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
929
parm = RNA_def_boolean(func, "value", 0, "Value", "");
930
RNA_def_property_flag(parm, PROP_REQUIRED);
932
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
933
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
934
RNA_def_property_boolean_funcs(prop, "rna_Main_window_managers_is_updated_get", NULL);
694
936
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
697
939
FunctionRNA *func;
698
940
PropertyRNA *parm;
700
RNA_def_property_srna(cprop, "MainImages");
701
srna= RNA_def_struct(brna, "MainImages", NULL);
943
RNA_def_property_srna(cprop, "BlendDataImages");
944
srna = RNA_def_struct(brna, "BlendDataImages", NULL);
945
RNA_def_struct_sdna(srna, "Main");
702
946
RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
704
func= RNA_def_function(srna, "new", "rna_Main_images_new");
948
func = RNA_def_function(srna, "new", "rna_Main_images_new");
705
949
RNA_def_function_ui_description(func, "Add a new image to the main database");
706
parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock.");
707
RNA_def_property_flag(parm, PROP_REQUIRED);
708
parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image.", 0, INT_MAX);
709
parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image.", 0, INT_MAX);
710
parm= RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel");
711
parm= RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color");
950
parm = RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock");
951
RNA_def_property_flag(parm, PROP_REQUIRED);
952
parm = RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 0, INT_MAX);
953
RNA_def_property_flag(parm, PROP_REQUIRED);
954
parm = RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 0, INT_MAX);
955
RNA_def_property_flag(parm, PROP_REQUIRED);
956
RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel");
957
RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color");
712
958
/* return type */
713
parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
959
parm = RNA_def_pointer(func, "image", "Image", "", "New image datablock");
714
960
RNA_def_function_return(func, parm);
716
func= RNA_def_function(srna, "load", "rna_Main_images_load");
962
func = RNA_def_function(srna, "load", "rna_Main_images_load");
717
963
RNA_def_function_flag(func, FUNC_USE_REPORTS);
718
964
RNA_def_function_ui_description(func, "Load a new image into the main database");
719
parm= RNA_def_string(func, "filepath", "File Path", 0, "", "path of the file to load.");
965
parm = RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the file to load");
720
966
RNA_def_property_flag(parm, PROP_REQUIRED);
721
967
/* return type */
722
parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
968
parm = RNA_def_pointer(func, "image", "Image", "", "New image datablock");
723
969
RNA_def_function_return(func, parm);
725
func= RNA_def_function(srna, "remove", "rna_Main_images_remove");
971
func = RNA_def_function(srna, "remove", "rna_Main_images_remove");
726
972
RNA_def_function_flag(func, FUNC_USE_REPORTS);
727
RNA_def_function_ui_description(func, "Remove an image from the current blendfile.");
728
parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove.");
973
RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
974
parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove");
975
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
977
func = RNA_def_function(srna, "tag", "rna_Main_images_tag");
978
parm = RNA_def_boolean(func, "value", 0, "Value", "");
729
979
RNA_def_property_flag(parm, PROP_REQUIRED);
981
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
982
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
983
RNA_def_property_boolean_funcs(prop, "rna_Main_images_is_updated_get", NULL);
732
986
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
735
989
FunctionRNA *func;
736
990
PropertyRNA *parm;
738
RNA_def_property_srna(cprop, "MainLattices");
739
srna= RNA_def_struct(brna, "MainLattices", NULL);
993
RNA_def_property_srna(cprop, "BlendDataLattices");
994
srna = RNA_def_struct(brna, "BlendDataLattices", NULL);
995
RNA_def_struct_sdna(srna, "Main");
740
996
RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
742
func= RNA_def_function(srna, "new", "rna_Main_lattices_new");
998
func = RNA_def_function(srna, "new", "rna_Main_lattices_new");
743
999
RNA_def_function_ui_description(func, "Add a new lattice to the main database");
744
parm= RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock.");
1000
parm = RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock");
745
1001
RNA_def_property_flag(parm, PROP_REQUIRED);
746
1002
/* return type */
747
parm= RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock.");
1003
parm = RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock");
748
1004
RNA_def_function_return(func, parm);
750
func= RNA_def_function(srna, "remove", "rna_Main_lattices_remove");
1006
func = RNA_def_function(srna, "remove", "rna_Main_lattices_remove");
751
1007
RNA_def_function_flag(func, FUNC_USE_REPORTS);
752
RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile.");
753
parm= RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove.");
1008
RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
1009
parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
1010
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1012
func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
1013
parm = RNA_def_boolean(func, "value", 0, "Value", "");
754
1014
RNA_def_property_flag(parm, PROP_REQUIRED);
1016
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1017
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1018
RNA_def_property_boolean_funcs(prop, "rna_Main_lattices_is_updated_get", NULL);
756
1020
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
758
1022
StructRNA *srna;
759
1023
FunctionRNA *func;
760
1024
PropertyRNA *parm;
762
RNA_def_property_srna(cprop, "MainCurves");
763
srna= RNA_def_struct(brna, "MainCurves", NULL);
1027
RNA_def_property_srna(cprop, "BlendDataCurves");
1028
srna = RNA_def_struct(brna, "BlendDataCurves", NULL);
1029
RNA_def_struct_sdna(srna, "Main");
764
1030
RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
766
func= RNA_def_function(srna, "new", "rna_Main_curves_new");
1032
func = RNA_def_function(srna, "new", "rna_Main_curves_new");
767
1033
RNA_def_function_ui_description(func, "Add a new curve to the main database");
768
parm= RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock.");
1034
parm = RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock");
769
1035
RNA_def_property_flag(parm, PROP_REQUIRED);
770
parm= RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve object to add");
1036
parm = RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve to add");
771
1037
RNA_def_property_flag(parm, PROP_REQUIRED);
772
1038
/* return type */
773
parm= RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock.");
1039
parm = RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock");
774
1040
RNA_def_function_return(func, parm);
776
func= RNA_def_function(srna, "remove", "rna_Main_curves_remove");
1042
func = RNA_def_function(srna, "remove", "rna_Main_curves_remove");
777
1043
RNA_def_function_flag(func, FUNC_USE_REPORTS);
778
RNA_def_function_ui_description(func, "Remove a curve from the current blendfile.");
779
parm= RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove.");
1044
RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
1045
parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
1046
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1048
func = RNA_def_function(srna, "tag", "rna_Main_curves_tag");
1049
parm = RNA_def_boolean(func, "value", 0, "Value", "");
780
1050
RNA_def_property_flag(parm, PROP_REQUIRED);
1052
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1053
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1054
RNA_def_property_boolean_funcs(prop, "rna_Main_curves_is_updated_get", NULL);
782
1056
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
784
1058
StructRNA *srna;
785
1059
FunctionRNA *func;
786
1060
PropertyRNA *parm;
788
RNA_def_property_srna(cprop, "MainMetaBalls");
789
srna= RNA_def_struct(brna, "MainMetaBalls", NULL);
790
RNA_def_struct_ui_text(srna, "Main MetaBall", "Collection of metaballs");
792
func= RNA_def_function(srna, "new", "rna_Main_metaballs_new");
1063
RNA_def_property_srna(cprop, "BlendDataMetaBalls");
1064
srna = RNA_def_struct(brna, "BlendDataMetaBalls", NULL);
1065
RNA_def_struct_sdna(srna, "Main");
1066
RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs");
1068
func = RNA_def_function(srna, "new", "rna_Main_metaballs_new");
793
1069
RNA_def_function_ui_description(func, "Add a new metaball to the main database");
794
parm= RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock.");
1070
parm = RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock");
795
1071
RNA_def_property_flag(parm, PROP_REQUIRED);
796
1072
/* return type */
797
parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock.");
1073
parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock");
798
1074
RNA_def_function_return(func, parm);
800
func= RNA_def_function(srna, "remove", "rna_Main_metaballs_remove");
1076
func = RNA_def_function(srna, "remove", "rna_Main_metaballs_remove");
801
1077
RNA_def_function_flag(func, FUNC_USE_REPORTS);
802
RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile.");
803
parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove.");
1078
RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile");
1079
parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove");
1080
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1082
func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
1083
parm = RNA_def_boolean(func, "value", 0, "Value", "");
804
1084
RNA_def_property_flag(parm, PROP_REQUIRED);
1086
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1087
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1088
RNA_def_property_boolean_funcs(prop, "rna_Main_metaballs_is_updated_get", NULL);
806
1090
void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
808
1092
StructRNA *srna;
809
1093
FunctionRNA *func;
810
1094
PropertyRNA *parm;
812
RNA_def_property_srna(cprop, "MainFonts");
813
srna= RNA_def_struct(brna, "MainFonts", NULL);
1097
RNA_def_property_srna(cprop, "BlendDataFonts");
1098
srna = RNA_def_struct(brna, "BlendDataFonts", NULL);
1099
RNA_def_struct_sdna(srna, "Main");
814
1100
RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
816
func= RNA_def_function(srna, "load", "rna_Main_fonts_load");
1102
func = RNA_def_function(srna, "load", "rna_Main_fonts_load");
817
1103
RNA_def_function_flag(func, FUNC_USE_REPORTS);
818
1104
RNA_def_function_ui_description(func, "Load a new font into the main database");
819
parm= RNA_def_string(func, "filepath", "File Path", 0, "", "path of the font to load.");
1105
parm = RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the font to load");
820
1106
RNA_def_property_flag(parm, PROP_REQUIRED);
821
1107
/* return type */
822
parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock.");
1108
parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock");
823
1109
RNA_def_function_return(func, parm);
825
func= RNA_def_function(srna, "remove", "rna_Main_fonts_remove");
1111
func = RNA_def_function(srna, "remove", "rna_Main_fonts_remove");
826
1112
RNA_def_function_flag(func, FUNC_USE_REPORTS);
827
RNA_def_function_ui_description(func, "Remove a font from the current blendfile.");
828
parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove.");
1113
RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
1114
parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
1115
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1117
func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
1118
parm = RNA_def_boolean(func, "value", 0, "Value", "");
829
1119
RNA_def_property_flag(parm, PROP_REQUIRED);
1121
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1122
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1123
RNA_def_property_boolean_funcs(prop, "rna_Main_fonts_is_updated_get", NULL);
831
1125
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
833
1127
StructRNA *srna;
834
1128
FunctionRNA *func;
835
1129
PropertyRNA *parm;
837
RNA_def_property_srna(cprop, "MainTextures");
838
srna= RNA_def_struct(brna, "MainTextures", NULL);
1132
RNA_def_property_srna(cprop, "BlendDataTextures");
1133
srna = RNA_def_struct(brna, "BlendDataTextures", NULL);
1134
RNA_def_struct_sdna(srna, "Main");
839
1135
RNA_def_struct_ui_text(srna, "Main Textures", "Collection of groups");
841
func= RNA_def_function(srna, "new", "rna_Main_textures_new");
1137
func = RNA_def_function(srna, "new", "rna_Main_textures_new");
842
1138
RNA_def_function_ui_description(func, "Add a new texture to the main database");
843
parm= RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock.");
1139
parm = RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock");
1140
RNA_def_property_flag(parm, PROP_REQUIRED);
1141
parm = RNA_def_enum(func, "type", texture_type_items, 0, "Type", "The type of texture to add");
844
1142
RNA_def_property_flag(parm, PROP_REQUIRED);
845
1143
/* return type */
846
parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock.");
1144
parm = RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock");
847
1145
RNA_def_function_return(func, parm);
849
func= RNA_def_function(srna, "remove", "rna_Main_textures_remove");
1147
func = RNA_def_function(srna, "remove", "rna_Main_textures_remove");
850
1148
RNA_def_function_flag(func, FUNC_USE_REPORTS);
851
RNA_def_function_ui_description(func, "Remove a texture from the current blendfile.");
852
parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove.");
1149
RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
1150
parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
1151
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1153
func = RNA_def_function(srna, "tag", "rna_Main_textures_tag");
1154
parm = RNA_def_boolean(func, "value", 0, "Value", "");
853
1155
RNA_def_property_flag(parm, PROP_REQUIRED);
1157
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1158
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1159
RNA_def_property_boolean_funcs(prop, "rna_Main_textures_is_updated_get", NULL);
855
1161
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
857
1163
StructRNA *srna;
858
1164
FunctionRNA *func;
859
1165
PropertyRNA *parm;
861
RNA_def_property_srna(cprop, "MainBrushes");
862
srna= RNA_def_struct(brna, "MainBrushes", NULL);
1168
RNA_def_property_srna(cprop, "BlendDataBrushes");
1169
srna = RNA_def_struct(brna, "BlendDataBrushes", NULL);
1170
RNA_def_struct_sdna(srna, "Main");
863
1171
RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
865
func= RNA_def_function(srna, "new", "rna_Main_brushes_new");
1173
func = RNA_def_function(srna, "new", "rna_Main_brushes_new");
866
1174
RNA_def_function_ui_description(func, "Add a new brush to the main database");
867
parm= RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock.");
1175
parm = RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock");
868
1176
RNA_def_property_flag(parm, PROP_REQUIRED);
869
1177
/* return type */
870
parm= RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock.");
1178
parm = RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock");
871
1179
RNA_def_function_return(func, parm);
873
func= RNA_def_function(srna, "remove", "rna_Main_brushes_remove");
1181
func = RNA_def_function(srna, "remove", "rna_Main_brushes_remove");
874
1182
RNA_def_function_flag(func, FUNC_USE_REPORTS);
875
RNA_def_function_ui_description(func, "Remove a brush from the current blendfile.");
876
parm= RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove.");
1183
RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
1184
parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
1185
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1187
func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
1188
parm = RNA_def_boolean(func, "value", 0, "Value", "");
877
1189
RNA_def_property_flag(parm, PROP_REQUIRED);
1191
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1192
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1193
RNA_def_property_boolean_funcs(prop, "rna_Main_brushes_is_updated_get", NULL);
880
1196
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
907
1233
StructRNA *srna;
908
1234
FunctionRNA *func;
909
1235
PropertyRNA *parm;
911
RNA_def_property_srna(cprop, "MainGroups");
912
srna= RNA_def_struct(brna, "MainGroups", NULL);
1238
RNA_def_property_srna(cprop, "BlendDataGroups");
1239
srna = RNA_def_struct(brna, "BlendDataGroups", NULL);
1240
RNA_def_struct_sdna(srna, "Main");
913
1241
RNA_def_struct_ui_text(srna, "Main Groups", "Collection of groups");
915
func= RNA_def_function(srna, "new", "rna_Main_groups_new");
1243
func = RNA_def_function(srna, "new", "rna_Main_groups_new");
916
1244
RNA_def_function_ui_description(func, "Add a new group to the main database");
917
parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock.");
918
RNA_def_property_flag(parm, PROP_REQUIRED);
920
parm= RNA_def_pointer(func, "group", "Group", "", "New group datablock.");
921
RNA_def_function_return(func, parm);
923
func= RNA_def_function(srna, "remove", "rna_Main_groups_remove");
1245
parm = RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock");
1246
RNA_def_property_flag(parm, PROP_REQUIRED);
1248
parm = RNA_def_pointer(func, "group", "Group", "", "New group datablock");
1249
RNA_def_function_return(func, parm);
1251
func = RNA_def_function(srna, "remove", "rna_Main_groups_remove");
1252
RNA_def_function_ui_description(func, "Remove a group from the current blendfile");
1253
parm = RNA_def_pointer(func, "group", "Group", "", "Group to remove");
1254
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1256
func = RNA_def_function(srna, "tag", "rna_Main_groups_tag");
1257
parm = RNA_def_boolean(func, "value", 0, "Value", "");
1258
RNA_def_property_flag(parm, PROP_REQUIRED);
1260
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1261
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1262
RNA_def_property_boolean_funcs(prop, "rna_Main_groups_is_updated_get", NULL);
1265
void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop)
1272
RNA_def_property_srna(cprop, "BlendDataSpeakers");
1273
srna = RNA_def_struct(brna, "BlendDataSpeakers", NULL);
1274
RNA_def_struct_sdna(srna, "Main");
1275
RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers");
1277
func = RNA_def_function(srna, "new", "rna_Main_speakers_new");
1278
RNA_def_function_ui_description(func, "Add a new speaker to the main database");
1279
parm = RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock");
1280
RNA_def_property_flag(parm, PROP_REQUIRED);
1282
parm = RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock");
1283
RNA_def_function_return(func, parm);
1285
func = RNA_def_function(srna, "remove", "rna_Main_speakers_remove");
924
1286
RNA_def_function_flag(func, FUNC_USE_REPORTS);
925
RNA_def_function_ui_description(func, "Remove a group from the current blendfile.");
926
parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove.");
1287
RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
1288
parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
1289
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1291
func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
1292
parm = RNA_def_boolean(func, "value", 0, "Value", "");
927
1293
RNA_def_property_flag(parm, PROP_REQUIRED);
1295
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1296
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1297
RNA_def_property_boolean_funcs(prop, "rna_Main_speakers_is_updated_get", NULL);
929
1300
void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
931
1302
StructRNA *srna;
932
1303
FunctionRNA *func;
933
1304
PropertyRNA *parm;
935
RNA_def_property_srna(cprop, "MainTexts");
936
srna= RNA_def_struct(brna, "MainTexts", NULL);
1307
RNA_def_property_srna(cprop, "BlendDataTexts");
1308
srna = RNA_def_struct(brna, "BlendDataTexts", NULL);
1309
RNA_def_struct_sdna(srna, "Main");
937
1310
RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
939
func= RNA_def_function(srna, "new", "rna_Main_texts_new");
1312
func = RNA_def_function(srna, "new", "rna_Main_texts_new");
940
1313
RNA_def_function_ui_description(func, "Add a new text to the main database");
941
parm= RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock.");
1314
parm = RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock");
942
1315
RNA_def_property_flag(parm, PROP_REQUIRED);
943
1316
/* return type */
944
parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock.");
1317
parm = RNA_def_pointer(func, "text", "Text", "", "New text datablock");
945
1318
RNA_def_function_return(func, parm);
947
func= RNA_def_function(srna, "remove", "rna_Main_texts_remove");
948
RNA_def_function_flag(func, FUNC_USE_REPORTS);
949
RNA_def_function_ui_description(func, "Remove a text from the current blendfile.");
950
parm= RNA_def_pointer(func, "text", "Text", "", "Text to remove.");
951
RNA_def_property_flag(parm, PROP_REQUIRED);
1320
func = RNA_def_function(srna, "remove", "rna_Main_texts_remove");
1321
RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
1322
parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove");
1323
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
954
func= RNA_def_function(srna, "load", "rna_Main_texts_load");
1326
func = RNA_def_function(srna, "load", "rna_Main_texts_load");
955
1327
RNA_def_function_flag(func, FUNC_USE_REPORTS);
956
1328
RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
957
parm= RNA_def_string(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock.");
1329
parm = RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock");
958
1330
RNA_def_property_flag(parm, PROP_REQUIRED);
959
1331
/* return type */
960
parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock.");
1332
parm = RNA_def_pointer(func, "text", "Text", "", "New text datablock");
961
1333
RNA_def_function_return(func, parm);
1335
func = RNA_def_function(srna, "tag", "rna_Main_texts_tag");
1336
parm = RNA_def_boolean(func, "value", 0, "Value", "");
1337
RNA_def_property_flag(parm, PROP_REQUIRED);
1339
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1340
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1341
RNA_def_property_boolean_funcs(prop, "rna_Main_texts_is_updated_get", NULL);
963
1344
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
1351
RNA_def_property_srna(cprop, "BlendDataSounds");
1352
srna = RNA_def_struct(brna, "BlendDataSounds", NULL);
1353
RNA_def_struct_sdna(srna, "Main");
1354
RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
1358
func = RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
1359
parm = RNA_def_boolean(func, "value", 0, "Value", "");
1360
RNA_def_property_flag(parm, PROP_REQUIRED);
1362
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1363
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1364
RNA_def_property_boolean_funcs(prop, "rna_Main_sounds_is_updated_get", NULL);
967
1367
void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
969
1369
StructRNA *srna;
970
1370
FunctionRNA *func;
971
1371
PropertyRNA *parm;
973
RNA_def_property_srna(cprop, "MainArmatures");
974
srna= RNA_def_struct(brna, "MainArmatures", NULL);
1374
RNA_def_property_srna(cprop, "BlendDataArmatures");
1375
srna = RNA_def_struct(brna, "BlendDataArmatures", NULL);
1376
RNA_def_struct_sdna(srna, "Main");
975
1377
RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
977
func= RNA_def_function(srna, "new", "rna_Main_armatures_new");
1379
func = RNA_def_function(srna, "new", "rna_Main_armatures_new");
978
1380
RNA_def_function_ui_description(func, "Add a new armature to the main database");
979
parm= RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock.");
1381
parm = RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock");
980
1382
RNA_def_property_flag(parm, PROP_REQUIRED);
981
1383
/* return type */
982
parm= RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock.");
1384
parm = RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock");
983
1385
RNA_def_function_return(func, parm);
985
func= RNA_def_function(srna, "remove", "rna_Main_armatures_remove");
1387
func = RNA_def_function(srna, "remove", "rna_Main_armatures_remove");
986
1388
RNA_def_function_flag(func, FUNC_USE_REPORTS);
987
RNA_def_function_ui_description(func, "Remove a armature from the current blendfile.");
988
parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove.");
1389
RNA_def_function_ui_description(func, "Remove a armature from the current blendfile");
1390
parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
1391
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1393
func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
1394
parm = RNA_def_boolean(func, "value", 0, "Value", "");
989
1395
RNA_def_property_flag(parm, PROP_REQUIRED);
1397
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1398
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1399
RNA_def_property_boolean_funcs(prop, "rna_Main_armatures_is_updated_get", NULL);
991
1401
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
993
1403
StructRNA *srna;
994
1404
FunctionRNA *func;
995
1405
PropertyRNA *parm;
997
RNA_def_property_srna(cprop, "MainActions");
998
srna= RNA_def_struct(brna, "MainActions", NULL);
1408
RNA_def_property_srna(cprop, "BlendDataActions");
1409
srna = RNA_def_struct(brna, "BlendDataActions", NULL);
1410
RNA_def_struct_sdna(srna, "Main");
999
1411
RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
1001
func= RNA_def_function(srna, "new", "rna_Main_actions_new");
1413
func = RNA_def_function(srna, "new", "rna_Main_actions_new");
1002
1414
RNA_def_function_ui_description(func, "Add a new action to the main database");
1003
parm= RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock.");
1415
parm = RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock");
1004
1416
RNA_def_property_flag(parm, PROP_REQUIRED);
1005
1417
/* return type */
1006
parm= RNA_def_pointer(func, "action", "Action", "", "New action datablock.");
1418
parm = RNA_def_pointer(func, "action", "Action", "", "New action datablock");
1007
1419
RNA_def_function_return(func, parm);
1009
func= RNA_def_function(srna, "remove", "rna_Main_actions_remove");
1421
func = RNA_def_function(srna, "remove", "rna_Main_actions_remove");
1010
1422
RNA_def_function_flag(func, FUNC_USE_REPORTS);
1011
RNA_def_function_ui_description(func, "Remove a action from the current blendfile.");
1012
parm= RNA_def_pointer(func, "action", "Action", "", "Action to remove.");
1423
RNA_def_function_ui_description(func, "Remove a action from the current blendfile");
1424
parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove");
1425
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1427
func = RNA_def_function(srna, "tag", "rna_Main_actions_tag");
1428
parm = RNA_def_boolean(func, "value", 0, "Value", "");
1013
1429
RNA_def_property_flag(parm, PROP_REQUIRED);
1431
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1432
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1433
RNA_def_property_boolean_funcs(prop, "rna_Main_actions_is_updated_get", NULL);
1015
1435
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
1017
1437
StructRNA *srna;
1018
1438
FunctionRNA *func;
1019
1439
PropertyRNA *parm;
1021
RNA_def_property_srna(cprop, "MainParticles");
1022
srna= RNA_def_struct(brna, "MainParticles", NULL);
1442
RNA_def_property_srna(cprop, "BlendDataParticles");
1443
srna = RNA_def_struct(brna, "BlendDataParticles", NULL);
1444
RNA_def_struct_sdna(srna, "Main");
1023
1445
RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
1025
func= RNA_def_function(srna, "new", "rna_Main_particles_new");
1447
func = RNA_def_function(srna, "new", "rna_Main_particles_new");
1026
1448
RNA_def_function_ui_description(func, "Add a new particle settings instance to the main database");
1027
parm= RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock.");
1449
parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock");
1028
1450
RNA_def_property_flag(parm, PROP_REQUIRED);
1029
1451
/* return type */
1030
parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock.");
1452
parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock");
1031
1453
RNA_def_function_return(func, parm);
1033
func= RNA_def_function(srna, "remove", "rna_Main_particles_remove");
1455
func = RNA_def_function(srna, "remove", "rna_Main_particles_remove");
1034
1456
RNA_def_function_flag(func, FUNC_USE_REPORTS);
1035
RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile.");
1036
parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove.");
1457
RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile");
1458
parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
1459
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1461
func = RNA_def_function(srna, "tag", "rna_Main_particles_tag");
1462
parm = RNA_def_boolean(func, "value", 0, "Value", "");
1037
1463
RNA_def_property_flag(parm, PROP_REQUIRED);
1465
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1466
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1467
RNA_def_property_boolean_funcs(prop, "rna_Main_particles_is_updated_get", NULL);
1039
1470
void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
1477
RNA_def_property_srna(cprop, "BlendDataGreasePencils");
1478
srna = RNA_def_struct(brna, "BlendDataGreasePencils", NULL);
1479
RNA_def_struct_sdna(srna, "Main");
1480
RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils");
1482
func = RNA_def_function(srna, "tag", "rna_Main_gpencil_tag");
1483
parm = RNA_def_boolean(func, "value", 0, "Value", "");
1484
RNA_def_property_flag(parm, PROP_REQUIRED);
1486
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
1487
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1488
RNA_def_property_boolean_funcs(prop, "rna_Main_gpencil_is_updated_get", NULL);
1491
void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop)
1497
RNA_def_property_srna(cprop, "BlendDataMovieClips");
1498
srna = RNA_def_struct(brna, "BlendDataMovieClips", NULL);
1499
RNA_def_struct_sdna(srna, "Main");
1500
RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips");
1502
func = RNA_def_function(srna, "tag", "rna_Main_movieclips_tag");
1503
parm = RNA_def_boolean(func, "value", 0, "Value", "");
1504
RNA_def_property_flag(parm, PROP_REQUIRED);
1506
func = RNA_def_function(srna, "remove", "rna_Main_movieclips_remove");
1507
RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile.");
1508
parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
1509
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
1512
func = RNA_def_function(srna, "load", "rna_Main_movieclip_load");
1513
RNA_def_function_flag(func, FUNC_USE_REPORTS);
1514
RNA_def_function_ui_description(func, "Add a new movie clip to the main database from a file");
1515
parm = RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock");
1516
RNA_def_property_flag(parm, PROP_REQUIRED);
1518
parm = RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip datablock");
1519
RNA_def_function_return(func, parm);