Blender  V2.93
rna_main_api.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include <errno.h>
25 #include <stdio.h>
26 #include <stdlib.h>
27 
28 #include "DNA_ID.h"
29 #include "DNA_modifier_types.h"
30 #include "DNA_object_types.h"
31 #include "DNA_space_types.h"
32 
33 #include "BLI_utildefines.h"
34 
35 #include "RNA_access.h"
36 #include "RNA_define.h"
37 #include "RNA_enum_types.h"
38 
39 #include "rna_internal.h"
40 
41 #ifdef RNA_RUNTIME
42 
43 # include "BKE_action.h"
44 # include "BKE_armature.h"
45 # include "BKE_brush.h"
46 # include "BKE_camera.h"
47 # include "BKE_collection.h"
48 # include "BKE_curve.h"
49 # include "BKE_displist.h"
50 # include "BKE_font.h"
51 # include "BKE_gpencil.h"
52 # include "BKE_hair.h"
53 # include "BKE_icons.h"
54 # include "BKE_idtype.h"
55 # include "BKE_image.h"
56 # include "BKE_lattice.h"
57 # include "BKE_lib_remap.h"
58 # include "BKE_light.h"
59 # include "BKE_lightprobe.h"
60 # include "BKE_linestyle.h"
61 # include "BKE_mask.h"
62 # include "BKE_material.h"
63 # include "BKE_mball.h"
64 # include "BKE_mesh.h"
65 # include "BKE_movieclip.h"
66 # include "BKE_node.h"
67 # include "BKE_object.h"
68 # include "BKE_paint.h"
69 # include "BKE_particle.h"
70 # include "BKE_pointcloud.h"
71 # include "BKE_scene.h"
72 # include "BKE_simulation.h"
73 # include "BKE_sound.h"
74 # include "BKE_speaker.h"
75 # include "BKE_text.h"
76 # include "BKE_texture.h"
77 # include "BKE_volume.h"
78 # include "BKE_workspace.h"
79 # include "BKE_world.h"
80 
81 # include "DEG_depsgraph_build.h"
82 # include "DEG_depsgraph_query.h"
83 
84 # include "DNA_armature_types.h"
85 # include "DNA_brush_types.h"
86 # include "DNA_camera_types.h"
87 # include "DNA_collection_types.h"
88 # include "DNA_curve_types.h"
89 # include "DNA_gpencil_types.h"
90 # include "DNA_hair_types.h"
91 # include "DNA_lattice_types.h"
92 # include "DNA_light_types.h"
93 # include "DNA_lightprobe_types.h"
94 # include "DNA_mask_types.h"
95 # include "DNA_material_types.h"
96 # include "DNA_mesh_types.h"
97 # include "DNA_meta_types.h"
98 # include "DNA_movieclip_types.h"
99 # include "DNA_node_types.h"
100 # include "DNA_particle_types.h"
101 # include "DNA_pointcloud_types.h"
102 # include "DNA_simulation_types.h"
103 # include "DNA_sound_types.h"
104 # include "DNA_speaker_types.h"
105 # include "DNA_text_types.h"
106 # include "DNA_texture_types.h"
107 # include "DNA_vfont_types.h"
108 # include "DNA_volume_types.h"
109 # include "DNA_world_types.h"
110 
111 # include "ED_screen.h"
112 
113 # include "BLT_translation.h"
114 
115 # ifdef WITH_PYTHON
116 # include "BPY_extern.h"
117 # endif
118 
119 # include "WM_api.h"
120 # include "WM_types.h"
121 
122 static void rna_idname_validate(const char *name, char *r_name)
123 {
124  BLI_strncpy(r_name, name, MAX_ID_NAME - 2);
125  BLI_utf8_invalid_strip(r_name, strlen(r_name));
126 }
127 
128 static void rna_Main_ID_remove(Main *bmain,
129  ReportList *reports,
130  PointerRNA *id_ptr,
131  bool do_unlink,
132  bool do_id_user,
133  bool do_ui_user)
134 {
135  ID *id = id_ptr->data;
136  if (id->tag & LIB_TAG_NO_MAIN) {
137  BKE_reportf(reports,
138  RPT_ERROR,
139  "%s '%s' is outside of main database and can not be removed from it",
141  id->name + 2);
142  return;
143  }
144  if (do_unlink) {
145  BKE_id_delete(bmain, id);
146  RNA_POINTER_INVALIDATE(id_ptr);
147  /* Force full redraw, mandatory to avoid crashes when running this from UI... */
149  }
150  else if (ID_REAL_USERS(id) <= 0) {
151  const int flag = (do_id_user ? 0 : LIB_ID_FREE_NO_USER_REFCOUNT) |
152  (do_ui_user ? 0 : LIB_ID_FREE_NO_UI_USER);
153  /* Still using ID flags here, this is in-between commit anyway... */
154  BKE_id_free_ex(bmain, id, flag, true);
155  RNA_POINTER_INVALIDATE(id_ptr);
156  }
157  else {
158  BKE_reportf(
159  reports,
160  RPT_ERROR,
161  "%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)",
163  id->name + 2,
164  ID_REAL_USERS(id));
165  }
166 }
167 
168 static Camera *rna_Main_cameras_new(Main *bmain, const char *name)
169 {
170  char safe_name[MAX_ID_NAME - 2];
171  rna_idname_validate(name, safe_name);
172 
173  ID *id = BKE_camera_add(bmain, safe_name);
174  id_us_min(id);
175 
177 
178  return (Camera *)id;
179 }
180 
181 static Scene *rna_Main_scenes_new(Main *bmain, const char *name)
182 {
183  char safe_name[MAX_ID_NAME - 2];
184  rna_idname_validate(name, safe_name);
185 
186  Scene *scene = BKE_scene_add(bmain, safe_name);
187 
189 
190  return scene;
191 }
192 static void rna_Main_scenes_remove(
193  Main *bmain, bContext *C, ReportList *reports, PointerRNA *scene_ptr, bool do_unlink)
194 {
195  /* don't call BKE_id_free(...) directly */
196  Scene *scene = scene_ptr->data;
197 
198  if (BKE_scene_can_be_removed(bmain, scene)) {
199  Scene *scene_new = scene->id.prev ? scene->id.prev : scene->id.next;
200  if (do_unlink) {
201  wmWindow *win = CTX_wm_window(C);
202 
203  if (WM_window_get_active_scene(win) == scene) {
204 
205 # ifdef WITH_PYTHON
207 # endif
208 
209  WM_window_set_active_scene(bmain, C, win, scene_new);
210 
211 # ifdef WITH_PYTHON
213 # endif
214  }
215  }
216  rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink, true, true);
217  }
218  else {
219  BKE_reportf(reports,
220  RPT_ERROR,
221  "Scene '%s' is the last local one, cannot be removed",
222  scene->id.name + 2);
223  }
224 }
225 
226 static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data)
227 {
228  if (data != NULL && (data->tag & LIB_TAG_NO_MAIN)) {
229  BKE_report(reports,
230  RPT_ERROR,
231  "Can not create object in main database with an evaluated data data-block");
232  return NULL;
233  }
234 
235  char safe_name[MAX_ID_NAME - 2];
236  rna_idname_validate(name, safe_name);
237 
238  Object *ob;
239  int type = OB_EMPTY;
240 
241  if (data) {
243  if (type == -1) {
244  const char *idname;
245  if (RNA_enum_id_from_value(rna_enum_id_type_items, GS(data->name), &idname) == 0) {
246  idname = "UNKNOWN";
247  }
248 
249  BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for an object", idname);
250  return NULL;
251  }
252 
253  id_us_plus(data);
254  }
255 
256  ob = BKE_object_add_only_object(bmain, type, safe_name);
257 
258  ob->data = data;
259  BKE_object_materials_test(bmain, ob, ob->data);
260 
262 
263  return ob;
264 }
265 
266 static Material *rna_Main_materials_new(Main *bmain, const char *name)
267 {
268  char safe_name[MAX_ID_NAME - 2];
269  rna_idname_validate(name, safe_name);
270 
271  ID *id = (ID *)BKE_material_add(bmain, safe_name);
272  id_us_min(id);
273 
275 
276  return (Material *)id;
277 }
278 
279 static void rna_Main_materials_gpencil_data(Main *UNUSED(bmain), PointerRNA *id_ptr)
280 {
281  ID *id = id_ptr->data;
282  Material *ma = (Material *)id;
284 }
285 
286 static void rna_Main_materials_gpencil_remove(Main *UNUSED(bmain), PointerRNA *id_ptr)
287 {
288  ID *id = id_ptr->data;
289  Material *ma = (Material *)id;
290  if (ma->gp_style) {
291  MEM_SAFE_FREE(ma->gp_style);
292  }
293 }
294 
295 static const EnumPropertyItem *rna_Main_nodetree_type_itemf(bContext *UNUSED(C),
297  PropertyRNA *UNUSED(prop),
298  bool *r_free)
299 {
300  return rna_node_tree_type_itemf(NULL, NULL, r_free);
301 }
302 static struct bNodeTree *rna_Main_nodetree_new(Main *bmain, const char *name, int type)
303 {
304  char safe_name[MAX_ID_NAME - 2];
305  rna_idname_validate(name, safe_name);
306 
308  if (typeinfo) {
309  bNodeTree *ntree = ntreeAddTree(bmain, safe_name, typeinfo->idname);
310 
311  id_us_min(&ntree->id);
312  return ntree;
313  }
314  else {
315  return NULL;
316  }
317 }
318 
319 static Mesh *rna_Main_meshes_new(Main *bmain, const char *name)
320 {
321  char safe_name[MAX_ID_NAME - 2];
322  rna_idname_validate(name, safe_name);
323 
324  Mesh *me = BKE_mesh_add(bmain, safe_name);
325  id_us_min(&me->id);
326 
328 
329  return me;
330 }
331 
332 /* copied from Mesh_getFromObject and adapted to RNA interface */
333 static Mesh *rna_Main_meshes_new_from_object(Main *bmain,
334  ReportList *reports,
335  Object *object,
336  bool preserve_all_data_layers,
338 {
339  switch (object->type) {
340  case OB_FONT:
341  case OB_CURVE:
342  case OB_SURF:
343  case OB_MBALL:
344  case OB_MESH:
345  break;
346  default:
347  BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
348  return NULL;
349  }
350 
352  bmain, depsgraph, object, preserve_all_data_layers);
353 
355 
356  return mesh;
357 }
358 
359 static Light *rna_Main_lights_new(Main *bmain, const char *name, int type)
360 {
361  char safe_name[MAX_ID_NAME - 2];
362  rna_idname_validate(name, safe_name);
363 
364  Light *lamp = BKE_light_add(bmain, safe_name);
365  lamp->type = type;
366  id_us_min(&lamp->id);
367 
369 
370  return lamp;
371 }
372 
373 static Image *rna_Main_images_new(Main *bmain,
374  const char *name,
375  int width,
376  int height,
377  bool alpha,
378  bool float_buffer,
379  bool stereo3d,
380  bool is_data,
381  bool tiled)
382 {
383  char safe_name[MAX_ID_NAME - 2];
384  rna_idname_validate(name, safe_name);
385 
386  float color[4] = {0.0, 0.0, 0.0, 1.0};
387  Image *image = BKE_image_add_generated(bmain,
388  width,
389  height,
390  safe_name,
391  alpha ? 32 : 24,
392  float_buffer,
393  0,
394  color,
395  stereo3d,
396  is_data,
397  tiled);
398  id_us_min(&image->id);
399 
401 
402  return image;
403 }
404 static Image *rna_Main_images_load(Main *bmain,
405  ReportList *reports,
406  const char *filepath,
407  bool check_existing)
408 {
409  Image *ima;
410 
411  errno = 0;
412  if (check_existing) {
413  ima = BKE_image_load_exists(bmain, filepath);
414  }
415  else {
416  ima = BKE_image_load(bmain, filepath);
417  }
418 
419  if (!ima) {
420  BKE_reportf(reports,
421  RPT_ERROR,
422  "Cannot read '%s': %s",
423  filepath,
424  errno ? strerror(errno) : TIP_("unsupported image format"));
425  }
426 
427  id_us_min((ID *)ima);
428 
430 
431  return ima;
432 }
433 
434 static Lattice *rna_Main_lattices_new(Main *bmain, const char *name)
435 {
436  char safe_name[MAX_ID_NAME - 2];
437  rna_idname_validate(name, safe_name);
438 
439  Lattice *lt = BKE_lattice_add(bmain, safe_name);
440  id_us_min(&lt->id);
441 
443 
444  return lt;
445 }
446 
447 static Curve *rna_Main_curves_new(Main *bmain, const char *name, int type)
448 {
449  char safe_name[MAX_ID_NAME - 2];
450  rna_idname_validate(name, safe_name);
451 
452  Curve *cu = BKE_curve_add(bmain, safe_name, type);
453  id_us_min(&cu->id);
454 
456 
457  return cu;
458 }
459 
460 static MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name)
461 {
462  char safe_name[MAX_ID_NAME - 2];
463  rna_idname_validate(name, safe_name);
464 
465  MetaBall *mb = BKE_mball_add(bmain, safe_name);
466  id_us_min(&mb->id);
467 
469 
470  return mb;
471 }
472 
473 static VFont *rna_Main_fonts_load(Main *bmain,
474  ReportList *reports,
475  const char *filepath,
476  bool check_existing)
477 {
478  VFont *font;
479  errno = 0;
480 
481  if (check_existing) {
482  font = BKE_vfont_load_exists(bmain, filepath);
483  }
484  else {
485  font = BKE_vfont_load(bmain, filepath);
486  }
487 
488  if (!font) {
489  BKE_reportf(reports,
490  RPT_ERROR,
491  "Cannot read '%s': %s",
492  filepath,
493  errno ? strerror(errno) : TIP_("unsupported font format"));
494  }
495 
497 
498  return font;
499 }
500 
501 static Tex *rna_Main_textures_new(Main *bmain, const char *name, int type)
502 {
503  char safe_name[MAX_ID_NAME - 2];
504  rna_idname_validate(name, safe_name);
505 
506  Tex *tex = BKE_texture_add(bmain, safe_name);
508  id_us_min(&tex->id);
509 
511 
512  return tex;
513 }
514 
515 static Brush *rna_Main_brushes_new(Main *bmain, const char *name, int mode)
516 {
517  char safe_name[MAX_ID_NAME - 2];
518  rna_idname_validate(name, safe_name);
519 
520  Brush *brush = BKE_brush_add(bmain, safe_name, mode);
521  id_us_min(&brush->id);
522 
524 
525  return brush;
526 }
527 
528 static void rna_Main_brush_gpencil_data(Main *UNUSED(bmain), PointerRNA *id_ptr)
529 {
530  ID *id = id_ptr->data;
531  Brush *brush = (Brush *)id;
533 }
534 
535 static World *rna_Main_worlds_new(Main *bmain, const char *name)
536 {
537  char safe_name[MAX_ID_NAME - 2];
538  rna_idname_validate(name, safe_name);
539 
540  World *world = BKE_world_add(bmain, safe_name);
541  id_us_min(&world->id);
542 
544 
545  return world;
546 }
547 
548 static Collection *rna_Main_collections_new(Main *bmain, const char *name)
549 {
550  char safe_name[MAX_ID_NAME - 2];
551  rna_idname_validate(name, safe_name);
552 
553  Collection *collection = BKE_collection_add(bmain, NULL, safe_name);
554 
556 
557  return collection;
558 }
559 
560 static Speaker *rna_Main_speakers_new(Main *bmain, const char *name)
561 {
562  char safe_name[MAX_ID_NAME - 2];
563  rna_idname_validate(name, safe_name);
564 
565  Speaker *speaker = BKE_speaker_add(bmain, safe_name);
566  id_us_min(&speaker->id);
567 
569 
570  return speaker;
571 }
572 
573 static bSound *rna_Main_sounds_load(Main *bmain, const char *name, bool check_existing)
574 {
575  bSound *sound;
576 
577  if (check_existing) {
578  sound = BKE_sound_new_file_exists(bmain, name);
579  }
580  else {
581  sound = BKE_sound_new_file(bmain, name);
582  }
583 
584  id_us_min(&sound->id);
585 
587 
588  return sound;
589 }
590 
591 static Text *rna_Main_texts_new(Main *bmain, const char *name)
592 {
593  char safe_name[MAX_ID_NAME - 2];
594  rna_idname_validate(name, safe_name);
595 
596  Text *text = BKE_text_add(bmain, safe_name);
597 
599 
600  return text;
601 }
602 
603 static Text *rna_Main_texts_load(Main *bmain,
604  ReportList *reports,
605  const char *filepath,
606  bool is_internal)
607 {
608  Text *txt;
609 
610  errno = 0;
611  txt = BKE_text_load_ex(bmain, filepath, BKE_main_blendfile_path(bmain), is_internal);
612 
613  if (!txt) {
614  BKE_reportf(reports,
615  RPT_ERROR,
616  "Cannot read '%s': %s",
617  filepath,
618  errno ? strerror(errno) : TIP_("unable to load text"));
619  }
620 
622 
623  return txt;
624 }
625 
626 static bArmature *rna_Main_armatures_new(Main *bmain, const char *name)
627 {
628  char safe_name[MAX_ID_NAME - 2];
629  rna_idname_validate(name, safe_name);
630 
631  bArmature *arm = BKE_armature_add(bmain, safe_name);
632  id_us_min(&arm->id);
633 
635 
636  return arm;
637 }
638 
639 static bAction *rna_Main_actions_new(Main *bmain, const char *name)
640 {
641  char safe_name[MAX_ID_NAME - 2];
642  rna_idname_validate(name, safe_name);
643 
644  bAction *act = BKE_action_add(bmain, safe_name);
645  id_fake_user_clear(&act->id);
646 
648 
649  return act;
650 }
651 
652 static ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
653 {
654  char safe_name[MAX_ID_NAME - 2];
655  rna_idname_validate(name, safe_name);
656 
657  ParticleSettings *part = BKE_particlesettings_add(bmain, safe_name);
658  id_us_min(&part->id);
659 
661 
662  return part;
663 }
664 
665 static Palette *rna_Main_palettes_new(Main *bmain, const char *name)
666 {
667  char safe_name[MAX_ID_NAME - 2];
668  rna_idname_validate(name, safe_name);
669 
670  Palette *palette = BKE_palette_add(bmain, safe_name);
671  id_us_min(&palette->id);
672 
674 
675  return (Palette *)palette;
676 }
677 
678 static MovieClip *rna_Main_movieclip_load(Main *bmain,
679  ReportList *reports,
680  const char *filepath,
681  bool check_existing)
682 {
683  MovieClip *clip;
684 
685  errno = 0;
686 
687  if (check_existing) {
688  clip = BKE_movieclip_file_add_exists(bmain, filepath);
689  }
690  else {
691  clip = BKE_movieclip_file_add(bmain, filepath);
692  }
693 
694  if (clip != NULL) {
696  }
697  else {
698  BKE_reportf(reports,
699  RPT_ERROR,
700  "Cannot read '%s': %s",
701  filepath,
702  errno ? strerror(errno) : TIP_("unable to load movie clip"));
703  }
704 
705  id_us_min((ID *)clip);
706 
708 
709  return clip;
710 }
711 
712 static Mask *rna_Main_mask_new(Main *bmain, const char *name)
713 {
714  char safe_name[MAX_ID_NAME - 2];
715  rna_idname_validate(name, safe_name);
716 
717  Mask *mask = BKE_mask_new(bmain, safe_name);
718 
720 
721  return mask;
722 }
723 
724 static FreestyleLineStyle *rna_Main_linestyles_new(Main *bmain, const char *name)
725 {
726  char safe_name[MAX_ID_NAME - 2];
727  rna_idname_validate(name, safe_name);
728 
729  FreestyleLineStyle *linestyle = BKE_linestyle_new(bmain, safe_name);
731 
733 
734  return linestyle;
735 }
736 
737 static LightProbe *rna_Main_lightprobe_new(Main *bmain, const char *name, int type)
738 {
739  char safe_name[MAX_ID_NAME - 2];
740  rna_idname_validate(name, safe_name);
741 
742  LightProbe *probe = BKE_lightprobe_add(bmain, safe_name);
743 
745 
746  id_us_min(&probe->id);
747 
749 
750  return probe;
751 }
752 
753 static bGPdata *rna_Main_gpencils_new(Main *bmain, const char *name)
754 {
755  char safe_name[MAX_ID_NAME - 2];
756  rna_idname_validate(name, safe_name);
757 
758  bGPdata *gpd = BKE_gpencil_data_addnew(bmain, safe_name);
759  id_us_min(&gpd->id);
760 
762 
763  return gpd;
764 }
765 
766 # ifdef WITH_HAIR_NODES
767 static Hair *rna_Main_hairs_new(Main *bmain, const char *name)
768 {
769  char safe_name[MAX_ID_NAME - 2];
770  rna_idname_validate(name, safe_name);
771 
772  Hair *hair = BKE_hair_add(bmain, safe_name);
773  id_us_min(&hair->id);
774 
776 
777  return hair;
778 }
779 # endif
780 
781 # ifdef WITH_POINT_CLOUD
782 static PointCloud *rna_Main_pointclouds_new(Main *bmain, const char *name)
783 {
784  char safe_name[MAX_ID_NAME - 2];
785  rna_idname_validate(name, safe_name);
786 
787  PointCloud *pointcloud = BKE_pointcloud_add(bmain, safe_name);
788  id_us_min(&pointcloud->id);
789 
791 
792  return pointcloud;
793 }
794 # endif
795 
796 static Volume *rna_Main_volumes_new(Main *bmain, const char *name)
797 {
798  char safe_name[MAX_ID_NAME - 2];
799  rna_idname_validate(name, safe_name);
800 
801  Volume *volume = BKE_volume_add(bmain, safe_name);
802  id_us_min(&volume->id);
803 
805 
806  return volume;
807 }
808 
809 # ifdef WITH_GEOMETRY_NODES
810 static Simulation *rna_Main_simulations_new(Main *bmain, const char *name)
811 {
812  char safe_name[MAX_ID_NAME - 2];
813  rna_idname_validate(name, safe_name);
814 
815  Simulation *simulation = BKE_simulation_add(bmain, safe_name);
817 
819 
820  return simulation;
821 }
822 # endif
823 
824 /* tag functions, all the same */
825 # define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
826  static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \
827  { \
828  BKE_main_id_tag_listbase(&bmain->_listbase_name, LIB_TAG_DOIT, value); \
829  }
830 
831 RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras, ID_CA)
832 RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes, ID_SCE)
833 RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects, ID_OB)
834 RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials, ID_MA)
835 RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees, ID_NT)
836 RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes, ID_ME)
837 RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights, ID_LA)
838 RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries, ID_LI)
839 RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens, ID_SCR)
840 RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM)
841 RNA_MAIN_ID_TAG_FUNCS_DEF(images, images, ID_IM)
842 RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices, ID_LT)
843 RNA_MAIN_ID_TAG_FUNCS_DEF(curves, curves, ID_CU)
844 RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs, ID_MB)
845 RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts, ID_VF)
846 RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures, ID_TE)
847 RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brushes, ID_BR)
848 RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds, ID_WO)
849 RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections, ID_GR)
850 // RNA_MAIN_ID_TAG_FUNCS_DEF(shape_keys, key, ID_KE)
851 RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts, ID_TXT)
852 RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers, ID_SPK)
853 RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds, ID_SO)
854 RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures, ID_AR)
855 RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions, ID_AC)
856 RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles, ID_PA)
857 RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL)
858 RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils, ID_GD)
859 RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips, ID_MC)
860 RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks, ID_MSK)
861 RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles, ID_LS)
862 RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF)
863 RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC)
864 RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS)
865 RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP)
866 # ifdef WITH_HAIR_NODES
867 RNA_MAIN_ID_TAG_FUNCS_DEF(hairs, hairs, ID_HA)
868 # endif
869 # ifdef WITH_POINT_CLOUD
870 RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT)
871 # endif
872 RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO)
873 # ifdef WITH_GEOMETRY_NODES
874 RNA_MAIN_ID_TAG_FUNCS_DEF(simulations, simulations, ID_SIM)
875 # endif
876 
877 # undef RNA_MAIN_ID_TAG_FUNCS_DEF
878 
879 #else
880 
882 {
883 # if 0
884  FunctionRNA *func;
885  PropertyRNA *parm;
886 
887  /* maybe we want to add functions in 'bpy.data' still?
888  * for now they are all in collections bpy.data.images.new(...) */
889  func = RNA_def_function(srna, "add_image", "rna_Main_add_image");
890  RNA_def_function_ui_description(func, "Add a new image");
891  parm = RNA_def_string_file_path(func, "filepath", NULL, 0, "", "File path to load image from");
893  parm = RNA_def_pointer(func, "image", "Image", "", "New image");
894  RNA_def_function_return(func, parm);
895 # endif
896 }
897 
899 {
900  StructRNA *srna;
901  FunctionRNA *func;
902  PropertyRNA *parm;
903 
904  RNA_def_property_srna(cprop, "BlendDataCameras");
905  srna = RNA_def_struct(brna, "BlendDataCameras", NULL);
906  RNA_def_struct_sdna(srna, "Main");
907  RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras");
908 
909  func = RNA_def_function(srna, "new", "rna_Main_cameras_new");
910  RNA_def_function_ui_description(func, "Add a new camera to the main database");
911  parm = RNA_def_string(func, "name", "Camera", 0, "", "New name for the data-block");
913  /* return type */
914  parm = RNA_def_pointer(func, "camera", "Camera", "", "New camera data-block");
915  RNA_def_function_return(func, parm);
916 
917  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
919  RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
920  parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
923  RNA_def_boolean(func,
924  "do_unlink",
925  true,
926  "",
927  "Unlink all usages of this camera before deleting it "
928  "(WARNING: will also delete objects instancing that camera data)");
929  RNA_def_boolean(func,
930  "do_id_user",
931  true,
932  "",
933  "Decrement user counter of all datablocks used by this camera");
935  func, "do_ui_user", true, "", "Make sure interface does not reference this camera");
936 
937  func = RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
938  parm = RNA_def_boolean(func, "value", 0, "Value", "");
940 }
941 
943 {
944  StructRNA *srna;
945  FunctionRNA *func;
946  PropertyRNA *parm;
947 
948  RNA_def_property_srna(cprop, "BlendDataScenes");
949  srna = RNA_def_struct(brna, "BlendDataScenes", NULL);
950  RNA_def_struct_sdna(srna, "Main");
951  RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");
952 
953  func = RNA_def_function(srna, "new", "rna_Main_scenes_new");
954  RNA_def_function_ui_description(func, "Add a new scene to the main database");
955  parm = RNA_def_string(func, "name", "Scene", 0, "", "New name for the data-block");
957  /* return type */
958  parm = RNA_def_pointer(func, "scene", "Scene", "", "New scene data-block");
959  RNA_def_function_return(func, parm);
960 
961  func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
963  RNA_def_function_ui_description(func, "Remove a scene from the current blendfile");
964  parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
968  func, "do_unlink", true, "", "Unlink all usages of this scene before deleting it");
969 
970  func = RNA_def_function(srna, "tag", "rna_Main_scenes_tag");
971  parm = RNA_def_boolean(func, "value", 0, "Value", "");
973 }
974 
976 {
977  StructRNA *srna;
978  FunctionRNA *func;
979  PropertyRNA *parm;
980 
981  RNA_def_property_srna(cprop, "BlendDataObjects");
982  srna = RNA_def_struct(brna, "BlendDataObjects", NULL);
983  RNA_def_struct_sdna(srna, "Main");
984  RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects");
985 
986  func = RNA_def_function(srna, "new", "rna_Main_objects_new");
988  RNA_def_function_ui_description(func, "Add a new object to the main database");
989  parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the data-block");
991  parm = RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object");
993 
994  /* return type */
995  parm = RNA_def_pointer(func, "object", "Object", "", "New object data-block");
996  RNA_def_function_return(func, parm);
997 
998  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
999  RNA_def_function_ui_description(func, "Remove an object from the current blendfile");
1001  parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
1005  func, "do_unlink", true, "", "Unlink all usages of this object before deleting it");
1006  RNA_def_boolean(func,
1007  "do_id_user",
1008  true,
1009  "",
1010  "Decrement user counter of all datablocks used by this object");
1012  func, "do_ui_user", true, "", "Make sure interface does not reference this object");
1013 
1014  func = RNA_def_function(srna, "tag", "rna_Main_objects_tag");
1015  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1017 }
1018 
1020 {
1021  StructRNA *srna;
1022  FunctionRNA *func;
1023  PropertyRNA *parm;
1024 
1025  RNA_def_property_srna(cprop, "BlendDataMaterials");
1026  srna = RNA_def_struct(brna, "BlendDataMaterials", NULL);
1027  RNA_def_struct_sdna(srna, "Main");
1028  RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials");
1029 
1030  func = RNA_def_function(srna, "new", "rna_Main_materials_new");
1031  RNA_def_function_ui_description(func, "Add a new material to the main database");
1032  parm = RNA_def_string(func, "name", "Material", 0, "", "New name for the data-block");
1034  /* return type */
1035  parm = RNA_def_pointer(func, "material", "Material", "", "New material data-block");
1036  RNA_def_function_return(func, parm);
1037 
1038  func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_materials_gpencil_data");
1039  RNA_def_function_ui_description(func, "Add grease pencil material settings");
1040  parm = RNA_def_pointer(func, "material", "Material", "", "Material");
1042 
1043  func = RNA_def_function(srna, "remove_gpencil_data", "rna_Main_materials_gpencil_remove");
1044  RNA_def_function_ui_description(func, "Remove grease pencil material settings");
1045  parm = RNA_def_pointer(func, "material", "Material", "", "Material");
1047 
1048  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1050  RNA_def_function_ui_description(func, "Remove a material from the current blendfile");
1051  parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
1055  func, "do_unlink", true, "", "Unlink all usages of this material before deleting it");
1056  RNA_def_boolean(func,
1057  "do_id_user",
1058  true,
1059  "",
1060  "Decrement user counter of all datablocks used by this material");
1062  func, "do_ui_user", true, "", "Make sure interface does not reference this material");
1063 
1064  func = RNA_def_function(srna, "tag", "rna_Main_materials_tag");
1065  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1067 }
1069 {
1070  StructRNA *srna;
1071  FunctionRNA *func;
1072  PropertyRNA *parm;
1073 
1074  static const EnumPropertyItem dummy_items[] = {
1075  {0, "DUMMY", 0, "", ""},
1076  {0, NULL, 0, NULL, NULL},
1077  };
1078 
1079  RNA_def_property_srna(cprop, "BlendDataNodeTrees");
1080  srna = RNA_def_struct(brna, "BlendDataNodeTrees", NULL);
1081  RNA_def_struct_sdna(srna, "Main");
1082  RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees");
1083 
1084  func = RNA_def_function(srna, "new", "rna_Main_nodetree_new");
1085  RNA_def_function_ui_description(func, "Add a new node tree to the main database");
1086  parm = RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the data-block");
1088  parm = RNA_def_enum(func, "type", dummy_items, 0, "Type", "The type of node_group to add");
1089  RNA_def_property_enum_funcs(parm, NULL, NULL, "rna_Main_nodetree_type_itemf");
1091  /* return type */
1092  parm = RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree data-block");
1093  RNA_def_function_return(func, parm);
1094 
1095  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1097  RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile");
1098  parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
1102  func, "do_unlink", true, "", "Unlink all usages of this node tree before deleting it");
1103  RNA_def_boolean(func,
1104  "do_id_user",
1105  true,
1106  "",
1107  "Decrement user counter of all datablocks used by this node tree");
1109  func, "do_ui_user", true, "", "Make sure interface does not reference this node tree");
1110 
1111  func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
1112  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1114 }
1116 {
1117  StructRNA *srna;
1118  FunctionRNA *func;
1119  PropertyRNA *parm;
1120 
1121  RNA_def_property_srna(cprop, "BlendDataMeshes");
1122  srna = RNA_def_struct(brna, "BlendDataMeshes", NULL);
1123  RNA_def_struct_sdna(srna, "Main");
1124  RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes");
1125 
1126  func = RNA_def_function(srna, "new", "rna_Main_meshes_new");
1127  RNA_def_function_ui_description(func, "Add a new mesh to the main database");
1128  parm = RNA_def_string(func, "name", "Mesh", 0, "", "New name for the data-block");
1130  /* return type */
1131  parm = RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh data-block");
1132  RNA_def_function_return(func, parm);
1133 
1134  func = RNA_def_function(srna, "new_from_object", "rna_Main_meshes_new_from_object");
1136  func,
1137  "Add a new mesh created from given object (undeformed geometry if object is original, and "
1138  "final evaluated geometry, with all modifiers etc., if object is evaluated)");
1140  parm = RNA_def_pointer(func, "object", "Object", "", "Object to create mesh from");
1142  RNA_def_boolean(func,
1143  "preserve_all_data_layers",
1144  false,
1145  "",
1146  "Preserve all data layers in the mesh, like UV maps and vertex groups. "
1147  "By default Blender only computes the subset of data layers needed for viewport "
1148  "display and rendering, for better performance");
1150  func,
1151  "depsgraph",
1152  "Depsgraph",
1153  "Dependency Graph",
1154  "Evaluated dependency graph which is required when preserve_all_data_layers is true");
1155  parm = RNA_def_pointer(func,
1156  "mesh",
1157  "Mesh",
1158  "",
1159  "Mesh created from object, remove it if it is only used for export");
1160  RNA_def_function_return(func, parm);
1161 
1162  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1164  RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
1165  parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
1168  RNA_def_boolean(func,
1169  "do_unlink",
1170  true,
1171  "",
1172  "Unlink all usages of this mesh before deleting it "
1173  "(WARNING: will also delete objects instancing that mesh data)");
1174  RNA_def_boolean(func,
1175  "do_id_user",
1176  true,
1177  "",
1178  "Decrement user counter of all datablocks used by this mesh data");
1180  func, "do_ui_user", true, "", "Make sure interface does not reference this mesh data");
1181 
1182  func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
1183  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1185 }
1186 
1188 {
1189  StructRNA *srna;
1190  FunctionRNA *func;
1191  PropertyRNA *parm;
1192 
1193  RNA_def_property_srna(cprop, "BlendDataLights");
1194  srna = RNA_def_struct(brna, "BlendDataLights", NULL);
1195  RNA_def_struct_sdna(srna, "Main");
1196  RNA_def_struct_ui_text(srna, "Main Lights", "Collection of lights");
1197 
1198  func = RNA_def_function(srna, "new", "rna_Main_lights_new");
1199  RNA_def_function_ui_description(func, "Add a new light to the main database");
1200  parm = RNA_def_string(func, "name", "Light", 0, "", "New name for the data-block");
1202  parm = RNA_def_enum(
1203  func, "type", rna_enum_light_type_items, 0, "Type", "The type of light to add");
1205  /* return type */
1206  parm = RNA_def_pointer(func, "light", "Light", "", "New light data-block");
1207  RNA_def_function_return(func, parm);
1208 
1209  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1211  RNA_def_function_ui_description(func, "Remove a light from the current blendfile");
1212  parm = RNA_def_pointer(func, "light", "Light", "", "Light to remove");
1215  RNA_def_boolean(func,
1216  "do_unlink",
1217  true,
1218  "",
1219  "Unlink all usages of this light before deleting it "
1220  "(WARNING: will also delete objects instancing that light data)");
1221  RNA_def_boolean(func,
1222  "do_id_user",
1223  true,
1224  "",
1225  "Decrement user counter of all datablocks used by this light data");
1227  func, "do_ui_user", true, "", "Make sure interface does not reference this light data");
1228 
1229  func = RNA_def_function(srna, "tag", "rna_Main_lights_tag");
1230  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1232 }
1233 
1235 {
1236  StructRNA *srna;
1237  FunctionRNA *func;
1238  PropertyRNA *parm;
1239 
1240  RNA_def_property_srna(cprop, "BlendDataLibraries");
1241  srna = RNA_def_struct(brna, "BlendDataLibraries", NULL);
1242  RNA_def_struct_sdna(srna, "Main");
1243  RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
1244 
1245  func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
1246  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1248 
1249  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1251  RNA_def_function_ui_description(func, "Remove a library from the current blendfile");
1252  parm = RNA_def_pointer(func, "library", "Library", "", "Library to remove");
1256  func, "do_unlink", true, "", "Unlink all usages of this library before deleting it");
1257  RNA_def_boolean(func,
1258  "do_id_user",
1259  true,
1260  "",
1261  "Decrement user counter of all datablocks used by this library");
1263  func, "do_ui_user", true, "", "Make sure interface does not reference this library");
1264 }
1265 
1267 {
1268  StructRNA *srna;
1269  FunctionRNA *func;
1270  PropertyRNA *parm;
1271 
1272  RNA_def_property_srna(cprop, "BlendDataScreens");
1273  srna = RNA_def_struct(brna, "BlendDataScreens", NULL);
1274  RNA_def_struct_sdna(srna, "Main");
1275  RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
1276 
1277  func = RNA_def_function(srna, "tag", "rna_Main_screens_tag");
1278  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1280 }
1281 
1283 {
1284  StructRNA *srna;
1285  FunctionRNA *func;
1286  PropertyRNA *parm;
1287 
1288  RNA_def_property_srna(cprop, "BlendDataWindowManagers");
1289  srna = RNA_def_struct(brna, "BlendDataWindowManagers", NULL);
1290  RNA_def_struct_sdna(srna, "Main");
1291  RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
1292 
1293  func = RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
1294  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1296 }
1298 {
1299  StructRNA *srna;
1300  FunctionRNA *func;
1301  PropertyRNA *parm;
1302 
1303  RNA_def_property_srna(cprop, "BlendDataImages");
1304  srna = RNA_def_struct(brna, "BlendDataImages", NULL);
1305  RNA_def_struct_sdna(srna, "Main");
1306  RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
1307 
1308  func = RNA_def_function(srna, "new", "rna_Main_images_new");
1309  RNA_def_function_ui_description(func, "Add a new image to the main database");
1310  parm = RNA_def_string(func, "name", "Image", 0, "", "New name for the data-block");
1312  parm = RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 1, INT_MAX);
1314  parm = RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 1, INT_MAX);
1316  RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel");
1318  func, "float_buffer", 0, "Float Buffer", "Create an image with floating-point color");
1319  RNA_def_boolean(func, "stereo3d", 0, "Stereo 3D", "Create left and right views");
1320  RNA_def_boolean(func, "is_data", 0, "Is Data", "Create image with non-color data color space");
1321  RNA_def_boolean(func, "tiled", 0, "Tiled", "Create a tiled image");
1322  /* return type */
1323  parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1324  RNA_def_function_return(func, parm);
1325 
1326  func = RNA_def_function(srna, "load", "rna_Main_images_load");
1328  RNA_def_function_ui_description(func, "Load a new image into the main database");
1329  parm = RNA_def_string_file_path(
1330  func, "filepath", "File Path", 0, "", "Path of the file to load");
1332  RNA_def_boolean(func,
1333  "check_existing",
1334  false,
1335  "",
1336  "Using existing data-block if this file is already loaded");
1337  /* return type */
1338  parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1339  RNA_def_function_return(func, parm);
1340 
1341  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1343  RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
1344  parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove");
1348  func, "do_unlink", true, "", "Unlink all usages of this image before deleting it");
1350  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this image");
1352  func, "do_ui_user", true, "", "Make sure interface does not reference this image");
1353 
1354  func = RNA_def_function(srna, "tag", "rna_Main_images_tag");
1355  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1357 }
1358 
1360 {
1361  StructRNA *srna;
1362  FunctionRNA *func;
1363  PropertyRNA *parm;
1364 
1365  RNA_def_property_srna(cprop, "BlendDataLattices");
1366  srna = RNA_def_struct(brna, "BlendDataLattices", NULL);
1367  RNA_def_struct_sdna(srna, "Main");
1368  RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
1369 
1370  func = RNA_def_function(srna, "new", "rna_Main_lattices_new");
1371  RNA_def_function_ui_description(func, "Add a new lattice to the main database");
1372  parm = RNA_def_string(func, "name", "Lattice", 0, "", "New name for the data-block");
1374  /* return type */
1375  parm = RNA_def_pointer(func, "lattice", "Lattice", "", "New lattice data-block");
1376  RNA_def_function_return(func, parm);
1377 
1378  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1380  RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
1381  parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
1384  RNA_def_boolean(func,
1385  "do_unlink",
1386  true,
1387  "",
1388  "Unlink all usages of this lattice before deleting it "
1389  "(WARNING: will also delete objects instancing that lattice data)");
1390  RNA_def_boolean(func,
1391  "do_id_user",
1392  true,
1393  "",
1394  "Decrement user counter of all datablocks used by this lattice data");
1396  func, "do_ui_user", true, "", "Make sure interface does not reference this lattice data");
1397 
1398  func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
1399  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1401 }
1403 {
1404  StructRNA *srna;
1405  FunctionRNA *func;
1406  PropertyRNA *parm;
1407 
1408  RNA_def_property_srna(cprop, "BlendDataCurves");
1409  srna = RNA_def_struct(brna, "BlendDataCurves", NULL);
1410  RNA_def_struct_sdna(srna, "Main");
1411  RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
1412 
1413  func = RNA_def_function(srna, "new", "rna_Main_curves_new");
1414  RNA_def_function_ui_description(func, "Add a new curve to the main database");
1415  parm = RNA_def_string(func, "name", "Curve", 0, "", "New name for the data-block");
1417  parm = RNA_def_enum(
1418  func, "type", rna_enum_object_type_curve_items, 0, "Type", "The type of curve to add");
1420  /* return type */
1421  parm = RNA_def_pointer(func, "curve", "Curve", "", "New curve data-block");
1422  RNA_def_function_return(func, parm);
1423 
1424  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1426  RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
1427  parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
1430  RNA_def_boolean(func,
1431  "do_unlink",
1432  true,
1433  "",
1434  "Unlink all usages of this curve before deleting it "
1435  "(WARNING: will also delete objects instancing that curve data)");
1436  RNA_def_boolean(func,
1437  "do_id_user",
1438  true,
1439  "",
1440  "Decrement user counter of all datablocks used by this curve data");
1442  func, "do_ui_user", true, "", "Make sure interface does not reference this curve data");
1443 
1444  func = RNA_def_function(srna, "tag", "rna_Main_curves_tag");
1445  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1447 }
1449 {
1450  StructRNA *srna;
1451  FunctionRNA *func;
1452  PropertyRNA *parm;
1453 
1454  RNA_def_property_srna(cprop, "BlendDataMetaBalls");
1455  srna = RNA_def_struct(brna, "BlendDataMetaBalls", NULL);
1456  RNA_def_struct_sdna(srna, "Main");
1457  RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs");
1458 
1459  func = RNA_def_function(srna, "new", "rna_Main_metaballs_new");
1460  RNA_def_function_ui_description(func, "Add a new metaball to the main database");
1461  parm = RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the data-block");
1463  /* return type */
1464  parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball data-block");
1465  RNA_def_function_return(func, parm);
1466 
1467  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1469  RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile");
1470  parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove");
1473  RNA_def_boolean(func,
1474  "do_unlink",
1475  true,
1476  "",
1477  "Unlink all usages of this metaball before deleting it "
1478  "(WARNING: will also delete objects instancing that metaball data)");
1479  RNA_def_boolean(func,
1480  "do_id_user",
1481  true,
1482  "",
1483  "Decrement user counter of all datablocks used by this metaball data");
1485  func, "do_ui_user", true, "", "Make sure interface does not reference this metaball data");
1486 
1487  func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
1488  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1490 }
1492 {
1493  StructRNA *srna;
1494  FunctionRNA *func;
1495  PropertyRNA *parm;
1496 
1497  RNA_def_property_srna(cprop, "BlendDataFonts");
1498  srna = RNA_def_struct(brna, "BlendDataFonts", NULL);
1499  RNA_def_struct_sdna(srna, "Main");
1500  RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
1501 
1502  func = RNA_def_function(srna, "load", "rna_Main_fonts_load");
1504  RNA_def_function_ui_description(func, "Load a new font into the main database");
1505  parm = RNA_def_string_file_path(
1506  func, "filepath", "File Path", 0, "", "path of the font to load");
1508  RNA_def_boolean(func,
1509  "check_existing",
1510  false,
1511  "",
1512  "Using existing data-block if this file is already loaded");
1513  /* return type */
1514  parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "New font data-block");
1515  RNA_def_function_return(func, parm);
1516 
1517  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1519  RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
1520  parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
1524  func, "do_unlink", true, "", "Unlink all usages of this font before deleting it");
1526  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this font");
1528  func, "do_ui_user", true, "", "Make sure interface does not reference this font");
1529 
1530  func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
1531  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1533 }
1535 {
1536  StructRNA *srna;
1537  FunctionRNA *func;
1538  PropertyRNA *parm;
1539 
1540  RNA_def_property_srna(cprop, "BlendDataTextures");
1541  srna = RNA_def_struct(brna, "BlendDataTextures", NULL);
1542  RNA_def_struct_sdna(srna, "Main");
1543  RNA_def_struct_ui_text(srna, "Main Textures", "Collection of textures");
1544 
1545  func = RNA_def_function(srna, "new", "rna_Main_textures_new");
1546  RNA_def_function_ui_description(func, "Add a new texture to the main database");
1547  parm = RNA_def_string(func, "name", "Texture", 0, "", "New name for the data-block");
1549  parm = RNA_def_enum(
1550  func, "type", rna_enum_texture_type_items, 0, "Type", "The type of texture to add");
1552  /* return type */
1553  parm = RNA_def_pointer(func, "texture", "Texture", "", "New texture data-block");
1554  RNA_def_function_return(func, parm);
1555 
1556  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1558  RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
1559  parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
1563  func, "do_unlink", true, "", "Unlink all usages of this texture before deleting it");
1564  RNA_def_boolean(func,
1565  "do_id_user",
1566  true,
1567  "",
1568  "Decrement user counter of all datablocks used by this texture");
1570  func, "do_ui_user", true, "", "Make sure interface does not reference this texture");
1571 
1572  func = RNA_def_function(srna, "tag", "rna_Main_textures_tag");
1573  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1575 }
1577 {
1578  StructRNA *srna;
1579  FunctionRNA *func;
1580  PropertyRNA *parm;
1581 
1582  RNA_def_property_srna(cprop, "BlendDataBrushes");
1583  srna = RNA_def_struct(brna, "BlendDataBrushes", NULL);
1584  RNA_def_struct_sdna(srna, "Main");
1585  RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
1586 
1587  func = RNA_def_function(srna, "new", "rna_Main_brushes_new");
1588  RNA_def_function_ui_description(func, "Add a new brush to the main database");
1589  parm = RNA_def_string(func, "name", "Brush", 0, "", "New name for the data-block");
1591  parm = RNA_def_enum(func,
1592  "mode",
1595  "",
1596  "Paint Mode for the new brush");
1597  /* return type */
1598  parm = RNA_def_pointer(func, "brush", "Brush", "", "New brush data-block");
1599  RNA_def_function_return(func, parm);
1600 
1601  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1603  RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
1604  parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
1608  func, "do_unlink", true, "", "Unlink all usages of this brush before deleting it");
1610  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this brush");
1612  func, "do_ui_user", true, "", "Make sure interface does not reference this brush");
1613 
1614  func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
1615  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1617 
1618  func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_brush_gpencil_data");
1619  RNA_def_function_ui_description(func, "Add grease pencil brush settings");
1620  parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush");
1622 }
1623 
1625 {
1626  StructRNA *srna;
1627  FunctionRNA *func;
1628  PropertyRNA *parm;
1629 
1630  RNA_def_property_srna(cprop, "BlendDataWorlds");
1631  srna = RNA_def_struct(brna, "BlendDataWorlds", NULL);
1632  RNA_def_struct_sdna(srna, "Main");
1633  RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds");
1634 
1635  func = RNA_def_function(srna, "new", "rna_Main_worlds_new");
1636  RNA_def_function_ui_description(func, "Add a new world to the main database");
1637  parm = RNA_def_string(func, "name", "World", 0, "", "New name for the data-block");
1639  /* return type */
1640  parm = RNA_def_pointer(func, "world", "World", "", "New world data-block");
1641  RNA_def_function_return(func, parm);
1642 
1643  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1645  RNA_def_function_ui_description(func, "Remove a world from the current blendfile");
1646  parm = RNA_def_pointer(func, "world", "World", "", "World to remove");
1650  func, "do_unlink", true, "", "Unlink all usages of this world before deleting it");
1652  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this world");
1654  func, "do_ui_user", true, "", "Make sure interface does not reference this world");
1655 
1656  func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
1657  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1659 }
1660 
1662 {
1663  StructRNA *srna;
1664  FunctionRNA *func;
1665  PropertyRNA *parm;
1666 
1667  RNA_def_property_srna(cprop, "BlendDataCollections");
1668  srna = RNA_def_struct(brna, "BlendDataCollections", NULL);
1669  RNA_def_struct_sdna(srna, "Main");
1670  RNA_def_struct_ui_text(srna, "Main Collections", "Collection of collections");
1671 
1672  func = RNA_def_function(srna, "new", "rna_Main_collections_new");
1673  RNA_def_function_ui_description(func, "Add a new collection to the main database");
1674  parm = RNA_def_string(func, "name", "Collection", 0, "", "New name for the data-block");
1676  /* return type */
1677  parm = RNA_def_pointer(func, "collection", "Collection", "", "New collection data-block");
1678  RNA_def_function_return(func, parm);
1679 
1680  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1681  RNA_def_function_ui_description(func, "Remove a collection from the current blendfile");
1683  parm = RNA_def_pointer(func, "collection", "Collection", "", "Collection to remove");
1687  func, "do_unlink", true, "", "Unlink all usages of this collection before deleting it");
1688  RNA_def_boolean(func,
1689  "do_id_user",
1690  true,
1691  "",
1692  "Decrement user counter of all datablocks used by this collection");
1694  func, "do_ui_user", true, "", "Make sure interface does not reference this collection");
1695 
1696  func = RNA_def_function(srna, "tag", "rna_Main_collections_tag");
1697  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1699 }
1700 
1702 {
1703  StructRNA *srna;
1704  FunctionRNA *func;
1705  PropertyRNA *parm;
1706 
1707  RNA_def_property_srna(cprop, "BlendDataSpeakers");
1708  srna = RNA_def_struct(brna, "BlendDataSpeakers", NULL);
1709  RNA_def_struct_sdna(srna, "Main");
1710  RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers");
1711 
1712  func = RNA_def_function(srna, "new", "rna_Main_speakers_new");
1713  RNA_def_function_ui_description(func, "Add a new speaker to the main database");
1714  parm = RNA_def_string(func, "name", "Speaker", 0, "", "New name for the data-block");
1716  /* return type */
1717  parm = RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker data-block");
1718  RNA_def_function_return(func, parm);
1719 
1720  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1722  RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
1723  parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
1726  RNA_def_boolean(func,
1727  "do_unlink",
1728  true,
1729  "",
1730  "Unlink all usages of this speaker before deleting it "
1731  "(WARNING: will also delete objects instancing that speaker data)");
1732  RNA_def_boolean(func,
1733  "do_id_user",
1734  true,
1735  "",
1736  "Decrement user counter of all datablocks used by this speaker data");
1738  func, "do_ui_user", true, "", "Make sure interface does not reference this speaker data");
1739 
1740  func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
1741  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1743 }
1744 
1746 {
1747  StructRNA *srna;
1748  FunctionRNA *func;
1749  PropertyRNA *parm;
1750 
1751  RNA_def_property_srna(cprop, "BlendDataTexts");
1752  srna = RNA_def_struct(brna, "BlendDataTexts", NULL);
1753  RNA_def_struct_sdna(srna, "Main");
1754  RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
1755 
1756  func = RNA_def_function(srna, "new", "rna_Main_texts_new");
1757  RNA_def_function_ui_description(func, "Add a new text to the main database");
1758  parm = RNA_def_string(func, "name", "Text", 0, "", "New name for the data-block");
1760  /* return type */
1761  parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1762  RNA_def_function_return(func, parm);
1763 
1764  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1765  RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
1767  parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove");
1771  func, "do_unlink", true, "", "Unlink all usages of this text before deleting it");
1773  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this text");
1775  func, "do_ui_user", true, "", "Make sure interface does not reference this text");
1776 
1777  /* load func */
1778  func = RNA_def_function(srna, "load", "rna_Main_texts_load");
1780  RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
1781  parm = RNA_def_string_file_path(
1782  func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1784  parm = RNA_def_boolean(
1785  func, "internal", 0, "Make internal", "Make text file internal after loading");
1786  /* return type */
1787  parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1788  RNA_def_function_return(func, parm);
1789 
1790  func = RNA_def_function(srna, "tag", "rna_Main_texts_tag");
1791  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1793 }
1794 
1796 {
1797  StructRNA *srna;
1798  FunctionRNA *func;
1799  PropertyRNA *parm;
1800 
1801  RNA_def_property_srna(cprop, "BlendDataSounds");
1802  srna = RNA_def_struct(brna, "BlendDataSounds", NULL);
1803  RNA_def_struct_sdna(srna, "Main");
1804  RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
1805 
1806  /* load func */
1807  func = RNA_def_function(srna, "load", "rna_Main_sounds_load");
1808  RNA_def_function_ui_description(func, "Add a new sound to the main database from a file");
1809  parm = RNA_def_string_file_path(
1810  func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1812  RNA_def_boolean(func,
1813  "check_existing",
1814  false,
1815  "",
1816  "Using existing data-block if this file is already loaded");
1817  /* return type */
1818  parm = RNA_def_pointer(func, "sound", "Sound", "", "New text data-block");
1819  RNA_def_function_return(func, parm);
1820 
1821  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1823  RNA_def_function_ui_description(func, "Remove a sound from the current blendfile");
1824  parm = RNA_def_pointer(func, "sound", "Sound", "", "Sound to remove");
1828  func, "do_unlink", true, "", "Unlink all usages of this sound before deleting it");
1830  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this sound");
1832  func, "do_ui_user", true, "", "Make sure interface does not reference this sound");
1833 
1834  func = RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
1835  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1837 }
1838 
1840 {
1841  StructRNA *srna;
1842  FunctionRNA *func;
1843  PropertyRNA *parm;
1844 
1845  RNA_def_property_srna(cprop, "BlendDataArmatures");
1846  srna = RNA_def_struct(brna, "BlendDataArmatures", NULL);
1847  RNA_def_struct_sdna(srna, "Main");
1848  RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
1849 
1850  func = RNA_def_function(srna, "new", "rna_Main_armatures_new");
1851  RNA_def_function_ui_description(func, "Add a new armature to the main database");
1852  parm = RNA_def_string(func, "name", "Armature", 0, "", "New name for the data-block");
1854  /* return type */
1855  parm = RNA_def_pointer(func, "armature", "Armature", "", "New armature data-block");
1856  RNA_def_function_return(func, parm);
1857 
1858  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1860  RNA_def_function_ui_description(func, "Remove an armature from the current blendfile");
1861  parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
1864  RNA_def_boolean(func,
1865  "do_unlink",
1866  true,
1867  "",
1868  "Unlink all usages of this armature before deleting it "
1869  "(WARNING: will also delete objects instancing that armature data)");
1870  RNA_def_boolean(func,
1871  "do_id_user",
1872  true,
1873  "",
1874  "Decrement user counter of all datablocks used by this armature data");
1876  func, "do_ui_user", true, "", "Make sure interface does not reference this armature data");
1877 
1878  func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
1879  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1881 }
1883 {
1884  StructRNA *srna;
1885  FunctionRNA *func;
1886  PropertyRNA *parm;
1887 
1888  RNA_def_property_srna(cprop, "BlendDataActions");
1889  srna = RNA_def_struct(brna, "BlendDataActions", NULL);
1890  RNA_def_struct_sdna(srna, "Main");
1891  RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
1892 
1893  func = RNA_def_function(srna, "new", "rna_Main_actions_new");
1894  RNA_def_function_ui_description(func, "Add a new action to the main database");
1895  parm = RNA_def_string(func, "name", "Action", 0, "", "New name for the data-block");
1897  /* return type */
1898  parm = RNA_def_pointer(func, "action", "Action", "", "New action data-block");
1899  RNA_def_function_return(func, parm);
1900 
1901  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1903  RNA_def_function_ui_description(func, "Remove an action from the current blendfile");
1904  parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove");
1908  func, "do_unlink", true, "", "Unlink all usages of this action before deleting it");
1909  RNA_def_boolean(func,
1910  "do_id_user",
1911  true,
1912  "",
1913  "Decrement user counter of all datablocks used by this action");
1915  func, "do_ui_user", true, "", "Make sure interface does not reference this action");
1916 
1917  func = RNA_def_function(srna, "tag", "rna_Main_actions_tag");
1918  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1920 }
1922 {
1923  StructRNA *srna;
1924  FunctionRNA *func;
1925  PropertyRNA *parm;
1926 
1927  RNA_def_property_srna(cprop, "BlendDataParticles");
1928  srna = RNA_def_struct(brna, "BlendDataParticles", NULL);
1929  RNA_def_struct_sdna(srna, "Main");
1930  RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
1931 
1932  func = RNA_def_function(srna, "new", "rna_Main_particles_new");
1934  "Add a new particle settings instance to the main database");
1935  parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the data-block");
1937  /* return type */
1938  parm = RNA_def_pointer(
1939  func, "particle", "ParticleSettings", "", "New particle settings data-block");
1940  RNA_def_function_return(func, parm);
1941 
1942  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1945  func, "Remove a particle settings instance from the current blendfile");
1946  parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
1949  RNA_def_boolean(func,
1950  "do_unlink",
1951  true,
1952  "",
1953  "Unlink all usages of those particle settings before deleting them");
1954  RNA_def_boolean(func,
1955  "do_id_user",
1956  true,
1957  "",
1958  "Decrement user counter of all datablocks used by this particle settings");
1959  RNA_def_boolean(func,
1960  "do_ui_user",
1961  true,
1962  "",
1963  "Make sure interface does not reference this particle settings");
1964 
1965  func = RNA_def_function(srna, "tag", "rna_Main_particles_tag");
1966  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1968 }
1969 
1971 {
1972  StructRNA *srna;
1973  FunctionRNA *func;
1974  PropertyRNA *parm;
1975 
1976  RNA_def_property_srna(cprop, "BlendDataPalettes");
1977  srna = RNA_def_struct(brna, "BlendDataPalettes", NULL);
1978  RNA_def_struct_sdna(srna, "Main");
1979  RNA_def_struct_ui_text(srna, "Main Palettes", "Collection of palettes");
1980 
1981  func = RNA_def_function(srna, "new", "rna_Main_palettes_new");
1982  RNA_def_function_ui_description(func, "Add a new palette to the main database");
1983  parm = RNA_def_string(func, "name", "Palette", 0, "", "New name for the data-block");
1985  /* return type */
1986  parm = RNA_def_pointer(func, "palette", "Palette", "", "New palette data-block");
1987  RNA_def_function_return(func, parm);
1988 
1989  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1991  RNA_def_function_ui_description(func, "Remove a palette from the current blendfile");
1992  parm = RNA_def_pointer(func, "palette", "Palette", "", "Palette to remove");
1996  func, "do_unlink", true, "", "Unlink all usages of this palette before deleting it");
1997  RNA_def_boolean(func,
1998  "do_id_user",
1999  true,
2000  "",
2001  "Decrement user counter of all datablocks used by this palette");
2003  func, "do_ui_user", true, "", "Make sure interface does not reference this palette");
2004 
2005  func = RNA_def_function(srna, "tag", "rna_Main_palettes_tag");
2006  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2008 }
2010 {
2011  StructRNA *srna;
2012  FunctionRNA *func;
2013  PropertyRNA *parm;
2014 
2015  RNA_def_property_srna(cprop, "BlendDataCacheFiles");
2016  srna = RNA_def_struct(brna, "BlendDataCacheFiles", NULL);
2017  RNA_def_struct_sdna(srna, "Main");
2018  RNA_def_struct_ui_text(srna, "Main Cache Files", "Collection of cache files");
2019 
2020  func = RNA_def_function(srna, "tag", "rna_Main_cachefiles_tag");
2021  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2023 }
2025 {
2026  StructRNA *srna;
2027  FunctionRNA *func;
2028  PropertyRNA *parm;
2029 
2030  RNA_def_property_srna(cprop, "BlendDataPaintCurves");
2031  srna = RNA_def_struct(brna, "BlendDataPaintCurves", NULL);
2032  RNA_def_struct_sdna(srna, "Main");
2033  RNA_def_struct_ui_text(srna, "Main Paint Curves", "Collection of paint curves");
2034 
2035  func = RNA_def_function(srna, "tag", "rna_Main_paintcurves_tag");
2036  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2038 }
2040 {
2041  StructRNA *srna;
2042  FunctionRNA *func;
2043  PropertyRNA *parm;
2044 
2045  RNA_def_property_srna(cprop, "BlendDataGreasePencils");
2046  srna = RNA_def_struct(brna, "BlendDataGreasePencils", NULL);
2047  RNA_def_struct_sdna(srna, "Main");
2048  RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils");
2049 
2050  func = RNA_def_function(srna, "tag", "rna_Main_gpencils_tag");
2051  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2053 
2054  func = RNA_def_function(srna, "new", "rna_Main_gpencils_new");
2055  RNA_def_function_ui_description(func, "Add a new grease pencil datablock to the main database");
2056  parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the data-block");
2058  /* return type */
2059  parm = RNA_def_pointer(
2060  func, "grease_pencil", "GreasePencil", "", "New grease pencil data-block");
2061  RNA_def_function_return(func, parm);
2062 
2063  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2066  "Remove a grease pencil instance from the current blendfile");
2067  parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "Grease Pencil to remove");
2071  func, "do_unlink", true, "", "Unlink all usages of this grease pencil before deleting it");
2072  RNA_def_boolean(func,
2073  "do_id_user",
2074  true,
2075  "",
2076  "Decrement user counter of all datablocks used by this grease pencil");
2078  func, "do_ui_user", true, "", "Make sure interface does not reference this grease pencil");
2079 }
2080 
2082 {
2083  StructRNA *srna;
2084  FunctionRNA *func;
2085  PropertyRNA *parm;
2086 
2087  RNA_def_property_srna(cprop, "BlendDataMovieClips");
2088  srna = RNA_def_struct(brna, "BlendDataMovieClips", NULL);
2089  RNA_def_struct_sdna(srna, "Main");
2090  RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips");
2091 
2092  func = RNA_def_function(srna, "tag", "rna_Main_movieclips_tag");
2093  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2095 
2096  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2098  RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile.");
2099  parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
2103  func, "do_unlink", true, "", "Unlink all usages of this movie clip before deleting it");
2104  RNA_def_boolean(func,
2105  "do_id_user",
2106  true,
2107  "",
2108  "Decrement user counter of all datablocks used by this movie clip");
2110  func, "do_ui_user", true, "", "Make sure interface does not reference this movie clip");
2111 
2112  /* load func */
2113  func = RNA_def_function(srna, "load", "rna_Main_movieclip_load");
2116  func,
2117  "Add a new movie clip to the main database from a file "
2118  "(while ``check_existing`` is disabled for consistency with other load functions, "
2119  "behavior with multiple movie-clips using the same file may incorrectly generate proxies)");
2120  parm = RNA_def_string_file_path(
2121  func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
2123  RNA_def_boolean(func,
2124  "check_existing",
2125  false,
2126  "",
2127  "Using existing data-block if this file is already loaded");
2128  /* return type */
2129  parm = RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip data-block");
2130  RNA_def_function_return(func, parm);
2131 }
2132 
2134 {
2135  StructRNA *srna;
2136  FunctionRNA *func;
2137  PropertyRNA *parm;
2138 
2139  RNA_def_property_srna(cprop, "BlendDataMasks");
2140  srna = RNA_def_struct(brna, "BlendDataMasks", NULL);
2141  RNA_def_struct_sdna(srna, "Main");
2142  RNA_def_struct_ui_text(srna, "Main Masks", "Collection of masks");
2143 
2144  func = RNA_def_function(srna, "tag", "rna_Main_masks_tag");
2145  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2147 
2148  /* new func */
2149  func = RNA_def_function(srna, "new", "rna_Main_mask_new");
2150  RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database");
2151  parm = RNA_def_string(
2152  func, "name", NULL, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
2154  /* return type */
2155  parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask data-block");
2156  RNA_def_function_return(func, parm);
2157 
2158  /* remove func */
2159  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2161  RNA_def_function_ui_description(func, "Remove a mask from the current blendfile");
2162  parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to remove");
2166  func, "do_unlink", true, "", "Unlink all usages of this mask before deleting it");
2168  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this mask");
2170  func, "do_ui_user", true, "", "Make sure interface does not reference this mask");
2171 }
2172 
2174 {
2175  StructRNA *srna;
2176  FunctionRNA *func;
2177  PropertyRNA *parm;
2178 
2179  RNA_def_property_srna(cprop, "BlendDataLineStyles");
2180  srna = RNA_def_struct(brna, "BlendDataLineStyles", NULL);
2181  RNA_def_struct_sdna(srna, "Main");
2182  RNA_def_struct_ui_text(srna, "Main Line Styles", "Collection of line styles");
2183 
2184  func = RNA_def_function(srna, "tag", "rna_Main_linestyle_tag");
2185  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2187 
2188  func = RNA_def_function(srna, "new", "rna_Main_linestyles_new");
2189  RNA_def_function_ui_description(func, "Add a new line style instance to the main database");
2190  parm = RNA_def_string(func, "name", "FreestyleLineStyle", 0, "", "New name for the data-block");
2192  /* return type */
2193  parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "New line style data-block");
2194  RNA_def_function_return(func, parm);
2195 
2196  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2198  RNA_def_function_ui_description(func, "Remove a line style instance from the current blendfile");
2199  parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "Line style to remove");
2203  func, "do_unlink", true, "", "Unlink all usages of this line style before deleting it");
2204  RNA_def_boolean(func,
2205  "do_id_user",
2206  true,
2207  "",
2208  "Decrement user counter of all datablocks used by this line style");
2210  func, "do_ui_user", true, "", "Make sure interface does not reference this line style");
2211 }
2212 
2214 {
2215  StructRNA *srna;
2216  FunctionRNA *func;
2217  PropertyRNA *parm;
2218 
2219  RNA_def_property_srna(cprop, "BlendDataWorkSpaces");
2220  srna = RNA_def_struct(brna, "BlendDataWorkSpaces", NULL);
2221  RNA_def_struct_sdna(srna, "Main");
2222  RNA_def_struct_ui_text(srna, "Main Workspaces", "Collection of workspaces");
2223 
2224  func = RNA_def_function(srna, "tag", "rna_Main_workspaces_tag");
2225  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2227 }
2228 
2230 {
2231  StructRNA *srna;
2232  FunctionRNA *func;
2233  PropertyRNA *parm;
2234 
2235  RNA_def_property_srna(cprop, "BlendDataProbes");
2236  srna = RNA_def_struct(brna, "BlendDataProbes", NULL);
2237  RNA_def_struct_sdna(srna, "Main");
2238  RNA_def_struct_ui_text(srna, "Main Light Probes", "Collection of light probes");
2239 
2240  func = RNA_def_function(srna, "new", "rna_Main_lightprobe_new");
2241  RNA_def_function_ui_description(func, "Add a new light probe to the main database");
2242  parm = RNA_def_string(func, "name", "Probe", 0, "", "New name for the data-block");
2244  parm = RNA_def_enum(
2245  func, "type", rna_enum_lightprobes_type_items, 0, "Type", "The type of light probe to add");
2247  /* return type */
2248  parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "New light probe data-block");
2249  RNA_def_function_return(func, parm);
2250 
2251  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2253  RNA_def_function_ui_description(func, "Remove a light probe from the current blendfile");
2254  parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "Light probe to remove");
2257  RNA_def_boolean(func,
2258  "do_unlink",
2259  true,
2260  "",
2261  "Unlink all usages of this light probe before deleting it "
2262  "(WARNING: will also delete objects instancing that light probe data)");
2263  RNA_def_boolean(func,
2264  "do_id_user",
2265  true,
2266  "",
2267  "Decrement user counter of all datablocks used by this light probe");
2269  func, "do_ui_user", true, "", "Make sure interface does not reference this light probe");
2270 
2271  func = RNA_def_function(srna, "tag", "rna_Main_lightprobes_tag");
2272  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2274 }
2275 
2276 # ifdef WITH_HAIR_NODES
2277 void RNA_def_main_hairs(BlenderRNA *brna, PropertyRNA *cprop)
2278 {
2279  StructRNA *srna;
2280  FunctionRNA *func;
2281  PropertyRNA *parm;
2282 
2283  RNA_def_property_srna(cprop, "BlendDataHairs");
2284  srna = RNA_def_struct(brna, "BlendDataHairs", NULL);
2285  RNA_def_struct_sdna(srna, "Main");
2286  RNA_def_struct_ui_text(srna, "Main Hairs", "Collection of hairs");
2287 
2288  func = RNA_def_function(srna, "new", "rna_Main_hairs_new");
2289  RNA_def_function_ui_description(func, "Add a new hair to the main database");
2290  parm = RNA_def_string(func, "name", "Hair", 0, "", "New name for the data-block");
2292  /* return type */
2293  parm = RNA_def_pointer(func, "hair", "Hair", "", "New hair data-block");
2294  RNA_def_function_return(func, parm);
2295 
2296  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2298  RNA_def_function_ui_description(func, "Remove a hair from the current blendfile");
2299  parm = RNA_def_pointer(func, "hair", "Hair", "", "Hair to remove");
2302  RNA_def_boolean(func,
2303  "do_unlink",
2304  true,
2305  "",
2306  "Unlink all usages of this hair before deleting it "
2307  "(WARNING: will also delete objects instancing that hair data)");
2308  RNA_def_boolean(func,
2309  "do_id_user",
2310  true,
2311  "",
2312  "Decrement user counter of all datablocks used by this hair data");
2314  func, "do_ui_user", true, "", "Make sure interface does not reference this hair data");
2315 
2316  func = RNA_def_function(srna, "tag", "rna_Main_hairs_tag");
2317  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2319 }
2320 # endif
2321 
2322 # ifdef WITH_POINT_CLOUD
2323 void RNA_def_main_pointclouds(BlenderRNA *brna, PropertyRNA *cprop)
2324 {
2325  StructRNA *srna;
2326  FunctionRNA *func;
2327  PropertyRNA *parm;
2328 
2329  RNA_def_property_srna(cprop, "BlendDataPointClouds");
2330  srna = RNA_def_struct(brna, "BlendDataPointClouds", NULL);
2331  RNA_def_struct_sdna(srna, "Main");
2332  RNA_def_struct_ui_text(srna, "Main Point Clouds", "Collection of point clouds");
2333 
2334  func = RNA_def_function(srna, "new", "rna_Main_pointclouds_new");
2335  RNA_def_function_ui_description(func, "Add a new point cloud to the main database");
2336  parm = RNA_def_string(func, "name", "PointCloud", 0, "", "New name for the data-block");
2338  /* return type */
2339  parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "New point cloud data-block");
2340  RNA_def_function_return(func, parm);
2341 
2342  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2344  RNA_def_function_ui_description(func, "Remove a point cloud from the current blendfile");
2345  parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "Point cloud to remove");
2348  RNA_def_boolean(func,
2349  "do_unlink",
2350  true,
2351  "",
2352  "Unlink all usages of this point cloud before deleting it "
2353  "(WARNING: will also delete objects instancing that point cloud data)");
2354  RNA_def_boolean(func,
2355  "do_id_user",
2356  true,
2357  "",
2358  "Decrement user counter of all datablocks used by this point cloud data");
2359  RNA_def_boolean(func,
2360  "do_ui_user",
2361  true,
2362  "",
2363  "Make sure interface does not reference this point cloud data");
2364 
2365  func = RNA_def_function(srna, "tag", "rna_Main_pointclouds_tag");
2366  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2368 }
2369 # endif
2370 
2372 {
2373  StructRNA *srna;
2374  FunctionRNA *func;
2375  PropertyRNA *parm;
2376 
2377  RNA_def_property_srna(cprop, "BlendDataVolumes");
2378  srna = RNA_def_struct(brna, "BlendDataVolumes", NULL);
2379  RNA_def_struct_sdna(srna, "Main");
2380  RNA_def_struct_ui_text(srna, "Main Volumes", "Collection of volumes");
2381 
2382  func = RNA_def_function(srna, "new", "rna_Main_volumes_new");
2383  RNA_def_function_ui_description(func, "Add a new volume to the main database");
2384  parm = RNA_def_string(func, "name", "Volume", 0, "", "New name for the data-block");
2386  /* return type */
2387  parm = RNA_def_pointer(func, "volume", "Volume", "", "New volume data-block");
2388  RNA_def_function_return(func, parm);
2389 
2390  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2392  RNA_def_function_ui_description(func, "Remove a volume from the current blendfile");
2393  parm = RNA_def_pointer(func, "volume", "Volume", "", "Volume to remove");
2396  RNA_def_boolean(func,
2397  "do_unlink",
2398  true,
2399  "",
2400  "Unlink all usages of this volume before deleting it "
2401  "(WARNING: will also delete objects instancing that volume data)");
2402  RNA_def_boolean(func,
2403  "do_id_user",
2404  true,
2405  "",
2406  "Decrement user counter of all datablocks used by this volume data");
2408  func, "do_ui_user", true, "", "Make sure interface does not reference this volume data");
2409 
2410  func = RNA_def_function(srna, "tag", "rna_Main_volumes_tag");
2411  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2413 }
2414 
2415 # ifdef WITH_GEOMETRY_NODES
2416 void RNA_def_main_simulations(BlenderRNA *brna, PropertyRNA *cprop)
2417 {
2418  StructRNA *srna;
2419  FunctionRNA *func;
2420  PropertyRNA *parm;
2421 
2422  RNA_def_property_srna(cprop, "BlendDataSimulations");
2423  srna = RNA_def_struct(brna, "BlendDataSimulations", NULL);
2424  RNA_def_struct_sdna(srna, "Main");
2425  RNA_def_struct_ui_text(srna, "Main Simulations", "Collection of simulations");
2426 
2427  func = RNA_def_function(srna, "new", "rna_Main_simulations_new");
2428  RNA_def_function_ui_description(func, "Add a new simulation to the main database");
2429  parm = RNA_def_string(func, "name", "Simulation", 0, "", "New name for the data-block");
2431  /* return type */
2432  parm = RNA_def_pointer(func, "simulation", "Simulation", "", "New simulation data-block");
2433  RNA_def_function_return(func, parm);
2434 
2435  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2437  RNA_def_function_ui_description(func, "Remove a simulation from the current blendfile");
2438  parm = RNA_def_pointer(func, "simulation", "Simulation", "", "Simulation to remove");
2442  func, "do_unlink", true, "", "Unlink all usages of this simulation before deleting it");
2443  RNA_def_boolean(func,
2444  "do_id_user",
2445  true,
2446  "",
2447  "Decrement user counter of all datablocks used by this simulation data");
2449  func, "do_ui_user", true, "", "Make sure interface does not reference this simulation data");
2450 
2451  func = RNA_def_function(srna, "tag", "rna_Main_simulations_tag");
2452  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2454 }
2455 # endif
2456 
2457 #endif
Blender kernel action and pose functionality.
struct bAction * BKE_action_add(struct Main *bmain, const char name[])
Definition: action.c:320
struct bArmature * BKE_armature_add(struct Main *bmain, const char *name)
Definition: armature.c:345
void BKE_brush_init_gpencil_settings(struct Brush *brush)
Definition: brush.c:504
struct Brush * BKE_brush_add(struct Main *bmain, const char *name, const eObjectMode ob_mode)
Definition: brush.c:492
Camera data-block and utility functions.
void * BKE_camera_add(struct Main *bmain, const char *name)
Definition: camera.c:217
struct Collection * BKE_collection_add(struct Main *bmain, struct Collection *parent, const char *name)
Definition: collection.c:435
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:699
struct Curve * BKE_curve_add(struct Main *bmain, const char *name, int type)
Definition: curve.c:424
display list (or rather multi purpose list) stuff.
struct VFont * BKE_vfont_load_exists(struct Main *bmain, const char *filepath)
Definition: font.c:393
struct VFont * BKE_vfont_load(struct Main *bmain, const char *filepath)
Definition: font.c:315
struct bGPdata * BKE_gpencil_data_addnew(struct Main *bmain, const char name[])
Definition: gpencil.c:742
General operations for hairs.
void * BKE_hair_add(struct Main *bmain, const char *name)
Definition: hair.c:250
const char * BKE_idtype_idcode_to_name(const short idcode)
Definition: idtype.c:168
struct Image * BKE_image_load_exists(struct Main *bmain, const char *filepath)
Definition: image.c:880
struct Image * BKE_image_load(struct Main *bmain, const char *filepath)
Definition: image.c:811
struct Image * BKE_image_add_generated(struct Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, const float color[4], const bool stereo3d, const bool is_data, const bool tiled)
Definition: image.c:963
struct Lattice * BKE_lattice_add(struct Main *bmain, const char *name)
Definition: lattice.c:401
void id_us_min(struct ID *id)
Definition: lib_id.c:297
@ LIB_ID_FREE_NO_UI_USER
Definition: BKE_lib_id.h:204
@ LIB_ID_FREE_NO_USER_REFCOUNT
Definition: BKE_lib_id.h:193
void id_us_plus(struct ID *id)
Definition: lib_id.c:288
void BKE_id_delete(struct Main *bmain, void *idv) ATTR_NONNULL()
void id_fake_user_clear(struct ID *id)
Definition: lib_id.c:336
void BKE_id_free_ex(struct Main *bmain, void *idv, int flag, const bool use_flag_from_idtag)
General operations, lookup, etc. for blender lights.
struct Light * BKE_light_add(struct Main *bmain, const char *name) ATTR_WARN_UNUSED_RESULT
Definition: light.c:217
General operations for probes.
void BKE_lightprobe_type_set(struct LightProbe *probe, const short lightprobe_type)
Definition: lightprobe.c:115
void * BKE_lightprobe_add(struct Main *bmain, const char *name)
Definition: lightprobe.c:139
Blender kernel freestyle line style functionality.
FreestyleLineStyle * BKE_linestyle_new(struct Main *bmain, const char *name)
Definition: linestyle.c:807
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
struct Mask * BKE_mask_new(struct Main *bmain, const char *name)
Definition: mask.c:1038
General operations, lookup, etc. for materials.
void BKE_object_materials_test(struct Main *bmain, struct Object *ob, struct ID *id)
Definition: material.c:772
struct Material * BKE_material_add(struct Main *bmain, const char *name)
Definition: material.c:301
void BKE_gpencil_material_attr_init(struct Material *ma)
Definition: material.c:282
struct MetaBall * BKE_mball_add(struct Main *bmain, const char *name)
Definition: mball.c:214
struct Mesh * BKE_mesh_new_from_object_to_bmain(struct Main *bmain, struct Depsgraph *depsgraph, struct Object *object, bool preserve_all_data_layers)
struct Mesh * BKE_mesh_add(struct Main *bmain, const char *name)
Definition: mesh.c:849
struct MovieClip * BKE_movieclip_file_add_exists(struct Main *bmain, const char *filepath)
Definition: movieclip.c:1051
struct MovieClip * BKE_movieclip_file_add(struct Main *bmain, const char *name)
Definition: movieclip.c:987
struct bNodeTree * ntreeAddTree(struct Main *bmain, const char *name, const char *idname)
Definition: node.cc:2529
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_add_only_object(struct Main *bmain, int type, const char *name) ATTR_NONNULL(1) ATTR_RETURNS_NONNULL
Definition: object.c:2193
int BKE_object_obdata_to_type(const struct ID *id) ATTR_NONNULL(1)
struct Palette * BKE_palette_add(struct Main *bmain, const char *name)
Definition: paint.c:751
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
Definition: particle.c:4086
General operations for point-clouds.
void * BKE_pointcloud_add(struct Main *bmain, const char *name)
Definition: pointcloud.cc:216
void BKE_report(ReportList *reports, ReportType type, const char *message)
Definition: report.c:104
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
bool BKE_scene_can_be_removed(const struct Main *bmain, const struct Scene *scene)
struct Scene * BKE_scene_add(struct Main *bmain, const char *name)
Definition: scene.c:2078
void * BKE_simulation_add(struct Main *bmain, const char *name)
Definition: simulation.cc:180
struct bSound * BKE_sound_new_file(struct Main *main, const char *filepath)
struct bSound * BKE_sound_new_file_exists(struct Main *bmain, const char *filepath)
General operations for speakers.
void * BKE_speaker_add(struct Main *bmain, const char *name)
Definition: speaker.c:122
struct Text * BKE_text_add(struct Main *bmain, const char *name)
Definition: text.c:292
struct Text * BKE_text_load_ex(struct Main *bmain, const char *file, const char *relpath, const bool is_internal)
Definition: text.c:476
void BKE_texture_type_set(struct Tex *tex, int type)
Definition: texture.c:380
struct Tex * BKE_texture_add(struct Main *bmain, const char *name)
Definition: texture.c:387
Volume datablock.
void * BKE_volume_add(struct Main *bmain, const char *name)
Definition: volume.cc:671
struct World * BKE_world_add(struct Main *bmain, const char *name)
Definition: world.c:214
#define FILE_MAX
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
int BLI_utf8_invalid_strip(char *str, size_t length) ATTR_NONNULL()
Definition: string_utf8.c:203
#define UNUSED(x)
#define TIP_(msgid)
#define BPy_BEGIN_ALLOW_THREADS
Definition: BPY_extern.h:62
#define BPy_END_ALLOW_THREADS
Definition: BPY_extern.h:66
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void DEG_relations_tag_update(struct Main *bmain)
ID and Library types, which are fundamental for sdna.
@ LIB_TAG_NO_MAIN
Definition: DNA_ID.h:572
#define MAX_ID_NAME
Definition: DNA_ID.h:269
#define ID_REAL_USERS(id)
Definition: DNA_ID.h:413
@ ID_WM
Definition: DNA_ID_enums.h:84
@ ID_CA
Definition: DNA_ID_enums.h:68
@ ID_AR
Definition: DNA_ID_enums.h:78
@ ID_MC
Definition: DNA_ID_enums.h:85
@ ID_CF
Definition: DNA_ID_enums.h:90
@ ID_LI
Definition: DNA_ID_enums.h:58
@ ID_TE
Definition: DNA_ID_enums.h:64
@ ID_IM
Definition: DNA_ID_enums.h:65
@ ID_VO
Definition: DNA_ID_enums.h:95
@ ID_WS
Definition: DNA_ID_enums.h:91
@ ID_NT
Definition: DNA_ID_enums.h:80
@ ID_LA
Definition: DNA_ID_enums.h:67
@ ID_TXT
Definition: DNA_ID_enums.h:74
@ ID_SO
Definition: DNA_ID_enums.h:76
@ ID_SCE
Definition: DNA_ID_enums.h:57
@ ID_LS
Definition: DNA_ID_enums.h:87
@ ID_MSK
Definition: DNA_ID_enums.h:86
@ ID_GD
Definition: DNA_ID_enums.h:83
@ ID_PAL
Definition: DNA_ID_enums.h:88
@ ID_BR
Definition: DNA_ID_enums.h:81
@ ID_LP
Definition: DNA_ID_enums.h:92
@ ID_HA
Definition: DNA_ID_enums.h:93
@ ID_WO
Definition: DNA_ID_enums.h:71
@ ID_SIM
Definition: DNA_ID_enums.h:96
@ ID_MA
Definition: DNA_ID_enums.h:63
@ ID_AC
Definition: DNA_ID_enums.h:79
@ ID_SCR
Definition: DNA_ID_enums.h:72
@ ID_VF
Definition: DNA_ID_enums.h:73
@ ID_ME
Definition: DNA_ID_enums.h:60
@ ID_GR
Definition: DNA_ID_enums.h:77
@ ID_SPK
Definition: DNA_ID_enums.h:75
@ ID_MB
Definition: DNA_ID_enums.h:62
@ ID_LT
Definition: DNA_ID_enums.h:66
@ ID_OB
Definition: DNA_ID_enums.h:59
@ ID_PA
Definition: DNA_ID_enums.h:82
@ ID_PT
Definition: DNA_ID_enums.h:94
@ ID_CU
Definition: DNA_ID_enums.h:61
@ ID_PC
Definition: DNA_ID_enums.h:89
Object groups, one object can be in many groups at once.
@ OB_MODE_TEXTURE_PAINT
Object is a sort of wrapper for general info.
@ OB_MBALL
@ OB_EMPTY
@ OB_SURF
@ OB_FONT
@ OB_MESH
@ OB_CURVE
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint * textures
#define MEM_SAFE_FREE(v)
#define RNA_POINTER_INVALIDATE(ptr)
Definition: RNA_access.h:1425
const EnumPropertyItem * rna_node_tree_type_itemf(void *data, bool(*poll)(void *data, struct bNodeTreeType *), bool *r_free)
struct bNodeTreeType * rna_node_tree_type_from_enum(int value)
@ PARM_RNAPTR
Definition: RNA_types.h:339
@ PARM_REQUIRED
Definition: RNA_types.h:337
@ FUNC_USE_REPORTS
Definition: RNA_types.h:578
@ FUNC_USE_CONTEXT
Definition: RNA_types.h:577
@ PROP_THICK_WRAP
Definition: RNA_types.h:270
@ PROP_NEVER_NULL
Definition: RNA_types.h:225
#define C
Definition: RandGen.cpp:39
#define NC_WINDOW
Definition: WM_types.h:277
#define NC_ID
Definition: WM_types.h:296
#define NA_ADDED
Definition: WM_types.h:464
Scene scene
FreestyleLineStyle linestyle
World world
Simulation simulation
Light lamp
const Depsgraph * depsgraph
static CCL_NAMESPACE_BEGIN const double alpha
bNodeTree * ntree
#define GS(x)
Definition: iris.c:241
const EnumPropertyItem rna_enum_light_type_items[]
Definition: object_add.c:134
const EnumPropertyItem rna_enum_id_type_items[]
Definition: rna_ID.c:46
bool RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **r_identifier)
Definition: rna_access.c:6484
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4159
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1555
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4302
PropertyRNA * RNA_def_string_file_path(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3699
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4262
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3462
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1259
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1067
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4337
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3251
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4332
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1047
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3675
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3585
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3771
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1547
void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_main_api.c:898
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_lightprobes(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_volumes(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_paintcurves(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_api_main(StructRNA *UNUSED(srna))
Definition: rna_main_api.c:881
void RNA_def_main_lights(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_palettes(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_cachefiles(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_main_api.c:942
void RNA_def_main_collections(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_workspaces(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_main_api.c:975
const EnumPropertyItem rna_enum_lightprobes_type_items[]
Definition: rna_object.c:233
const EnumPropertyItem rna_enum_object_mode_items[]
Definition: rna_object.c:65
const EnumPropertyItem rna_enum_object_type_curve_items[]
Definition: rna_object.c:279
const EnumPropertyItem rna_enum_texture_type_items[]
Definition: rna_texture.c:58
Definition: DNA_ID.h:273
int tag
Definition: DNA_ID.h:292
void * prev
Definition: DNA_ID.h:274
void * next
Definition: DNA_ID.h:274
char name[66]
Definition: DNA_ID.h:283
short type
Definition: BKE_main.h:116
struct MaterialGPencilStyle * gp_style
void * data
void * data
Definition: RNA_types.h:52
char idname[64]
Definition: BKE_node.h:381
struct bNodeTreeType * typeinfo
struct bGPdata * gpd
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3157
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
Definition: wm_window.c:2257
Scene * WM_window_get_active_scene(const wmWindow *win)
Definition: wm_window.c:2249