Blender  V3.3
rna_main_api.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2009 Blender Foundation. All rights reserved. */
3 
8 #include <errno.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 
12 #include "DNA_ID.h"
13 #include "DNA_modifier_types.h"
14 #include "DNA_object_types.h"
15 #include "DNA_space_types.h"
16 
17 #include "BLI_utildefines.h"
18 
19 #include "RNA_access.h"
20 #include "RNA_define.h"
21 #include "RNA_enum_types.h"
22 
23 #include "rna_internal.h"
24 
25 #ifdef RNA_RUNTIME
26 
27 # include "BKE_action.h"
28 # include "BKE_armature.h"
29 # include "BKE_brush.h"
30 # include "BKE_camera.h"
31 # include "BKE_collection.h"
32 # include "BKE_curve.h"
33 # include "BKE_curves.h"
34 # include "BKE_displist.h"
35 # include "BKE_gpencil.h"
36 # include "BKE_icons.h"
37 # include "BKE_idtype.h"
38 # include "BKE_image.h"
39 # include "BKE_lattice.h"
40 # include "BKE_lib_remap.h"
41 # include "BKE_light.h"
42 # include "BKE_lightprobe.h"
43 # include "BKE_linestyle.h"
44 # include "BKE_mask.h"
45 # include "BKE_material.h"
46 # include "BKE_mball.h"
47 # include "BKE_mesh.h"
48 # include "BKE_movieclip.h"
49 # include "BKE_node.h"
50 # include "BKE_object.h"
51 # include "BKE_paint.h"
52 # include "BKE_particle.h"
53 # include "BKE_pointcloud.h"
54 # include "BKE_scene.h"
55 # include "BKE_simulation.h"
56 # include "BKE_sound.h"
57 # include "BKE_speaker.h"
58 # include "BKE_text.h"
59 # include "BKE_texture.h"
60 # include "BKE_vfont.h"
61 # include "BKE_volume.h"
62 # include "BKE_workspace.h"
63 # include "BKE_world.h"
64 
65 # include "DEG_depsgraph_build.h"
66 # include "DEG_depsgraph_query.h"
67 
68 # include "DNA_armature_types.h"
69 # include "DNA_brush_types.h"
70 # include "DNA_camera_types.h"
71 # include "DNA_collection_types.h"
72 # include "DNA_curve_types.h"
73 # include "DNA_curves_types.h"
74 # include "DNA_gpencil_types.h"
75 # include "DNA_lattice_types.h"
76 # include "DNA_light_types.h"
77 # include "DNA_lightprobe_types.h"
78 # include "DNA_mask_types.h"
79 # include "DNA_material_types.h"
80 # include "DNA_mesh_types.h"
81 # include "DNA_meta_types.h"
82 # include "DNA_movieclip_types.h"
83 # include "DNA_node_types.h"
84 # include "DNA_particle_types.h"
85 # include "DNA_pointcloud_types.h"
86 # include "DNA_simulation_types.h"
87 # include "DNA_sound_types.h"
88 # include "DNA_speaker_types.h"
89 # include "DNA_text_types.h"
90 # include "DNA_texture_types.h"
91 # include "DNA_vfont_types.h"
92 # include "DNA_volume_types.h"
93 # include "DNA_world_types.h"
94 
95 # include "ED_node.h"
96 # include "ED_screen.h"
97 
98 # include "BLT_translation.h"
99 
100 # ifdef WITH_PYTHON
101 # include "BPY_extern.h"
102 # endif
103 
104 # include "WM_api.h"
105 # include "WM_types.h"
106 
107 static void rna_idname_validate(const char *name, char *r_name)
108 {
109  BLI_strncpy(r_name, name, MAX_ID_NAME - 2);
110  BLI_str_utf8_invalid_strip(r_name, strlen(r_name));
111 }
112 
113 static void rna_Main_ID_remove(Main *bmain,
114  ReportList *reports,
115  PointerRNA *id_ptr,
116  bool do_unlink,
117  bool do_id_user,
118  bool do_ui_user)
119 {
120  ID *id = id_ptr->data;
121  if (id->tag & LIB_TAG_NO_MAIN) {
122  BKE_reportf(reports,
123  RPT_ERROR,
124  "%s '%s' is outside of main database and can not be removed from it",
126  id->name + 2);
127  return;
128  }
129  if (do_unlink) {
130  BKE_id_delete(bmain, id);
131  RNA_POINTER_INVALIDATE(id_ptr);
132  /* Force full redraw, mandatory to avoid crashes when running this from UI... */
134  }
135  else if (ID_REAL_USERS(id) <= 0) {
136  const int flag = (do_id_user ? 0 : LIB_ID_FREE_NO_USER_REFCOUNT) |
137  (do_ui_user ? 0 : LIB_ID_FREE_NO_UI_USER);
138  /* Still using ID flags here, this is in-between commit anyway... */
139  BKE_id_free_ex(bmain, id, flag, true);
140  RNA_POINTER_INVALIDATE(id_ptr);
141  }
142  else {
143  BKE_reportf(
144  reports,
145  RPT_ERROR,
146  "%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)",
148  id->name + 2,
149  ID_REAL_USERS(id));
150  }
151 }
152 
153 static Camera *rna_Main_cameras_new(Main *bmain, const char *name)
154 {
155  char safe_name[MAX_ID_NAME - 2];
156  rna_idname_validate(name, safe_name);
157 
158  ID *id = BKE_camera_add(bmain, safe_name);
159  id_us_min(id);
160 
162 
163  return (Camera *)id;
164 }
165 
166 static Scene *rna_Main_scenes_new(Main *bmain, const char *name)
167 {
168  char safe_name[MAX_ID_NAME - 2];
169  rna_idname_validate(name, safe_name);
170 
171  Scene *scene = BKE_scene_add(bmain, safe_name);
172 
174 
175  return scene;
176 }
177 static void rna_Main_scenes_remove(
178  Main *bmain, bContext *C, ReportList *reports, PointerRNA *scene_ptr, bool do_unlink)
179 {
180  /* don't call BKE_id_free(...) directly */
181  Scene *scene = scene_ptr->data;
182 
183  if (BKE_scene_can_be_removed(bmain, scene)) {
184  Scene *scene_new = scene->id.prev ? scene->id.prev : scene->id.next;
185  if (do_unlink) {
186  wmWindow *win = CTX_wm_window(C);
187 
188  if (WM_window_get_active_scene(win) == scene) {
189 
190 # ifdef WITH_PYTHON
192 # endif
193 
194  WM_window_set_active_scene(bmain, C, win, scene_new);
195 
196 # ifdef WITH_PYTHON
198 # endif
199  }
200  }
201  rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink, true, true);
202  }
203  else {
204  BKE_reportf(reports,
205  RPT_ERROR,
206  "Scene '%s' is the last local one, cannot be removed",
207  scene->id.name + 2);
208  }
209 }
210 
211 static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data)
212 {
213  if (data != NULL && (data->tag & LIB_TAG_NO_MAIN)) {
214  BKE_report(reports,
215  RPT_ERROR,
216  "Can not create object in main database with an evaluated data data-block");
217  return NULL;
218  }
219 
220  char safe_name[MAX_ID_NAME - 2];
221  rna_idname_validate(name, safe_name);
222 
223  Object *ob;
224  int type = OB_EMPTY;
225 
226  if (data) {
228  if (type == -1) {
229  const char *idname;
230  if (RNA_enum_id_from_value(rna_enum_id_type_items, GS(data->name), &idname) == 0) {
231  idname = "UNKNOWN";
232  }
233 
234  BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for an object", idname);
235  return NULL;
236  }
237 
238  id_us_plus(data);
239  }
240 
241  ob = BKE_object_add_only_object(bmain, type, safe_name);
242 
243  ob->data = data;
244  BKE_object_materials_test(bmain, ob, ob->data);
245 
247 
248  return ob;
249 }
250 
251 static Material *rna_Main_materials_new(Main *bmain, const char *name)
252 {
253  char safe_name[MAX_ID_NAME - 2];
254  rna_idname_validate(name, safe_name);
255 
256  ID *id = (ID *)BKE_material_add(bmain, safe_name);
257  id_us_min(id);
258 
260 
261  return (Material *)id;
262 }
263 
264 static void rna_Main_materials_gpencil_data(Main *UNUSED(bmain), PointerRNA *id_ptr)
265 {
266  ID *id = id_ptr->data;
267  Material *ma = (Material *)id;
269 }
270 
271 static void rna_Main_materials_gpencil_remove(Main *UNUSED(bmain), PointerRNA *id_ptr)
272 {
273  ID *id = id_ptr->data;
274  Material *ma = (Material *)id;
275  if (ma->gp_style) {
276  MEM_SAFE_FREE(ma->gp_style);
277  }
278 }
279 
280 static const EnumPropertyItem *rna_Main_nodetree_type_itemf(bContext *UNUSED(C),
282  PropertyRNA *UNUSED(prop),
283  bool *r_free)
284 {
285  return rna_node_tree_type_itemf(NULL, NULL, r_free);
286 }
287 static struct bNodeTree *rna_Main_nodetree_new(Main *bmain, const char *name, int type)
288 {
289  char safe_name[MAX_ID_NAME - 2];
290  rna_idname_validate(name, safe_name);
291 
293  if (typeinfo) {
294  bNodeTree *ntree = ntreeAddTree(bmain, safe_name, typeinfo->idname);
296 
297  id_us_min(&ntree->id);
298  return ntree;
299  }
300  else {
301  return NULL;
302  }
303 }
304 
305 static Mesh *rna_Main_meshes_new(Main *bmain, const char *name)
306 {
307  char safe_name[MAX_ID_NAME - 2];
308  rna_idname_validate(name, safe_name);
309 
310  Mesh *me = BKE_mesh_add(bmain, safe_name);
311  id_us_min(&me->id);
312 
314 
315  return me;
316 }
317 
318 /* copied from Mesh_getFromObject and adapted to RNA interface */
319 static Mesh *rna_Main_meshes_new_from_object(Main *bmain,
320  ReportList *reports,
321  Object *object,
322  bool preserve_all_data_layers,
324 {
325  switch (object->type) {
326  case OB_FONT:
327  case OB_CURVES_LEGACY:
328  case OB_SURF:
329  case OB_MBALL:
330  case OB_MESH:
331  break;
332  default:
333  BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
334  return NULL;
335  }
336 
338  bmain, depsgraph, object, preserve_all_data_layers);
339 
341 
342  return mesh;
343 }
344 
345 static Light *rna_Main_lights_new(Main *bmain, const char *name, int type)
346 {
347  char safe_name[MAX_ID_NAME - 2];
348  rna_idname_validate(name, safe_name);
349 
350  Light *lamp = BKE_light_add(bmain, safe_name);
351  lamp->type = type;
352  id_us_min(&lamp->id);
353 
355 
356  return lamp;
357 }
358 
359 static Image *rna_Main_images_new(Main *bmain,
360  const char *name,
361  int width,
362  int height,
363  bool alpha,
364  bool float_buffer,
365  bool stereo3d,
366  bool is_data,
367  bool tiled)
368 {
369  char safe_name[MAX_ID_NAME - 2];
370  rna_idname_validate(name, safe_name);
371 
372  float color[4] = {0.0, 0.0, 0.0, 1.0};
374  width,
375  height,
376  safe_name,
377  alpha ? 32 : 24,
378  float_buffer,
379  0,
380  color,
381  stereo3d,
382  is_data,
383  tiled);
384  id_us_min(&image->id);
385 
387 
388  return image;
389 }
390 static Image *rna_Main_images_load(Main *bmain,
391  ReportList *reports,
392  const char *filepath,
393  bool check_existing)
394 {
395  Image *ima;
396 
397  errno = 0;
398  if (check_existing) {
399  ima = BKE_image_load_exists(bmain, filepath);
400  }
401  else {
402  ima = BKE_image_load(bmain, filepath);
403  }
404 
405  if (!ima) {
406  BKE_reportf(reports,
407  RPT_ERROR,
408  "Cannot read '%s': %s",
409  filepath,
410  errno ? strerror(errno) : TIP_("unsupported image format"));
411  }
412 
413  id_us_min((ID *)ima);
414 
416 
417  return ima;
418 }
419 
420 static Lattice *rna_Main_lattices_new(Main *bmain, const char *name)
421 {
422  char safe_name[MAX_ID_NAME - 2];
423  rna_idname_validate(name, safe_name);
424 
425  Lattice *lt = BKE_lattice_add(bmain, safe_name);
426  id_us_min(&lt->id);
427 
429 
430  return lt;
431 }
432 
433 static Curve *rna_Main_curves_new(Main *bmain, const char *name, int type)
434 {
435  char safe_name[MAX_ID_NAME - 2];
436  rna_idname_validate(name, safe_name);
437 
438  Curve *cu = BKE_curve_add(bmain, safe_name, type);
439  id_us_min(&cu->id);
440 
442 
443  return cu;
444 }
445 
446 static MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name)
447 {
448  char safe_name[MAX_ID_NAME - 2];
449  rna_idname_validate(name, safe_name);
450 
451  MetaBall *mb = BKE_mball_add(bmain, safe_name);
452  id_us_min(&mb->id);
453 
455 
456  return mb;
457 }
458 
459 static VFont *rna_Main_fonts_load(Main *bmain,
460  ReportList *reports,
461  const char *filepath,
462  bool check_existing)
463 {
464  VFont *font;
465  errno = 0;
466 
467  if (check_existing) {
468  font = BKE_vfont_load_exists(bmain, filepath);
469  }
470  else {
471  font = BKE_vfont_load(bmain, filepath);
472  }
473 
474  if (!font) {
475  BKE_reportf(reports,
476  RPT_ERROR,
477  "Cannot read '%s': %s",
478  filepath,
479  errno ? strerror(errno) : TIP_("unsupported font format"));
480  }
481 
483 
484  return font;
485 }
486 
487 static Tex *rna_Main_textures_new(Main *bmain, const char *name, int type)
488 {
489  char safe_name[MAX_ID_NAME - 2];
490  rna_idname_validate(name, safe_name);
491 
492  Tex *tex = BKE_texture_add(bmain, safe_name);
494  id_us_min(&tex->id);
495 
497 
498  return tex;
499 }
500 
501 static Brush *rna_Main_brushes_new(Main *bmain, const char *name, int mode)
502 {
503  char safe_name[MAX_ID_NAME - 2];
504  rna_idname_validate(name, safe_name);
505 
506  Brush *brush = BKE_brush_add(bmain, safe_name, mode);
507  id_us_min(&brush->id);
508 
510 
511  return brush;
512 }
513 
514 static void rna_Main_brush_gpencil_data(Main *UNUSED(bmain), PointerRNA *id_ptr)
515 {
516  ID *id = id_ptr->data;
517  Brush *brush = (Brush *)id;
519 }
520 
521 static World *rna_Main_worlds_new(Main *bmain, const char *name)
522 {
523  char safe_name[MAX_ID_NAME - 2];
524  rna_idname_validate(name, safe_name);
525 
526  World *world = BKE_world_add(bmain, safe_name);
527  id_us_min(&world->id);
528 
530 
531  return world;
532 }
533 
534 static Collection *rna_Main_collections_new(Main *bmain, const char *name)
535 {
536  char safe_name[MAX_ID_NAME - 2];
537  rna_idname_validate(name, safe_name);
538 
539  Collection *collection = BKE_collection_add(bmain, NULL, safe_name);
540 
542 
543  return collection;
544 }
545 
546 static Speaker *rna_Main_speakers_new(Main *bmain, const char *name)
547 {
548  char safe_name[MAX_ID_NAME - 2];
549  rna_idname_validate(name, safe_name);
550 
551  Speaker *speaker = BKE_speaker_add(bmain, safe_name);
552  id_us_min(&speaker->id);
553 
555 
556  return speaker;
557 }
558 
559 static bSound *rna_Main_sounds_load(Main *bmain, const char *name, bool check_existing)
560 {
561  bSound *sound;
562 
563  if (check_existing) {
564  sound = BKE_sound_new_file_exists(bmain, name);
565  }
566  else {
567  sound = BKE_sound_new_file(bmain, name);
568  }
569 
570  id_us_min(&sound->id);
571 
573 
574  return sound;
575 }
576 
577 static Text *rna_Main_texts_new(Main *bmain, const char *name)
578 {
579  char safe_name[MAX_ID_NAME - 2];
580  rna_idname_validate(name, safe_name);
581 
582  Text *text = BKE_text_add(bmain, safe_name);
583 
585 
586  return text;
587 }
588 
589 static Text *rna_Main_texts_load(Main *bmain,
590  ReportList *reports,
591  const char *filepath,
592  bool is_internal)
593 {
594  Text *txt;
595 
596  errno = 0;
597  txt = BKE_text_load_ex(bmain, filepath, BKE_main_blendfile_path(bmain), is_internal);
598 
599  if (!txt) {
600  BKE_reportf(reports,
601  RPT_ERROR,
602  "Cannot read '%s': %s",
603  filepath,
604  errno ? strerror(errno) : TIP_("unable to load text"));
605  }
606 
608 
609  return txt;
610 }
611 
612 static bArmature *rna_Main_armatures_new(Main *bmain, const char *name)
613 {
614  char safe_name[MAX_ID_NAME - 2];
615  rna_idname_validate(name, safe_name);
616 
617  bArmature *arm = BKE_armature_add(bmain, safe_name);
618  id_us_min(&arm->id);
619 
621 
622  return arm;
623 }
624 
625 static bAction *rna_Main_actions_new(Main *bmain, const char *name)
626 {
627  char safe_name[MAX_ID_NAME - 2];
628  rna_idname_validate(name, safe_name);
629 
630  bAction *act = BKE_action_add(bmain, safe_name);
631  id_fake_user_clear(&act->id);
632  id_us_min(&act->id);
633 
635 
636  return act;
637 }
638 
639 static ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
640 {
641  char safe_name[MAX_ID_NAME - 2];
642  rna_idname_validate(name, safe_name);
643 
644  ParticleSettings *part = BKE_particlesettings_add(bmain, safe_name);
645  id_us_min(&part->id);
646 
648 
649  return part;
650 }
651 
652 static Palette *rna_Main_palettes_new(Main *bmain, const char *name)
653 {
654  char safe_name[MAX_ID_NAME - 2];
655  rna_idname_validate(name, safe_name);
656 
657  Palette *palette = BKE_palette_add(bmain, safe_name);
658  id_us_min(&palette->id);
659 
661 
662  return (Palette *)palette;
663 }
664 
665 static MovieClip *rna_Main_movieclip_load(Main *bmain,
666  ReportList *reports,
667  const char *filepath,
668  bool check_existing)
669 {
670  MovieClip *clip;
671 
672  errno = 0;
673 
674  if (check_existing) {
675  clip = BKE_movieclip_file_add_exists(bmain, filepath);
676  }
677  else {
678  clip = BKE_movieclip_file_add(bmain, filepath);
679  }
680 
681  if (clip != NULL) {
683  }
684  else {
685  BKE_reportf(reports,
686  RPT_ERROR,
687  "Cannot read '%s': %s",
688  filepath,
689  errno ? strerror(errno) : TIP_("unable to load movie clip"));
690  }
691 
692  id_us_min((ID *)clip);
693 
695 
696  return clip;
697 }
698 
699 static Mask *rna_Main_mask_new(Main *bmain, const char *name)
700 {
701  char safe_name[MAX_ID_NAME - 2];
702  rna_idname_validate(name, safe_name);
703 
704  Mask *mask = BKE_mask_new(bmain, safe_name);
705  id_us_min(&mask->id);
706 
708 
709  return mask;
710 }
711 
712 static FreestyleLineStyle *rna_Main_linestyles_new(Main *bmain, const char *name)
713 {
714  char safe_name[MAX_ID_NAME - 2];
715  rna_idname_validate(name, safe_name);
716 
717  FreestyleLineStyle *linestyle = BKE_linestyle_new(bmain, safe_name);
719 
721 
722  return linestyle;
723 }
724 
725 static LightProbe *rna_Main_lightprobe_new(Main *bmain, const char *name, int type)
726 {
727  char safe_name[MAX_ID_NAME - 2];
728  rna_idname_validate(name, safe_name);
729 
730  LightProbe *probe = BKE_lightprobe_add(bmain, safe_name);
731 
733 
734  id_us_min(&probe->id);
735 
737 
738  return probe;
739 }
740 
741 static bGPdata *rna_Main_gpencils_new(Main *bmain, const char *name)
742 {
743  char safe_name[MAX_ID_NAME - 2];
744  rna_idname_validate(name, safe_name);
745 
746  bGPdata *gpd = BKE_gpencil_data_addnew(bmain, safe_name);
747  id_us_min(&gpd->id);
748 
750 
751  return gpd;
752 }
753 
754 static Curves *rna_Main_hair_curves_new(Main *bmain, const char *name)
755 {
756  char safe_name[MAX_ID_NAME - 2];
757  rna_idname_validate(name, safe_name);
758 
759  Curves *curves = BKE_curves_add(bmain, safe_name);
760  id_us_min(&curves->id);
761 
763 
764  return curves;
765 }
766 
767 static PointCloud *rna_Main_pointclouds_new(Main *bmain, const char *name)
768 {
769  char safe_name[MAX_ID_NAME - 2];
770  rna_idname_validate(name, safe_name);
771 
772  PointCloud *pointcloud = BKE_pointcloud_add(bmain, safe_name);
773  id_us_min(&pointcloud->id);
774 
776 
777  return pointcloud;
778 }
779 
780 static Volume *rna_Main_volumes_new(Main *bmain, const char *name)
781 {
782  char safe_name[MAX_ID_NAME - 2];
783  rna_idname_validate(name, safe_name);
784 
785  Volume *volume = BKE_volume_add(bmain, safe_name);
786  id_us_min(&volume->id);
787 
789 
790  return volume;
791 }
792 
793 # ifdef WITH_SIMULATION_DATABLOCK
794 static Simulation *rna_Main_simulations_new(Main *bmain, const char *name)
795 {
796  char safe_name[MAX_ID_NAME - 2];
797  rna_idname_validate(name, safe_name);
798 
799  Simulation *simulation = BKE_simulation_add(bmain, safe_name);
801 
803 
804  return simulation;
805 }
806 # endif
807 
808 /* tag functions, all the same */
809 # define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
810  static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \
811  { \
812  BKE_main_id_tag_listbase(&bmain->_listbase_name, LIB_TAG_DOIT, value); \
813  }
814 
815 RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras, ID_CA)
816 RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes, ID_SCE)
817 RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects, ID_OB)
818 RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials, ID_MA)
819 RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees, ID_NT)
820 RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes, ID_ME)
821 RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights, ID_LA)
822 RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries, ID_LI)
823 RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens, ID_SCR)
824 RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM)
825 RNA_MAIN_ID_TAG_FUNCS_DEF(images, images, ID_IM)
826 RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices, ID_LT)
827 RNA_MAIN_ID_TAG_FUNCS_DEF(curves, curves, ID_CU_LEGACY)
828 RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs, ID_MB)
829 RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts, ID_VF)
830 RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures, ID_TE)
831 RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brushes, ID_BR)
832 RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds, ID_WO)
833 RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections, ID_GR)
834 // RNA_MAIN_ID_TAG_FUNCS_DEF(shape_keys, key, ID_KE)
835 RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts, ID_TXT)
836 RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers, ID_SPK)
837 RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds, ID_SO)
838 RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures, ID_AR)
839 RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions, ID_AC)
840 RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles, ID_PA)
841 RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL)
842 RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils, ID_GD)
843 RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips, ID_MC)
844 RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks, ID_MSK)
845 RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles, ID_LS)
846 RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF)
847 RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC)
848 RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS)
849 RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP)
850 RNA_MAIN_ID_TAG_FUNCS_DEF(hair_curves, hair_curves, ID_CV)
851 RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT)
852 RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO)
853 # ifdef WITH_SIMULATION_DATABLOCK
854 RNA_MAIN_ID_TAG_FUNCS_DEF(simulations, simulations, ID_SIM)
855 # endif
856 
857 # undef RNA_MAIN_ID_TAG_FUNCS_DEF
858 
859 #else
860 
862 {
863 # if 0
864  FunctionRNA *func;
865  PropertyRNA *parm;
866 
867  /* maybe we want to add functions in 'bpy.data' still?
868  * for now they are all in collections bpy.data.images.new(...) */
869  func = RNA_def_function(srna, "add_image", "rna_Main_add_image");
870  RNA_def_function_ui_description(func, "Add a new image");
871  parm = RNA_def_string_file_path(func, "filepath", NULL, 0, "", "File path to load image from");
873  parm = RNA_def_pointer(func, "image", "Image", "", "New image");
874  RNA_def_function_return(func, parm);
875 # endif
876 }
877 
879 {
880  StructRNA *srna;
881  FunctionRNA *func;
882  PropertyRNA *parm;
883 
884  RNA_def_property_srna(cprop, "BlendDataCameras");
885  srna = RNA_def_struct(brna, "BlendDataCameras", NULL);
886  RNA_def_struct_sdna(srna, "Main");
887  RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras");
888 
889  func = RNA_def_function(srna, "new", "rna_Main_cameras_new");
890  RNA_def_function_ui_description(func, "Add a new camera to the main database");
891  parm = RNA_def_string(func, "name", "Camera", 0, "", "New name for the data-block");
893  /* return type */
894  parm = RNA_def_pointer(func, "camera", "Camera", "", "New camera data-block");
895  RNA_def_function_return(func, parm);
896 
897  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
899  RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
900  parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
903  RNA_def_boolean(func,
904  "do_unlink",
905  true,
906  "",
907  "Unlink all usages of this camera before deleting it "
908  "(WARNING: will also delete objects instancing that camera data)");
909  RNA_def_boolean(func,
910  "do_id_user",
911  true,
912  "",
913  "Decrement user counter of all datablocks used by this camera");
915  func, "do_ui_user", true, "", "Make sure interface does not reference this camera");
916 
917  func = RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
918  parm = RNA_def_boolean(func, "value", 0, "Value", "");
920 }
921 
923 {
924  StructRNA *srna;
925  FunctionRNA *func;
926  PropertyRNA *parm;
927 
928  RNA_def_property_srna(cprop, "BlendDataScenes");
929  srna = RNA_def_struct(brna, "BlendDataScenes", NULL);
930  RNA_def_struct_sdna(srna, "Main");
931  RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");
932 
933  func = RNA_def_function(srna, "new", "rna_Main_scenes_new");
934  RNA_def_function_ui_description(func, "Add a new scene to the main database");
935  parm = RNA_def_string(func, "name", "Scene", 0, "", "New name for the data-block");
937  /* return type */
938  parm = RNA_def_pointer(func, "scene", "Scene", "", "New scene data-block");
939  RNA_def_function_return(func, parm);
940 
941  func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
943  RNA_def_function_ui_description(func, "Remove a scene from the current blendfile");
944  parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
948  func, "do_unlink", true, "", "Unlink all usages of this scene before deleting it");
949 
950  func = RNA_def_function(srna, "tag", "rna_Main_scenes_tag");
951  parm = RNA_def_boolean(func, "value", 0, "Value", "");
953 }
954 
956 {
957  StructRNA *srna;
958  FunctionRNA *func;
959  PropertyRNA *parm;
960 
961  RNA_def_property_srna(cprop, "BlendDataObjects");
962  srna = RNA_def_struct(brna, "BlendDataObjects", NULL);
963  RNA_def_struct_sdna(srna, "Main");
964  RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects");
965 
966  func = RNA_def_function(srna, "new", "rna_Main_objects_new");
968  RNA_def_function_ui_description(func, "Add a new object to the main database");
969  parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the data-block");
971  parm = RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object");
973 
974  /* return type */
975  parm = RNA_def_pointer(func, "object", "Object", "", "New object data-block");
976  RNA_def_function_return(func, parm);
977 
978  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
979  RNA_def_function_ui_description(func, "Remove an object from the current blendfile");
981  parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
985  func, "do_unlink", true, "", "Unlink all usages of this object before deleting it");
986  RNA_def_boolean(func,
987  "do_id_user",
988  true,
989  "",
990  "Decrement user counter of all datablocks used by this object");
992  func, "do_ui_user", true, "", "Make sure interface does not reference this object");
993 
994  func = RNA_def_function(srna, "tag", "rna_Main_objects_tag");
995  parm = RNA_def_boolean(func, "value", 0, "Value", "");
997 }
998 
1000 {
1001  StructRNA *srna;
1002  FunctionRNA *func;
1003  PropertyRNA *parm;
1004 
1005  RNA_def_property_srna(cprop, "BlendDataMaterials");
1006  srna = RNA_def_struct(brna, "BlendDataMaterials", NULL);
1007  RNA_def_struct_sdna(srna, "Main");
1008  RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials");
1009 
1010  func = RNA_def_function(srna, "new", "rna_Main_materials_new");
1011  RNA_def_function_ui_description(func, "Add a new material to the main database");
1012  parm = RNA_def_string(func, "name", "Material", 0, "", "New name for the data-block");
1014  /* return type */
1015  parm = RNA_def_pointer(func, "material", "Material", "", "New material data-block");
1016  RNA_def_function_return(func, parm);
1017 
1018  func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_materials_gpencil_data");
1019  RNA_def_function_ui_description(func, "Add grease pencil material settings");
1020  parm = RNA_def_pointer(func, "material", "Material", "", "Material");
1022 
1023  func = RNA_def_function(srna, "remove_gpencil_data", "rna_Main_materials_gpencil_remove");
1024  RNA_def_function_ui_description(func, "Remove grease pencil material settings");
1025  parm = RNA_def_pointer(func, "material", "Material", "", "Material");
1027 
1028  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1030  RNA_def_function_ui_description(func, "Remove a material from the current blendfile");
1031  parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
1035  func, "do_unlink", true, "", "Unlink all usages of this material before deleting it");
1036  RNA_def_boolean(func,
1037  "do_id_user",
1038  true,
1039  "",
1040  "Decrement user counter of all datablocks used by this material");
1042  func, "do_ui_user", true, "", "Make sure interface does not reference this material");
1043 
1044  func = RNA_def_function(srna, "tag", "rna_Main_materials_tag");
1045  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1047 }
1049 {
1050  StructRNA *srna;
1051  FunctionRNA *func;
1052  PropertyRNA *parm;
1053 
1054  static const EnumPropertyItem dummy_items[] = {
1055  {0, "DUMMY", 0, "", ""},
1056  {0, NULL, 0, NULL, NULL},
1057  };
1058 
1059  RNA_def_property_srna(cprop, "BlendDataNodeTrees");
1060  srna = RNA_def_struct(brna, "BlendDataNodeTrees", NULL);
1061  RNA_def_struct_sdna(srna, "Main");
1062  RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees");
1063 
1064  func = RNA_def_function(srna, "new", "rna_Main_nodetree_new");
1065  RNA_def_function_ui_description(func, "Add a new node tree to the main database");
1066  parm = RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the data-block");
1068  parm = RNA_def_enum(func, "type", dummy_items, 0, "Type", "The type of node_group to add");
1069  RNA_def_property_enum_funcs(parm, NULL, NULL, "rna_Main_nodetree_type_itemf");
1071  /* return type */
1072  parm = RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree data-block");
1073  RNA_def_function_return(func, parm);
1074 
1075  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1077  RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile");
1078  parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
1082  func, "do_unlink", true, "", "Unlink all usages of this node tree before deleting it");
1083  RNA_def_boolean(func,
1084  "do_id_user",
1085  true,
1086  "",
1087  "Decrement user counter of all datablocks used by this node tree");
1089  func, "do_ui_user", true, "", "Make sure interface does not reference this node tree");
1090 
1091  func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
1092  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1094 }
1096 {
1097  StructRNA *srna;
1098  FunctionRNA *func;
1099  PropertyRNA *parm;
1100 
1101  RNA_def_property_srna(cprop, "BlendDataMeshes");
1102  srna = RNA_def_struct(brna, "BlendDataMeshes", NULL);
1103  RNA_def_struct_sdna(srna, "Main");
1104  RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes");
1105 
1106  func = RNA_def_function(srna, "new", "rna_Main_meshes_new");
1107  RNA_def_function_ui_description(func, "Add a new mesh to the main database");
1108  parm = RNA_def_string(func, "name", "Mesh", 0, "", "New name for the data-block");
1110  /* return type */
1111  parm = RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh data-block");
1112  RNA_def_function_return(func, parm);
1113 
1114  func = RNA_def_function(srna, "new_from_object", "rna_Main_meshes_new_from_object");
1116  func,
1117  "Add a new mesh created from given object (undeformed geometry if object is original, and "
1118  "final evaluated geometry, with all modifiers etc., if object is evaluated)");
1120  parm = RNA_def_pointer(func, "object", "Object", "", "Object to create mesh from");
1122  RNA_def_boolean(func,
1123  "preserve_all_data_layers",
1124  false,
1125  "",
1126  "Preserve all data layers in the mesh, like UV maps and vertex groups. "
1127  "By default Blender only computes the subset of data layers needed for viewport "
1128  "display and rendering, for better performance");
1130  func,
1131  "depsgraph",
1132  "Depsgraph",
1133  "Dependency Graph",
1134  "Evaluated dependency graph which is required when preserve_all_data_layers is true");
1135  parm = RNA_def_pointer(func,
1136  "mesh",
1137  "Mesh",
1138  "",
1139  "Mesh created from object, remove it if it is only used for export");
1140  RNA_def_function_return(func, parm);
1141 
1142  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1144  RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
1145  parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
1148  RNA_def_boolean(func,
1149  "do_unlink",
1150  true,
1151  "",
1152  "Unlink all usages of this mesh before deleting it "
1153  "(WARNING: will also delete objects instancing that mesh data)");
1154  RNA_def_boolean(func,
1155  "do_id_user",
1156  true,
1157  "",
1158  "Decrement user counter of all datablocks used by this mesh data");
1160  func, "do_ui_user", true, "", "Make sure interface does not reference this mesh data");
1161 
1162  func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
1163  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1165 }
1166 
1168 {
1169  StructRNA *srna;
1170  FunctionRNA *func;
1171  PropertyRNA *parm;
1172 
1173  RNA_def_property_srna(cprop, "BlendDataLights");
1174  srna = RNA_def_struct(brna, "BlendDataLights", NULL);
1175  RNA_def_struct_sdna(srna, "Main");
1176  RNA_def_struct_ui_text(srna, "Main Lights", "Collection of lights");
1177 
1178  func = RNA_def_function(srna, "new", "rna_Main_lights_new");
1179  RNA_def_function_ui_description(func, "Add a new light to the main database");
1180  parm = RNA_def_string(func, "name", "Light", 0, "", "New name for the data-block");
1182  parm = RNA_def_enum(
1183  func, "type", rna_enum_light_type_items, 0, "Type", "The type of light to add");
1185  /* return type */
1186  parm = RNA_def_pointer(func, "light", "Light", "", "New light data-block");
1187  RNA_def_function_return(func, parm);
1188 
1189  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1191  RNA_def_function_ui_description(func, "Remove a light from the current blendfile");
1192  parm = RNA_def_pointer(func, "light", "Light", "", "Light to remove");
1195  RNA_def_boolean(func,
1196  "do_unlink",
1197  true,
1198  "",
1199  "Unlink all usages of this light before deleting it "
1200  "(WARNING: will also delete objects instancing that light data)");
1201  RNA_def_boolean(func,
1202  "do_id_user",
1203  true,
1204  "",
1205  "Decrement user counter of all datablocks used by this light data");
1207  func, "do_ui_user", true, "", "Make sure interface does not reference this light data");
1208 
1209  func = RNA_def_function(srna, "tag", "rna_Main_lights_tag");
1210  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1212 }
1213 
1215 {
1216  StructRNA *srna;
1217  FunctionRNA *func;
1218  PropertyRNA *parm;
1219 
1220  RNA_def_property_srna(cprop, "BlendDataLibraries");
1221  srna = RNA_def_struct(brna, "BlendDataLibraries", NULL);
1222  RNA_def_struct_sdna(srna, "Main");
1223  RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
1224 
1225  func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
1226  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1228 
1229  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1231  RNA_def_function_ui_description(func, "Remove a library from the current blendfile");
1232  parm = RNA_def_pointer(func, "library", "Library", "", "Library to remove");
1236  func, "do_unlink", true, "", "Unlink all usages of this library before deleting it");
1237  RNA_def_boolean(func,
1238  "do_id_user",
1239  true,
1240  "",
1241  "Decrement user counter of all datablocks used by this library");
1243  func, "do_ui_user", true, "", "Make sure interface does not reference this library");
1244 }
1245 
1247 {
1248  StructRNA *srna;
1249  FunctionRNA *func;
1250  PropertyRNA *parm;
1251 
1252  RNA_def_property_srna(cprop, "BlendDataScreens");
1253  srna = RNA_def_struct(brna, "BlendDataScreens", NULL);
1254  RNA_def_struct_sdna(srna, "Main");
1255  RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
1256 
1257  func = RNA_def_function(srna, "tag", "rna_Main_screens_tag");
1258  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1260 }
1261 
1263 {
1264  StructRNA *srna;
1265  FunctionRNA *func;
1266  PropertyRNA *parm;
1267 
1268  RNA_def_property_srna(cprop, "BlendDataWindowManagers");
1269  srna = RNA_def_struct(brna, "BlendDataWindowManagers", NULL);
1270  RNA_def_struct_sdna(srna, "Main");
1271  RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
1272 
1273  func = RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
1274  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1276 }
1278 {
1279  StructRNA *srna;
1280  FunctionRNA *func;
1281  PropertyRNA *parm;
1282 
1283  RNA_def_property_srna(cprop, "BlendDataImages");
1284  srna = RNA_def_struct(brna, "BlendDataImages", NULL);
1285  RNA_def_struct_sdna(srna, "Main");
1286  RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
1287 
1288  func = RNA_def_function(srna, "new", "rna_Main_images_new");
1289  RNA_def_function_ui_description(func, "Add a new image to the main database");
1290  parm = RNA_def_string(func, "name", "Image", 0, "", "New name for the data-block");
1292  parm = RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 1, INT_MAX);
1294  parm = RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 1, INT_MAX);
1296  RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel");
1298  func, "float_buffer", 0, "Float Buffer", "Create an image with floating-point color");
1299  RNA_def_boolean(func, "stereo3d", 0, "Stereo 3D", "Create left and right views");
1300  RNA_def_boolean(func, "is_data", 0, "Is Data", "Create image with non-color data color space");
1301  RNA_def_boolean(func, "tiled", 0, "Tiled", "Create a tiled image");
1302  /* return type */
1303  parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1304  RNA_def_function_return(func, parm);
1305 
1306  func = RNA_def_function(srna, "load", "rna_Main_images_load");
1308  RNA_def_function_ui_description(func, "Load a new image into the main database");
1309  parm = RNA_def_string_file_path(
1310  func, "filepath", "File Path", 0, "", "Path of the file to load");
1312  RNA_def_boolean(func,
1313  "check_existing",
1314  false,
1315  "",
1316  "Using existing data-block if this file is already loaded");
1317  /* return type */
1318  parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1319  RNA_def_function_return(func, parm);
1320 
1321  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1323  RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
1324  parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove");
1328  func, "do_unlink", true, "", "Unlink all usages of this image before deleting it");
1330  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this image");
1332  func, "do_ui_user", true, "", "Make sure interface does not reference this image");
1333 
1334  func = RNA_def_function(srna, "tag", "rna_Main_images_tag");
1335  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1337 }
1338 
1340 {
1341  StructRNA *srna;
1342  FunctionRNA *func;
1343  PropertyRNA *parm;
1344 
1345  RNA_def_property_srna(cprop, "BlendDataLattices");
1346  srna = RNA_def_struct(brna, "BlendDataLattices", NULL);
1347  RNA_def_struct_sdna(srna, "Main");
1348  RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
1349 
1350  func = RNA_def_function(srna, "new", "rna_Main_lattices_new");
1351  RNA_def_function_ui_description(func, "Add a new lattice to the main database");
1352  parm = RNA_def_string(func, "name", "Lattice", 0, "", "New name for the data-block");
1354  /* return type */
1355  parm = RNA_def_pointer(func, "lattice", "Lattice", "", "New lattice data-block");
1356  RNA_def_function_return(func, parm);
1357 
1358  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1360  RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
1361  parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
1364  RNA_def_boolean(func,
1365  "do_unlink",
1366  true,
1367  "",
1368  "Unlink all usages of this lattice before deleting it "
1369  "(WARNING: will also delete objects instancing that lattice data)");
1370  RNA_def_boolean(func,
1371  "do_id_user",
1372  true,
1373  "",
1374  "Decrement user counter of all datablocks used by this lattice data");
1376  func, "do_ui_user", true, "", "Make sure interface does not reference this lattice data");
1377 
1378  func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
1379  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1381 }
1383 {
1384  StructRNA *srna;
1385  FunctionRNA *func;
1386  PropertyRNA *parm;
1387 
1388  RNA_def_property_srna(cprop, "BlendDataCurves");
1389  srna = RNA_def_struct(brna, "BlendDataCurves", NULL);
1390  RNA_def_struct_sdna(srna, "Main");
1391  RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
1392 
1393  func = RNA_def_function(srna, "new", "rna_Main_curves_new");
1394  RNA_def_function_ui_description(func, "Add a new curve to the main database");
1395  parm = RNA_def_string(func, "name", "Curve", 0, "", "New name for the data-block");
1397  parm = RNA_def_enum(
1398  func, "type", rna_enum_object_type_curve_items, 0, "Type", "The type of curve to add");
1400  /* return type */
1401  parm = RNA_def_pointer(func, "curve", "Curve", "", "New curve data-block");
1402  RNA_def_function_return(func, parm);
1403 
1404  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1406  RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
1407  parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
1410  RNA_def_boolean(func,
1411  "do_unlink",
1412  true,
1413  "",
1414  "Unlink all usages of this curve before deleting it "
1415  "(WARNING: will also delete objects instancing that curve data)");
1416  RNA_def_boolean(func,
1417  "do_id_user",
1418  true,
1419  "",
1420  "Decrement user counter of all datablocks used by this curve data");
1422  func, "do_ui_user", true, "", "Make sure interface does not reference this curve data");
1423 
1424  func = RNA_def_function(srna, "tag", "rna_Main_curves_tag");
1425  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1427 }
1429 {
1430  StructRNA *srna;
1431  FunctionRNA *func;
1432  PropertyRNA *parm;
1433 
1434  RNA_def_property_srna(cprop, "BlendDataMetaBalls");
1435  srna = RNA_def_struct(brna, "BlendDataMetaBalls", NULL);
1436  RNA_def_struct_sdna(srna, "Main");
1437  RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs");
1438 
1439  func = RNA_def_function(srna, "new", "rna_Main_metaballs_new");
1440  RNA_def_function_ui_description(func, "Add a new metaball to the main database");
1441  parm = RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the data-block");
1443  /* return type */
1444  parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball data-block");
1445  RNA_def_function_return(func, parm);
1446 
1447  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1449  RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile");
1450  parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove");
1453  RNA_def_boolean(func,
1454  "do_unlink",
1455  true,
1456  "",
1457  "Unlink all usages of this metaball before deleting it "
1458  "(WARNING: will also delete objects instancing that metaball data)");
1459  RNA_def_boolean(func,
1460  "do_id_user",
1461  true,
1462  "",
1463  "Decrement user counter of all datablocks used by this metaball data");
1465  func, "do_ui_user", true, "", "Make sure interface does not reference this metaball data");
1466 
1467  func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
1468  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1470 }
1472 {
1473  StructRNA *srna;
1474  FunctionRNA *func;
1475  PropertyRNA *parm;
1476 
1477  RNA_def_property_srna(cprop, "BlendDataFonts");
1478  srna = RNA_def_struct(brna, "BlendDataFonts", NULL);
1479  RNA_def_struct_sdna(srna, "Main");
1480  RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
1481 
1482  func = RNA_def_function(srna, "load", "rna_Main_fonts_load");
1484  RNA_def_function_ui_description(func, "Load a new font into the main database");
1485  parm = RNA_def_string_file_path(
1486  func, "filepath", "File Path", 0, "", "path of the font to load");
1488  RNA_def_boolean(func,
1489  "check_existing",
1490  false,
1491  "",
1492  "Using existing data-block if this file is already loaded");
1493  /* return type */
1494  parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "New font data-block");
1495  RNA_def_function_return(func, parm);
1496 
1497  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1499  RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
1500  parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
1504  func, "do_unlink", true, "", "Unlink all usages of this font before deleting it");
1506  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this font");
1508  func, "do_ui_user", true, "", "Make sure interface does not reference this font");
1509 
1510  func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
1511  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1513 }
1515 {
1516  StructRNA *srna;
1517  FunctionRNA *func;
1518  PropertyRNA *parm;
1519 
1520  RNA_def_property_srna(cprop, "BlendDataTextures");
1521  srna = RNA_def_struct(brna, "BlendDataTextures", NULL);
1522  RNA_def_struct_sdna(srna, "Main");
1523  RNA_def_struct_ui_text(srna, "Main Textures", "Collection of textures");
1524 
1525  func = RNA_def_function(srna, "new", "rna_Main_textures_new");
1526  RNA_def_function_ui_description(func, "Add a new texture to the main database");
1527  parm = RNA_def_string(func, "name", "Texture", 0, "", "New name for the data-block");
1529  parm = RNA_def_enum(
1530  func, "type", rna_enum_texture_type_items, 0, "Type", "The type of texture to add");
1532  /* return type */
1533  parm = RNA_def_pointer(func, "texture", "Texture", "", "New texture data-block");
1534  RNA_def_function_return(func, parm);
1535 
1536  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1538  RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
1539  parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
1543  func, "do_unlink", true, "", "Unlink all usages of this texture before deleting it");
1544  RNA_def_boolean(func,
1545  "do_id_user",
1546  true,
1547  "",
1548  "Decrement user counter of all datablocks used by this texture");
1550  func, "do_ui_user", true, "", "Make sure interface does not reference this texture");
1551 
1552  func = RNA_def_function(srna, "tag", "rna_Main_textures_tag");
1553  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1555 }
1557 {
1558  StructRNA *srna;
1559  FunctionRNA *func;
1560  PropertyRNA *parm;
1561 
1562  RNA_def_property_srna(cprop, "BlendDataBrushes");
1563  srna = RNA_def_struct(brna, "BlendDataBrushes", NULL);
1564  RNA_def_struct_sdna(srna, "Main");
1565  RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
1566 
1567  func = RNA_def_function(srna, "new", "rna_Main_brushes_new");
1568  RNA_def_function_ui_description(func, "Add a new brush to the main database");
1569  parm = RNA_def_string(func, "name", "Brush", 0, "", "New name for the data-block");
1571  parm = RNA_def_enum(func,
1572  "mode",
1575  "",
1576  "Paint Mode for the new brush");
1577  /* return type */
1578  parm = RNA_def_pointer(func, "brush", "Brush", "", "New brush data-block");
1579  RNA_def_function_return(func, parm);
1580 
1581  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1583  RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
1584  parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
1588  func, "do_unlink", true, "", "Unlink all usages of this brush before deleting it");
1590  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this brush");
1592  func, "do_ui_user", true, "", "Make sure interface does not reference this brush");
1593 
1594  func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
1595  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1597 
1598  func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_brush_gpencil_data");
1599  RNA_def_function_ui_description(func, "Add grease pencil brush settings");
1600  parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush");
1602 }
1603 
1605 {
1606  StructRNA *srna;
1607  FunctionRNA *func;
1608  PropertyRNA *parm;
1609 
1610  RNA_def_property_srna(cprop, "BlendDataWorlds");
1611  srna = RNA_def_struct(brna, "BlendDataWorlds", NULL);
1612  RNA_def_struct_sdna(srna, "Main");
1613  RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds");
1614 
1615  func = RNA_def_function(srna, "new", "rna_Main_worlds_new");
1616  RNA_def_function_ui_description(func, "Add a new world to the main database");
1617  parm = RNA_def_string(func, "name", "World", 0, "", "New name for the data-block");
1619  /* return type */
1620  parm = RNA_def_pointer(func, "world", "World", "", "New world data-block");
1621  RNA_def_function_return(func, parm);
1622 
1623  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1625  RNA_def_function_ui_description(func, "Remove a world from the current blendfile");
1626  parm = RNA_def_pointer(func, "world", "World", "", "World to remove");
1630  func, "do_unlink", true, "", "Unlink all usages of this world before deleting it");
1632  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this world");
1634  func, "do_ui_user", true, "", "Make sure interface does not reference this world");
1635 
1636  func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
1637  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1639 }
1640 
1642 {
1643  StructRNA *srna;
1644  FunctionRNA *func;
1645  PropertyRNA *parm;
1646 
1647  RNA_def_property_srna(cprop, "BlendDataCollections");
1648  srna = RNA_def_struct(brna, "BlendDataCollections", NULL);
1649  RNA_def_struct_sdna(srna, "Main");
1650  RNA_def_struct_ui_text(srna, "Main Collections", "Collection of collections");
1651 
1652  func = RNA_def_function(srna, "new", "rna_Main_collections_new");
1653  RNA_def_function_ui_description(func, "Add a new collection to the main database");
1654  parm = RNA_def_string(func, "name", "Collection", 0, "", "New name for the data-block");
1656  /* return type */
1657  parm = RNA_def_pointer(func, "collection", "Collection", "", "New collection data-block");
1658  RNA_def_function_return(func, parm);
1659 
1660  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1661  RNA_def_function_ui_description(func, "Remove a collection from the current blendfile");
1663  parm = RNA_def_pointer(func, "collection", "Collection", "", "Collection to remove");
1667  func, "do_unlink", true, "", "Unlink all usages of this collection before deleting it");
1668  RNA_def_boolean(func,
1669  "do_id_user",
1670  true,
1671  "",
1672  "Decrement user counter of all datablocks used by this collection");
1674  func, "do_ui_user", true, "", "Make sure interface does not reference this collection");
1675 
1676  func = RNA_def_function(srna, "tag", "rna_Main_collections_tag");
1677  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1679 }
1680 
1682 {
1683  StructRNA *srna;
1684  FunctionRNA *func;
1685  PropertyRNA *parm;
1686 
1687  RNA_def_property_srna(cprop, "BlendDataSpeakers");
1688  srna = RNA_def_struct(brna, "BlendDataSpeakers", NULL);
1689  RNA_def_struct_sdna(srna, "Main");
1690  RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers");
1691 
1692  func = RNA_def_function(srna, "new", "rna_Main_speakers_new");
1693  RNA_def_function_ui_description(func, "Add a new speaker to the main database");
1694  parm = RNA_def_string(func, "name", "Speaker", 0, "", "New name for the data-block");
1696  /* return type */
1697  parm = RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker data-block");
1698  RNA_def_function_return(func, parm);
1699 
1700  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1702  RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
1703  parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
1706  RNA_def_boolean(func,
1707  "do_unlink",
1708  true,
1709  "",
1710  "Unlink all usages of this speaker before deleting it "
1711  "(WARNING: will also delete objects instancing that speaker data)");
1712  RNA_def_boolean(func,
1713  "do_id_user",
1714  true,
1715  "",
1716  "Decrement user counter of all datablocks used by this speaker data");
1718  func, "do_ui_user", true, "", "Make sure interface does not reference this speaker data");
1719 
1720  func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
1721  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1723 }
1724 
1726 {
1727  StructRNA *srna;
1728  FunctionRNA *func;
1729  PropertyRNA *parm;
1730 
1731  RNA_def_property_srna(cprop, "BlendDataTexts");
1732  srna = RNA_def_struct(brna, "BlendDataTexts", NULL);
1733  RNA_def_struct_sdna(srna, "Main");
1734  RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
1735 
1736  func = RNA_def_function(srna, "new", "rna_Main_texts_new");
1737  RNA_def_function_ui_description(func, "Add a new text to the main database");
1738  parm = RNA_def_string(func, "name", "Text", 0, "", "New name for the data-block");
1740  /* return type */
1741  parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1742  RNA_def_function_return(func, parm);
1743 
1744  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1745  RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
1747  parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove");
1751  func, "do_unlink", true, "", "Unlink all usages of this text before deleting it");
1753  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this text");
1755  func, "do_ui_user", true, "", "Make sure interface does not reference this text");
1756 
1757  /* load func */
1758  func = RNA_def_function(srna, "load", "rna_Main_texts_load");
1760  RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
1761  parm = RNA_def_string_file_path(
1762  func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1764  parm = RNA_def_boolean(
1765  func, "internal", 0, "Make internal", "Make text file internal after loading");
1766  /* return type */
1767  parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1768  RNA_def_function_return(func, parm);
1769 
1770  func = RNA_def_function(srna, "tag", "rna_Main_texts_tag");
1771  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1773 }
1774 
1776 {
1777  StructRNA *srna;
1778  FunctionRNA *func;
1779  PropertyRNA *parm;
1780 
1781  RNA_def_property_srna(cprop, "BlendDataSounds");
1782  srna = RNA_def_struct(brna, "BlendDataSounds", NULL);
1783  RNA_def_struct_sdna(srna, "Main");
1784  RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
1785 
1786  /* load func */
1787  func = RNA_def_function(srna, "load", "rna_Main_sounds_load");
1788  RNA_def_function_ui_description(func, "Add a new sound to the main database from a file");
1789  parm = RNA_def_string_file_path(
1790  func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1792  RNA_def_boolean(func,
1793  "check_existing",
1794  false,
1795  "",
1796  "Using existing data-block if this file is already loaded");
1797  /* return type */
1798  parm = RNA_def_pointer(func, "sound", "Sound", "", "New text data-block");
1799  RNA_def_function_return(func, parm);
1800 
1801  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1803  RNA_def_function_ui_description(func, "Remove a sound from the current blendfile");
1804  parm = RNA_def_pointer(func, "sound", "Sound", "", "Sound to remove");
1808  func, "do_unlink", true, "", "Unlink all usages of this sound before deleting it");
1810  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this sound");
1812  func, "do_ui_user", true, "", "Make sure interface does not reference this sound");
1813 
1814  func = RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
1815  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1817 }
1818 
1820 {
1821  StructRNA *srna;
1822  FunctionRNA *func;
1823  PropertyRNA *parm;
1824 
1825  RNA_def_property_srna(cprop, "BlendDataArmatures");
1826  srna = RNA_def_struct(brna, "BlendDataArmatures", NULL);
1827  RNA_def_struct_sdna(srna, "Main");
1828  RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
1829 
1830  func = RNA_def_function(srna, "new", "rna_Main_armatures_new");
1831  RNA_def_function_ui_description(func, "Add a new armature to the main database");
1832  parm = RNA_def_string(func, "name", "Armature", 0, "", "New name for the data-block");
1834  /* return type */
1835  parm = RNA_def_pointer(func, "armature", "Armature", "", "New armature data-block");
1836  RNA_def_function_return(func, parm);
1837 
1838  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1840  RNA_def_function_ui_description(func, "Remove an armature from the current blendfile");
1841  parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
1844  RNA_def_boolean(func,
1845  "do_unlink",
1846  true,
1847  "",
1848  "Unlink all usages of this armature before deleting it "
1849  "(WARNING: will also delete objects instancing that armature data)");
1850  RNA_def_boolean(func,
1851  "do_id_user",
1852  true,
1853  "",
1854  "Decrement user counter of all datablocks used by this armature data");
1856  func, "do_ui_user", true, "", "Make sure interface does not reference this armature data");
1857 
1858  func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
1859  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1861 }
1863 {
1864  StructRNA *srna;
1865  FunctionRNA *func;
1866  PropertyRNA *parm;
1867 
1868  RNA_def_property_srna(cprop, "BlendDataActions");
1869  srna = RNA_def_struct(brna, "BlendDataActions", NULL);
1870  RNA_def_struct_sdna(srna, "Main");
1871  RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
1872 
1873  func = RNA_def_function(srna, "new", "rna_Main_actions_new");
1874  RNA_def_function_ui_description(func, "Add a new action to the main database");
1875  parm = RNA_def_string(func, "name", "Action", 0, "", "New name for the data-block");
1877  /* return type */
1878  parm = RNA_def_pointer(func, "action", "Action", "", "New action data-block");
1879  RNA_def_function_return(func, parm);
1880 
1881  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1883  RNA_def_function_ui_description(func, "Remove an action from the current blendfile");
1884  parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove");
1888  func, "do_unlink", true, "", "Unlink all usages of this action before deleting it");
1889  RNA_def_boolean(func,
1890  "do_id_user",
1891  true,
1892  "",
1893  "Decrement user counter of all datablocks used by this action");
1895  func, "do_ui_user", true, "", "Make sure interface does not reference this action");
1896 
1897  func = RNA_def_function(srna, "tag", "rna_Main_actions_tag");
1898  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1900 }
1902 {
1903  StructRNA *srna;
1904  FunctionRNA *func;
1905  PropertyRNA *parm;
1906 
1907  RNA_def_property_srna(cprop, "BlendDataParticles");
1908  srna = RNA_def_struct(brna, "BlendDataParticles", NULL);
1909  RNA_def_struct_sdna(srna, "Main");
1910  RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
1911 
1912  func = RNA_def_function(srna, "new", "rna_Main_particles_new");
1914  "Add a new particle settings instance to the main database");
1915  parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the data-block");
1917  /* return type */
1918  parm = RNA_def_pointer(
1919  func, "particle", "ParticleSettings", "", "New particle settings data-block");
1920  RNA_def_function_return(func, parm);
1921 
1922  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1925  func, "Remove a particle settings instance from the current blendfile");
1926  parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
1929  RNA_def_boolean(func,
1930  "do_unlink",
1931  true,
1932  "",
1933  "Unlink all usages of those particle settings before deleting them");
1934  RNA_def_boolean(func,
1935  "do_id_user",
1936  true,
1937  "",
1938  "Decrement user counter of all datablocks used by this particle settings");
1939  RNA_def_boolean(func,
1940  "do_ui_user",
1941  true,
1942  "",
1943  "Make sure interface does not reference this particle settings");
1944 
1945  func = RNA_def_function(srna, "tag", "rna_Main_particles_tag");
1946  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1948 }
1949 
1951 {
1952  StructRNA *srna;
1953  FunctionRNA *func;
1954  PropertyRNA *parm;
1955 
1956  RNA_def_property_srna(cprop, "BlendDataPalettes");
1957  srna = RNA_def_struct(brna, "BlendDataPalettes", NULL);
1958  RNA_def_struct_sdna(srna, "Main");
1959  RNA_def_struct_ui_text(srna, "Main Palettes", "Collection of palettes");
1960 
1961  func = RNA_def_function(srna, "new", "rna_Main_palettes_new");
1962  RNA_def_function_ui_description(func, "Add a new palette to the main database");
1963  parm = RNA_def_string(func, "name", "Palette", 0, "", "New name for the data-block");
1965  /* return type */
1966  parm = RNA_def_pointer(func, "palette", "Palette", "", "New palette data-block");
1967  RNA_def_function_return(func, parm);
1968 
1969  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1971  RNA_def_function_ui_description(func, "Remove a palette from the current blendfile");
1972  parm = RNA_def_pointer(func, "palette", "Palette", "", "Palette to remove");
1976  func, "do_unlink", true, "", "Unlink all usages of this palette before deleting it");
1977  RNA_def_boolean(func,
1978  "do_id_user",
1979  true,
1980  "",
1981  "Decrement user counter of all datablocks used by this palette");
1983  func, "do_ui_user", true, "", "Make sure interface does not reference this palette");
1984 
1985  func = RNA_def_function(srna, "tag", "rna_Main_palettes_tag");
1986  parm = RNA_def_boolean(func, "value", 0, "Value", "");
1988 }
1990 {
1991  StructRNA *srna;
1992  FunctionRNA *func;
1993  PropertyRNA *parm;
1994 
1995  RNA_def_property_srna(cprop, "BlendDataCacheFiles");
1996  srna = RNA_def_struct(brna, "BlendDataCacheFiles", NULL);
1997  RNA_def_struct_sdna(srna, "Main");
1998  RNA_def_struct_ui_text(srna, "Main Cache Files", "Collection of cache files");
1999 
2000  func = RNA_def_function(srna, "tag", "rna_Main_cachefiles_tag");
2001  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2003 }
2005 {
2006  StructRNA *srna;
2007  FunctionRNA *func;
2008  PropertyRNA *parm;
2009 
2010  RNA_def_property_srna(cprop, "BlendDataPaintCurves");
2011  srna = RNA_def_struct(brna, "BlendDataPaintCurves", NULL);
2012  RNA_def_struct_sdna(srna, "Main");
2013  RNA_def_struct_ui_text(srna, "Main Paint Curves", "Collection of paint curves");
2014 
2015  func = RNA_def_function(srna, "tag", "rna_Main_paintcurves_tag");
2016  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2018 }
2020 {
2021  StructRNA *srna;
2022  FunctionRNA *func;
2023  PropertyRNA *parm;
2024 
2025  RNA_def_property_srna(cprop, "BlendDataGreasePencils");
2026  srna = RNA_def_struct(brna, "BlendDataGreasePencils", NULL);
2027  RNA_def_struct_sdna(srna, "Main");
2028  RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils");
2029 
2030  func = RNA_def_function(srna, "tag", "rna_Main_gpencils_tag");
2031  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2033 
2034  func = RNA_def_function(srna, "new", "rna_Main_gpencils_new");
2035  RNA_def_function_ui_description(func, "Add a new grease pencil datablock to the main database");
2036  parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the data-block");
2038  /* return type */
2039  parm = RNA_def_pointer(
2040  func, "grease_pencil", "GreasePencil", "", "New grease pencil data-block");
2041  RNA_def_function_return(func, parm);
2042 
2043  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2046  "Remove a grease pencil instance from the current blendfile");
2047  parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "Grease Pencil to remove");
2051  func, "do_unlink", true, "", "Unlink all usages of this grease pencil before deleting it");
2052  RNA_def_boolean(func,
2053  "do_id_user",
2054  true,
2055  "",
2056  "Decrement user counter of all datablocks used by this grease pencil");
2058  func, "do_ui_user", true, "", "Make sure interface does not reference this grease pencil");
2059 }
2060 
2062 {
2063  StructRNA *srna;
2064  FunctionRNA *func;
2065  PropertyRNA *parm;
2066 
2067  RNA_def_property_srna(cprop, "BlendDataMovieClips");
2068  srna = RNA_def_struct(brna, "BlendDataMovieClips", NULL);
2069  RNA_def_struct_sdna(srna, "Main");
2070  RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips");
2071 
2072  func = RNA_def_function(srna, "tag", "rna_Main_movieclips_tag");
2073  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2075 
2076  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2078  RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile.");
2079  parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
2083  func, "do_unlink", true, "", "Unlink all usages of this movie clip before deleting it");
2084  RNA_def_boolean(func,
2085  "do_id_user",
2086  true,
2087  "",
2088  "Decrement user counter of all datablocks used by this movie clip");
2090  func, "do_ui_user", true, "", "Make sure interface does not reference this movie clip");
2091 
2092  /* load func */
2093  func = RNA_def_function(srna, "load", "rna_Main_movieclip_load");
2096  func,
2097  "Add a new movie clip to the main database from a file "
2098  "(while ``check_existing`` is disabled for consistency with other load functions, "
2099  "behavior with multiple movie-clips using the same file may incorrectly generate proxies)");
2100  parm = RNA_def_string_file_path(
2101  func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
2103  RNA_def_boolean(func,
2104  "check_existing",
2105  false,
2106  "",
2107  "Using existing data-block if this file is already loaded");
2108  /* return type */
2109  parm = RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip data-block");
2110  RNA_def_function_return(func, parm);
2111 }
2112 
2114 {
2115  StructRNA *srna;
2116  FunctionRNA *func;
2117  PropertyRNA *parm;
2118 
2119  RNA_def_property_srna(cprop, "BlendDataMasks");
2120  srna = RNA_def_struct(brna, "BlendDataMasks", NULL);
2121  RNA_def_struct_sdna(srna, "Main");
2122  RNA_def_struct_ui_text(srna, "Main Masks", "Collection of masks");
2123 
2124  func = RNA_def_function(srna, "tag", "rna_Main_masks_tag");
2125  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2127 
2128  /* new func */
2129  func = RNA_def_function(srna, "new", "rna_Main_mask_new");
2130  RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database");
2131  parm = RNA_def_string(
2132  func, "name", NULL, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
2134  /* return type */
2135  parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask data-block");
2136  RNA_def_function_return(func, parm);
2137 
2138  /* remove func */
2139  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2141  RNA_def_function_ui_description(func, "Remove a mask from the current blendfile");
2142  parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to remove");
2146  func, "do_unlink", true, "", "Unlink all usages of this mask before deleting it");
2148  func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this mask");
2150  func, "do_ui_user", true, "", "Make sure interface does not reference this mask");
2151 }
2152 
2154 {
2155  StructRNA *srna;
2156  FunctionRNA *func;
2157  PropertyRNA *parm;
2158 
2159  RNA_def_property_srna(cprop, "BlendDataLineStyles");
2160  srna = RNA_def_struct(brna, "BlendDataLineStyles", NULL);
2161  RNA_def_struct_sdna(srna, "Main");
2162  RNA_def_struct_ui_text(srna, "Main Line Styles", "Collection of line styles");
2163 
2164  func = RNA_def_function(srna, "tag", "rna_Main_linestyle_tag");
2165  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2167 
2168  func = RNA_def_function(srna, "new", "rna_Main_linestyles_new");
2169  RNA_def_function_ui_description(func, "Add a new line style instance to the main database");
2170  parm = RNA_def_string(func, "name", "FreestyleLineStyle", 0, "", "New name for the data-block");
2172  /* return type */
2173  parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "New line style data-block");
2174  RNA_def_function_return(func, parm);
2175 
2176  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2178  RNA_def_function_ui_description(func, "Remove a line style instance from the current blendfile");
2179  parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "Line style to remove");
2183  func, "do_unlink", true, "", "Unlink all usages of this line style before deleting it");
2184  RNA_def_boolean(func,
2185  "do_id_user",
2186  true,
2187  "",
2188  "Decrement user counter of all datablocks used by this line style");
2190  func, "do_ui_user", true, "", "Make sure interface does not reference this line style");
2191 }
2192 
2194 {
2195  StructRNA *srna;
2196  FunctionRNA *func;
2197  PropertyRNA *parm;
2198 
2199  RNA_def_property_srna(cprop, "BlendDataWorkSpaces");
2200  srna = RNA_def_struct(brna, "BlendDataWorkSpaces", NULL);
2201  RNA_def_struct_sdna(srna, "Main");
2202  RNA_def_struct_ui_text(srna, "Main Workspaces", "Collection of workspaces");
2203 
2204  func = RNA_def_function(srna, "tag", "rna_Main_workspaces_tag");
2205  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2207 }
2208 
2210 {
2211  StructRNA *srna;
2212  FunctionRNA *func;
2213  PropertyRNA *parm;
2214 
2215  RNA_def_property_srna(cprop, "BlendDataProbes");
2216  srna = RNA_def_struct(brna, "BlendDataProbes", NULL);
2217  RNA_def_struct_sdna(srna, "Main");
2218  RNA_def_struct_ui_text(srna, "Main Light Probes", "Collection of light probes");
2219 
2220  func = RNA_def_function(srna, "new", "rna_Main_lightprobe_new");
2221  RNA_def_function_ui_description(func, "Add a new light probe to the main database");
2222  parm = RNA_def_string(func, "name", "Probe", 0, "", "New name for the data-block");
2224  parm = RNA_def_enum(
2225  func, "type", rna_enum_lightprobes_type_items, 0, "Type", "The type of light probe to add");
2227  /* return type */
2228  parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "New light probe data-block");
2229  RNA_def_function_return(func, parm);
2230 
2231  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2233  RNA_def_function_ui_description(func, "Remove a light probe from the current blendfile");
2234  parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "Light probe to remove");
2237  RNA_def_boolean(func,
2238  "do_unlink",
2239  true,
2240  "",
2241  "Unlink all usages of this light probe before deleting it "
2242  "(WARNING: will also delete objects instancing that light probe data)");
2243  RNA_def_boolean(func,
2244  "do_id_user",
2245  true,
2246  "",
2247  "Decrement user counter of all datablocks used by this light probe");
2249  func, "do_ui_user", true, "", "Make sure interface does not reference this light probe");
2250 
2251  func = RNA_def_function(srna, "tag", "rna_Main_lightprobes_tag");
2252  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2254 }
2255 
2257 {
2258  StructRNA *srna;
2259  FunctionRNA *func;
2260  PropertyRNA *parm;
2261 
2262  RNA_def_property_srna(cprop, "BlendDataHairCurves");
2263  srna = RNA_def_struct(brna, "BlendDataHairCurves", NULL);
2264  RNA_def_struct_sdna(srna, "Main");
2265  RNA_def_struct_ui_text(srna, "Main Hair Curves", "Collection of hair curves");
2266 
2267  func = RNA_def_function(srna, "new", "rna_Main_hair_curves_new");
2268  RNA_def_function_ui_description(func, "Add a new hair to the main database");
2269  parm = RNA_def_string(func, "name", "Curves", 0, "", "New name for the data-block");
2271  /* return type */
2272  parm = RNA_def_pointer(func, "curves", "Curves", "", "New curves data-block");
2273  RNA_def_function_return(func, parm);
2274 
2275  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2277  RNA_def_function_ui_description(func, "Remove a curves data-block from the current blendfile");
2278  parm = RNA_def_pointer(func, "curves", "Curves", "", "Curves data-block to remove");
2281  RNA_def_boolean(func,
2282  "do_unlink",
2283  true,
2284  "",
2285  "Unlink all usages of this curves before deleting it "
2286  "(WARNING: will also delete objects instancing that curves data)");
2287  RNA_def_boolean(func,
2288  "do_id_user",
2289  true,
2290  "",
2291  "Decrement user counter of all datablocks used by this curves data");
2293  func, "do_ui_user", true, "", "Make sure interface does not reference this curves data");
2294 
2295  func = RNA_def_function(srna, "tag", "rna_Main_hair_curves_tag");
2296  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2298 }
2299 
2301 {
2302  StructRNA *srna;
2303  FunctionRNA *func;
2304  PropertyRNA *parm;
2305 
2306  RNA_def_property_srna(cprop, "BlendDataPointClouds");
2307  srna = RNA_def_struct(brna, "BlendDataPointClouds", NULL);
2308  RNA_def_struct_sdna(srna, "Main");
2309  RNA_def_struct_ui_text(srna, "Main Point Clouds", "Collection of point clouds");
2310 
2311  func = RNA_def_function(srna, "new", "rna_Main_pointclouds_new");
2312  RNA_def_function_ui_description(func, "Add a new point cloud to the main database");
2313  parm = RNA_def_string(func, "name", "PointCloud", 0, "", "New name for the data-block");
2315  /* return type */
2316  parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "New point cloud data-block");
2317  RNA_def_function_return(func, parm);
2318 
2319  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2321  RNA_def_function_ui_description(func, "Remove a point cloud from the current blendfile");
2322  parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "Point cloud to remove");
2325  RNA_def_boolean(func,
2326  "do_unlink",
2327  true,
2328  "",
2329  "Unlink all usages of this point cloud before deleting it "
2330  "(WARNING: will also delete objects instancing that point cloud data)");
2331  RNA_def_boolean(func,
2332  "do_id_user",
2333  true,
2334  "",
2335  "Decrement user counter of all datablocks used by this point cloud data");
2336  RNA_def_boolean(func,
2337  "do_ui_user",
2338  true,
2339  "",
2340  "Make sure interface does not reference this point cloud data");
2341 
2342  func = RNA_def_function(srna, "tag", "rna_Main_pointclouds_tag");
2343  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2345 }
2346 
2348 {
2349  StructRNA *srna;
2350  FunctionRNA *func;
2351  PropertyRNA *parm;
2352 
2353  RNA_def_property_srna(cprop, "BlendDataVolumes");
2354  srna = RNA_def_struct(brna, "BlendDataVolumes", NULL);
2355  RNA_def_struct_sdna(srna, "Main");
2356  RNA_def_struct_ui_text(srna, "Main Volumes", "Collection of volumes");
2357 
2358  func = RNA_def_function(srna, "new", "rna_Main_volumes_new");
2359  RNA_def_function_ui_description(func, "Add a new volume to the main database");
2360  parm = RNA_def_string(func, "name", "Volume", 0, "", "New name for the data-block");
2362  /* return type */
2363  parm = RNA_def_pointer(func, "volume", "Volume", "", "New volume data-block");
2364  RNA_def_function_return(func, parm);
2365 
2366  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2368  RNA_def_function_ui_description(func, "Remove a volume from the current blendfile");
2369  parm = RNA_def_pointer(func, "volume", "Volume", "", "Volume to remove");
2372  RNA_def_boolean(func,
2373  "do_unlink",
2374  true,
2375  "",
2376  "Unlink all usages of this volume before deleting it "
2377  "(WARNING: will also delete objects instancing that volume data)");
2378  RNA_def_boolean(func,
2379  "do_id_user",
2380  true,
2381  "",
2382  "Decrement user counter of all datablocks used by this volume data");
2384  func, "do_ui_user", true, "", "Make sure interface does not reference this volume data");
2385 
2386  func = RNA_def_function(srna, "tag", "rna_Main_volumes_tag");
2387  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2389 }
2390 
2391 # ifdef WITH_SIMULATION_DATABLOCK
2392 void RNA_def_main_simulations(BlenderRNA *brna, PropertyRNA *cprop)
2393 {
2394  StructRNA *srna;
2395  FunctionRNA *func;
2396  PropertyRNA *parm;
2397 
2398  RNA_def_property_srna(cprop, "BlendDataSimulations");
2399  srna = RNA_def_struct(brna, "BlendDataSimulations", NULL);
2400  RNA_def_struct_sdna(srna, "Main");
2401  RNA_def_struct_ui_text(srna, "Main Simulations", "Collection of simulations");
2402 
2403  func = RNA_def_function(srna, "new", "rna_Main_simulations_new");
2404  RNA_def_function_ui_description(func, "Add a new simulation to the main database");
2405  parm = RNA_def_string(func, "name", "Simulation", 0, "", "New name for the data-block");
2407  /* return type */
2408  parm = RNA_def_pointer(func, "simulation", "Simulation", "", "New simulation data-block");
2409  RNA_def_function_return(func, parm);
2410 
2411  func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2413  RNA_def_function_ui_description(func, "Remove a simulation from the current blendfile");
2414  parm = RNA_def_pointer(func, "simulation", "Simulation", "", "Simulation to remove");
2418  func, "do_unlink", true, "", "Unlink all usages of this simulation before deleting it");
2419  RNA_def_boolean(func,
2420  "do_id_user",
2421  true,
2422  "",
2423  "Decrement user counter of all datablocks used by this simulation data");
2425  func, "do_ui_user", true, "", "Make sure interface does not reference this simulation data");
2426 
2427  func = RNA_def_function(srna, "tag", "rna_Main_simulations_tag");
2428  parm = RNA_def_boolean(func, "value", 0, "Value", "");
2430 }
2431 # endif
2432 
2433 #endif
Blender kernel action and pose functionality.
struct bAction * BKE_action_add(struct Main *bmain, const char name[])
Definition: action.c:332
struct bArmature * BKE_armature_add(struct Main *bmain, const char *name)
Definition: armature.c:334
struct Brush * BKE_brush_add(struct Main *bmain, const char *name, eObjectMode ob_mode)
Definition: brush.cc:496
void BKE_brush_init_gpencil_settings(struct Brush *brush)
Definition: brush.cc:509
Camera data-block and utility functions.
void * BKE_camera_add(struct Main *bmain, const char *name)
Definition: camera.c:203
struct Collection * BKE_collection_add(struct Main *bmain, struct Collection *parent, const char *name)
Definition: collection.c:425
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:723
struct Curve * BKE_curve_add(struct Main *bmain, const char *name, int type)
Definition: curve.cc:414
Low-level operations for curves that cannot be defined in the C++ header yet.
void * BKE_curves_add(struct Main *bmain, const char *name)
Definition: curves.cc:231
display list (or rather multi purpose list) stuff.
struct bGPdata * BKE_gpencil_data_addnew(struct Main *bmain, const char name[])
Definition: gpencil.c:705
const char * BKE_idtype_idcode_to_name(short idcode)
Definition: idtype.c:142
struct Image * BKE_image_load_exists(struct Main *bmain, const char *filepath)
struct Image * BKE_image_load(struct Main *bmain, const char *filepath)
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], bool stereo3d, bool is_data, bool tiled)
struct Lattice * BKE_lattice_add(struct Main *bmain, const char *name)
Definition: lattice.c:392
void id_us_min(struct ID *id)
Definition: lib_id.c:313
@ LIB_ID_FREE_NO_UI_USER
Definition: BKE_lib_id.h:256
@ LIB_ID_FREE_NO_USER_REFCOUNT
Definition: BKE_lib_id.h:245
void id_us_plus(struct ID *id)
Definition: lib_id.c:305
void BKE_id_free_ex(struct Main *bmain, void *idv, int flag, bool use_flag_from_idtag)
Definition: lib_id_delete.c:82
void BKE_id_delete(struct Main *bmain, void *idv) ATTR_NONNULL()
void id_fake_user_clear(struct ID *id)
Definition: lib_id.c:351
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:203
General operations for probes.
void BKE_lightprobe_type_set(struct LightProbe *probe, short lightprobe_type)
Definition: lightprobe.c:100
void * BKE_lightprobe_add(struct Main *bmain, const char *name)
Definition: lightprobe.c:124
Blender kernel freestyle line style functionality.
FreestyleLineStyle * BKE_linestyle_new(struct Main *bmain, const char *name)
Definition: linestyle.c:795
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:1022
General operations, lookup, etc. for materials.
void BKE_object_materials_test(struct Main *bmain, struct Object *ob, struct ID *id)
Definition: material.c:864
struct Material * BKE_material_add(struct Main *bmain, const char *name)
Definition: material.c:289
void BKE_gpencil_material_attr_init(struct Material *ma)
Definition: material.c:270
struct MetaBall * BKE_mball_add(struct Main *bmain, const char *name)
Definition: mball.c:200
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.cc:963
struct MovieClip * BKE_movieclip_file_add_exists(struct Main *bmain, const char *filepath)
Definition: movieclip.c:1031
struct MovieClip * BKE_movieclip_file_add(struct Main *bmain, const char *name)
Definition: movieclip.c:967
struct bNodeTree * ntreeAddTree(struct Main *bmain, const char *name, const char *idname)
Definition: node.cc:2674
General operations, lookup, etc. for blender objects.
int BKE_object_obdata_to_type(const struct ID *id) ATTR_NONNULL(1)
struct Object * BKE_object_add_only_object(struct Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
Definition: object.cc:2241
struct Palette * BKE_palette_add(struct Main *bmain, const char *name)
Definition: paint.c:764
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
Definition: particle.c:4115
General operations for point clouds.
void * BKE_pointcloud_add(struct Main *bmain, const char *name)
Definition: pointcloud.cc:219
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition: report.c:83
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.cc:2044
void * BKE_simulation_add(struct Main *bmain, const char *name)
Definition: simulation.cc:164
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:109
struct Text * BKE_text_add(struct Main *bmain, const char *name)
Definition: text.c:282
struct Text * BKE_text_load_ex(struct Main *bmain, const char *filepath, const char *relbase, bool is_internal) ATTR_NONNULL(1
void BKE_texture_type_set(struct Tex *tex, int type)
Definition: texture.c:366
struct Tex * BKE_texture_add(struct Main *bmain, const char *name)
Definition: texture.c:373
struct VFont * BKE_vfont_load_exists(struct Main *bmain, const char *filepath)
Definition: vfont.c:394
struct VFont * BKE_vfont_load(struct Main *bmain, const char *filepath)
Definition: vfont.c:316
Volume data-block.
void * BKE_volume_add(struct Main *bmain, const char *name)
Definition: volume.cc:690
struct World * BKE_world_add(struct Main *bmain, const char *name)
Definition: world.c:212
#define FILE_MAX
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
int BLI_str_utf8_invalid_strip(char *str, size_t length) ATTR_NONNULL(1)
Definition: string_utf8.c:181
#define UNUSED(x)
#define TIP_(msgid)
#define BPy_BEGIN_ALLOW_THREADS
Definition: BPY_extern.h:54
#define BPy_END_ALLOW_THREADS
Definition: BPY_extern.h:58
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
void DEG_relations_tag_update(struct Main *bmain)
ID and Library types, which are fundamental for sdna.
#define MAX_ID_NAME
Definition: DNA_ID.h:337
@ LIB_TAG_NO_MAIN
Definition: DNA_ID.h:744
#define ID_REAL_USERS(id)
Definition: DNA_ID.h:553
@ ID_WM
Definition: DNA_ID_enums.h:72
@ ID_CA
Definition: DNA_ID_enums.h:56
@ ID_AR
Definition: DNA_ID_enums.h:66
@ ID_MC
Definition: DNA_ID_enums.h:73
@ ID_CF
Definition: DNA_ID_enums.h:78
@ ID_LI
Definition: DNA_ID_enums.h:46
@ ID_TE
Definition: DNA_ID_enums.h:52
@ ID_IM
Definition: DNA_ID_enums.h:53
@ ID_VO
Definition: DNA_ID_enums.h:83
@ ID_WS
Definition: DNA_ID_enums.h:79
@ ID_NT
Definition: DNA_ID_enums.h:68
@ ID_LA
Definition: DNA_ID_enums.h:55
@ ID_TXT
Definition: DNA_ID_enums.h:62
@ ID_SO
Definition: DNA_ID_enums.h:64
@ ID_SCE
Definition: DNA_ID_enums.h:45
@ ID_LS
Definition: DNA_ID_enums.h:75
@ ID_MSK
Definition: DNA_ID_enums.h:74
@ ID_GD
Definition: DNA_ID_enums.h:71
@ ID_CV
Definition: DNA_ID_enums.h:81
@ ID_PAL
Definition: DNA_ID_enums.h:76
@ ID_BR
Definition: DNA_ID_enums.h:69
@ ID_LP
Definition: DNA_ID_enums.h:80
@ ID_WO
Definition: DNA_ID_enums.h:59
@ ID_SIM
Definition: DNA_ID_enums.h:84
@ ID_MA
Definition: DNA_ID_enums.h:51
@ ID_AC
Definition: DNA_ID_enums.h:67
@ ID_SCR
Definition: DNA_ID_enums.h:60
@ ID_CU_LEGACY
Definition: DNA_ID_enums.h:49
@ ID_VF
Definition: DNA_ID_enums.h:61
@ ID_ME
Definition: DNA_ID_enums.h:48
@ ID_GR
Definition: DNA_ID_enums.h:65
@ ID_SPK
Definition: DNA_ID_enums.h:63
@ ID_MB
Definition: DNA_ID_enums.h:50
@ ID_LT
Definition: DNA_ID_enums.h:54
@ ID_OB
Definition: DNA_ID_enums.h:47
@ ID_PA
Definition: DNA_ID_enums.h:70
@ ID_PT
Definition: DNA_ID_enums.h:82
@ ID_PC
Definition: DNA_ID_enums.h:77
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_CURVES_LEGACY
void ED_node_tree_propagate_change(const struct bContext *C, struct Main *bmain, struct bNodeTree *ntree)
_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 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 * textures
_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
#define MEM_SAFE_FREE(v)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
#define RNA_POINTER_INVALIDATE(ptr)
Definition: RNA_access.h:744
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:354
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_USE_REPORTS
Definition: RNA_types.h:663
@ FUNC_USE_CONTEXT
Definition: RNA_types.h:662
@ PROP_THICK_WRAP
Definition: RNA_types.h:285
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
#define C
Definition: RandGen.cpp:25
#define NC_WINDOW
Definition: WM_types.h:325
#define NC_ID
Definition: WM_types.h:345
#define NA_ADDED
Definition: WM_types.h:525
Scene scene
FreestyleLineStyle linestyle
World world
Simulation simulation
Light lamp
const Depsgraph * depsgraph
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
bNodeTree * ntree
smooth(Type::VEC4, "color_mul") .smooth(Type gpFillTexture gpSceneDepthTexture materials[GPENCIL_MATERIAL_BUFFER_LEN]
Definition: gpencil_info.hh:29
#define GS(x)
Definition: iris.c:225
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
const EnumPropertyItem rna_enum_light_type_items[]
Definition: object_add.cc:130
const EnumPropertyItem rna_enum_id_type_items[]
Definition: rna_ID.c:33
bool RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **r_identifier)
Definition: rna_access.c:5086
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4170
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1526
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
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:3711
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3474
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4342
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
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:3687
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:3597
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:3783
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
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:878
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_hair_curves(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_pointclouds(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:861
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:922
void RNA_def_main_collections(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_main_api.c:999
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:955
const EnumPropertyItem rna_enum_lightprobes_type_items[]
Definition: rna_object.c:228
const EnumPropertyItem rna_enum_object_mode_items[]
Definition: rna_object.c:53
const EnumPropertyItem rna_enum_object_type_curve_items[]
Definition: rna_object.c:274
const EnumPropertyItem rna_enum_texture_type_items[]
Definition: rna_texture.c:45
Definition: DNA_ID.h:368
int tag
Definition: DNA_ID.h:387
void * prev
Definition: DNA_ID.h:369
void * next
Definition: DNA_ID.h:369
char name[66]
Definition: DNA_ID.h:378
short type
Definition: BKE_main.h:121
struct MaterialGPencilStyle * gp_style
void * data
void * data
Definition: RNA_types.h:38
char idname[64]
Definition: BKE_node.h:375
struct bNodeTreeType * typeinfo
struct bGPdata * gpd
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
Definition: wm_window.c:2188
Scene * WM_window_get_active_scene(const wmWindow *win)
Definition: wm_window.c:2183