Blender V5.3
rna_main_api.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cerrno>
10#include <cstdlib>
11
12#include "DNA_ID.h"
13#include "DNA_space_types.h"
14
15#include "RNA_define.hh"
16#include "RNA_enum_types.hh"
17
18#include "rna_internal.hh"
19
20#ifdef RNA_RUNTIME
21
22# include "BLI_string.hh"
23# include "BLI_string_utf8.hh"
24
25# include "BKE_action.hh"
26# include "BKE_annotations.h"
27# include "BKE_armature.hh"
28# include "BKE_brush.hh"
29# include "BKE_camera.h"
30# include "BKE_collection.hh"
31# include "BKE_curve.hh"
32# include "BKE_curves.h"
33# include "BKE_grease_pencil.hh"
34# include "BKE_idtype.hh"
35# include "BKE_image.hh"
36# include "BKE_lattice.hh"
37# include "BKE_lib_id.hh"
38# include "BKE_lib_remap.hh"
39# include "BKE_library.hh"
40# include "BKE_light.h"
41# include "BKE_lightprobe.h"
42# include "BKE_linestyle.h"
43# include "BKE_main_invariants.hh"
44# include "BKE_mask.hh"
45# include "BKE_material.hh"
46# include "BKE_mball.hh"
47# include "BKE_mesh.hh"
48# include "BKE_movieclip.hh"
49# include "BKE_node.hh"
50# include "BKE_object.hh"
51# include "BKE_paint.hh"
52# include "BKE_particle.h"
53# include "BKE_pointcloud.hh"
54# include "BKE_scene.hh"
55# include "BKE_sound.hh"
56# include "BKE_speaker.hh"
57# include "BKE_text.h"
58# include "BKE_texture.h"
59# include "BKE_vfont.hh"
60# include "BKE_volume.hh"
61# include "BKE_world.h"
62
63# include "DEG_depsgraph_build.hh"
64# include "DEG_depsgraph_query.hh"
65
66# include "DNA_anim_types.h"
67# include "DNA_armature_types.h"
68# include "DNA_brush_types.h"
69# include "DNA_camera_types.h"
70# include "DNA_collection_types.h"
71# include "DNA_curve_types.h"
72# include "DNA_curves_types.h"
74# include "DNA_lattice_types.h"
75# include "DNA_light_types.h"
76# include "DNA_lightprobe_types.h"
77# include "DNA_mask_types.h"
78# include "DNA_material_types.h"
79# include "DNA_mesh_types.h"
80# include "DNA_meta_types.h"
81# include "DNA_movieclip_types.h"
82# include "DNA_node_types.h"
83# include "DNA_particle_types.h"
84# include "DNA_pointcloud_types.h"
85# include "DNA_sound_types.h"
86# include "DNA_speaker_types.h"
87# include "DNA_text_types.h"
88# include "DNA_texture_types.h"
89# include "DNA_vfont_types.h"
90# include "DNA_volume_types.h"
91# include "DNA_world_types.h"
92
93# include "ED_node.hh"
94# include "ED_scene.hh"
95
96# include "NOD_defaults.hh"
97
98# include "BLT_translation.hh"
99
100# ifdef WITH_PYTHON
101# include "BPY_extern.hh"
102# endif
103
104# include "WM_api.hh"
105# include "WM_types.hh"
106
107namespace blender {
108
109static void rna_idname_validate(const char *name, char *r_name)
110{
111 const size_t r_name_len = BLI_strncpy_rlen(r_name, name, MAX_ID_NAME - 2);
112 BLI_str_utf8_invalid_strip(r_name, r_name_len);
113}
114
115static void rna_Main_ID_remove(Main *bmain,
116 ReportList *reports,
117 PointerRNA *id_ptr,
118 bool do_unlink,
119 bool do_id_user,
120 bool do_ui_user)
121{
122 ID *id = static_cast<ID *>(id_ptr->data);
123 if (id->tag & ID_TAG_NO_MAIN) {
124 BKE_reportf(reports,
125 RPT_ERROR,
126 "%s '%s' is outside of main database and cannot be removed from it",
128 id->name + 2);
129 return;
130 }
131
132 const LightProbe *light_probe = nullptr;
133 if (GS(id->name) == ID_OB) {
134 const Object *ob = reinterpret_cast<Object *>(id);
135 if (ob->type == OB_LIGHTPROBE) {
136 light_probe = reinterpret_cast<LightProbe *>(ob->data);
137 }
138 }
139 else if (GS(id->name) == ID_LP) {
140 light_probe = reinterpret_cast<LightProbe *>(id);
141 }
142
143 /* Volume light probes being baked cannot be removed. */
144 if (light_probe && light_probe->type == LIGHTPROBE_TYPE_VOLUME) {
145 wmWindowManager *wm = bmain->wm.first();
147 BKE_reportf(reports,
148 RPT_ERROR,
149 "Cannot remove volume light probes while light probe baking is running");
150 return;
151 }
152 }
153
154 if (do_unlink) {
155 BKE_id_delete(bmain, id);
156 id_ptr->invalidate();
157 /* Force full redraw, mandatory to avoid crashes when running this from UI... */
161 }
162 else if (ID_REAL_USERS(id) <= 0) {
163 const int flag = (do_id_user ? 0 : LIB_ID_FREE_NO_USER_REFCOUNT) |
164 (do_ui_user ? 0 : LIB_ID_FREE_NO_UI_USER);
165 /* Still using ID flags here, this is in-between commit anyway... */
166 BKE_id_free_ex(bmain, id, flag, true);
167 id_ptr->invalidate();
168 }
169 else {
171 reports,
172 RPT_ERROR,
173 "%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)",
175 id->name + 2,
176 ID_REAL_USERS(id));
177 }
178}
179
180static ID *rna_Main_pack_linked_ids_hierarchy(struct BlendData *blenddata,
181 ReportList *reports,
182 ID *root_id)
183{
184 if (!ID_IS_LINKED(root_id)) {
185 BKE_reportf(reports, RPT_ERROR, "Only linked IDs can be packed");
186 return nullptr;
187 }
188 if (ID_IS_PACKED(root_id)) {
189 /* Nothing to do. */
190 return root_id;
191 }
192
193 Main *bmain = reinterpret_cast<Main *>(blenddata);
195
196 ID *packed_root_id = root_id->newid;
198
199 return packed_root_id;
200}
201
202static Camera *rna_Main_cameras_new(Main *bmain, const char *name)
203{
204 char safe_name[MAX_ID_NAME - 2];
205 rna_idname_validate(name, safe_name);
206
207 Camera *camera = BKE_camera_add(bmain, safe_name);
208 id_us_min(&camera->id);
209
211
212 return camera;
213}
214
215static Scene *rna_Main_scenes_new(Main *bmain, const char *name)
216{
217 char safe_name[MAX_ID_NAME - 2];
218 rna_idname_validate(name, safe_name);
219
220 Scene *scene = BKE_scene_add(bmain, safe_name);
221
223
224 return scene;
225}
226static void rna_Main_scenes_remove(
227 Main *bmain, bContext *C, ReportList *reports, PointerRNA *scene_ptr, bool do_unlink)
228{
229 /* don't call BKE_id_free(...) directly */
230 Scene *scene = static_cast<Scene *>(scene_ptr->data);
231
232 if (BKE_scene_can_be_removed(bmain, scene)) {
233 if (do_unlink) {
234 Scene *scene_new = BKE_scene_find_replacement(*bmain, *scene);
235 if (scene_new && ED_scene_replace_active_for_deletion(*C, *bmain, *scene, scene_new)) {
236 rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink, true, true);
237 return;
238 }
239 }
240 else {
241 rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink, true, true);
242 return;
243 }
244 }
245
246 BKE_reportf(reports,
247 RPT_ERROR,
248 "Scene '%s' is the last local one, cannot be removed",
249 scene->id.name + 2);
250}
251
252static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data)
253{
254 if (data != nullptr && (data->tag & ID_TAG_NO_MAIN)) {
255 BKE_report(reports,
256 RPT_ERROR,
257 "Cannot create object in main database with an evaluated data data-block");
258 return nullptr;
259 }
260
261 char safe_name[MAX_ID_NAME - 2];
262 rna_idname_validate(name, safe_name);
263
264 Object *ob;
265 int type = OB_EMPTY;
266
267 if (data) {
269 if (type == -1) {
270 const char *idname;
271 if (RNA_enum_id_from_value(rna_enum_id_type_items, GS(data->name), &idname) == 0) {
272 idname = "UNKNOWN";
273 }
274
275 BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for an object", idname);
276 return nullptr;
277 }
278
280 }
281
282 ob = BKE_object_add_only_object(bmain, ObjectType(type), safe_name);
283
284 ob->data = data;
285 BKE_object_materials_sync_length(bmain, ob, ob->data);
286
288
289 return ob;
290}
291
292static Material *rna_Main_materials_new(Main *bmain, const char *name)
293{
294 char safe_name[MAX_ID_NAME - 2];
295 rna_idname_validate(name, safe_name);
296
297 Material *material = BKE_material_add(bmain, safe_name);
298 id_us_min(&material->id);
299
300 nodes::node_tree_shader_default(nullptr, bmain, &material->id);
301
303
304 return material;
305}
306
307static void rna_Main_materials_gpencil_data(Main * /*bmain*/, PointerRNA *id_ptr)
308{
309 ID *id = static_cast<ID *>(id_ptr->data);
310 Material *ma = id_cast<Material *>(id);
312}
313
314static void rna_Main_materials_gpencil_remove(Main * /*bmain*/, PointerRNA *id_ptr)
315{
316 ID *id = static_cast<ID *>(id_ptr->data);
317 Material *ma = id_cast<Material *>(id);
318 if (ma->gp_style) {
319 MEM_SAFE_DELETE(ma->gp_style);
320 }
321}
322
323static const EnumPropertyItem *rna_Main_nodetree_type_itemf(bContext * /*C*/,
324 PointerRNA * /*ptr*/,
325 PropertyRNA * /*prop*/,
326 bool *r_free)
327{
328 return rna_node_tree_type_itemf(nullptr, nullptr, r_free);
329}
330static bNodeTree *rna_Main_nodetree_new(Main *bmain, const char *name, int type)
331{
332 char safe_name[MAX_ID_NAME - 2];
333 rna_idname_validate(name, safe_name);
334
336 if (typeinfo) {
337 bNodeTree *ntree = bke::node_tree_add_tree(bmain, safe_name, typeinfo->idname.ref());
339
340 id_us_min(&ntree->id);
341 return ntree;
342 }
343 else {
344 return nullptr;
345 }
346}
347
348static Mesh *rna_Main_meshes_new(Main *bmain, const char *name)
349{
350 char safe_name[MAX_ID_NAME - 2];
351 rna_idname_validate(name, safe_name);
352
353 Mesh *mesh = BKE_mesh_add(bmain, safe_name);
354 id_us_min(&mesh->id);
355
357
358 return mesh;
359}
360
361/* copied from Mesh_getFromObject and adapted to RNA interface */
362static Mesh *rna_Main_meshes_new_from_object(Main *bmain,
363 ReportList *reports,
364 Object *object,
365 bool preserve_all_data_layers,
366 Depsgraph *depsgraph)
367{
368 switch (object->type) {
369 case OB_FONT:
370 case OB_CURVES_LEGACY:
371 case OB_SURF:
372 case OB_MBALL:
373 case OB_MESH:
374 break;
375 default:
376 BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
377 return nullptr;
378 }
379
381 bmain, depsgraph, object, preserve_all_data_layers);
382
384
385 return mesh;
386}
387
388static Light *rna_Main_lights_new(Main *bmain, const char *name, int type)
389{
390 char safe_name[MAX_ID_NAME - 2];
391 rna_idname_validate(name, safe_name);
392
393 Light *lamp = BKE_light_add(bmain, safe_name);
394 lamp->type = eLightType(type);
395 id_us_min(&lamp->id);
396
398
399 return lamp;
400}
401
402static Image *rna_Main_images_new(Main *bmain,
403 const char *name,
404 int width,
405 int height,
406 bool alpha,
407 bool float_buffer,
408 bool stereo3d,
409 bool is_data,
410 bool tiled)
411{
412 char safe_name[MAX_ID_NAME - 2];
413 rna_idname_validate(name, safe_name);
414
415 float color[4] = {0.0, 0.0, 0.0, 1.0};
417 width,
418 height,
419 safe_name,
420 alpha ? 32 : 24,
421 float_buffer,
422 0,
423 color,
424 stereo3d,
425 is_data,
426 tiled);
427 id_us_min(&image->id);
428
430
431 return image;
432}
433static Image *rna_Main_images_load(Main *bmain,
434 ReportList *reports,
435 const char *filepath,
436 bool check_existing)
437{
438 Image *ima;
439
440 errno = 0;
441 if (check_existing) {
442 ima = BKE_image_load_exists(bmain, filepath);
443 }
444 else {
445 ima = BKE_image_load(bmain, filepath);
446 }
447
448 if (!ima) {
449 BKE_reportf(reports,
450 RPT_ERROR,
451 "Cannot read '%s': %s",
452 filepath,
453 errno ? strerror(errno) : RPT_("unsupported image format"));
454 }
455
456 id_us_min(id_cast<ID *>(ima));
457
459
460 return ima;
461}
462
463static Lattice *rna_Main_lattices_new(Main *bmain, const char *name)
464{
465 char safe_name[MAX_ID_NAME - 2];
466 rna_idname_validate(name, safe_name);
467
468 Lattice *lt = BKE_lattice_add(bmain, safe_name);
469 id_us_min(&lt->id);
470
472
473 return lt;
474}
475
476static Curve *rna_Main_curves_new(Main *bmain, const char *name, int type)
477{
478 char safe_name[MAX_ID_NAME - 2];
479 rna_idname_validate(name, safe_name);
480
481 Curve *cu = BKE_curve_add(bmain, safe_name, ObjectType(type));
482 id_us_min(&cu->id);
483
485
486 return cu;
487}
488
489static MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name)
490{
491 char safe_name[MAX_ID_NAME - 2];
492 rna_idname_validate(name, safe_name);
493
494 MetaBall *mb = BKE_mball_add(bmain, safe_name);
495 id_us_min(&mb->id);
496
498
499 return mb;
500}
501
502static VFont *rna_Main_fonts_load(Main *bmain,
503 ReportList *reports,
504 const char *filepath,
505 bool check_existing)
506{
507 VFont *font;
508 errno = 0;
509
510 if (check_existing) {
511 font = BKE_vfont_load_exists(bmain, filepath);
512 }
513 else {
514 font = BKE_vfont_load(bmain, filepath);
515 }
516
517 if (!font) {
518 BKE_reportf(reports,
519 RPT_ERROR,
520 "Cannot read '%s': %s",
521 filepath,
522 errno ? strerror(errno) : RPT_("unsupported font format"));
523 }
524
526
527 return font;
528}
529
530static Tex *rna_Main_textures_new(Main *bmain, const char *name, int type)
531{
532 char safe_name[MAX_ID_NAME - 2];
533 rna_idname_validate(name, safe_name);
534
535 Tex *tex = BKE_texture_add(bmain, safe_name);
537 id_us_min(&tex->id);
538
540
541 return tex;
542}
543
544static Brush *rna_Main_brushes_new(Main *bmain, const char *name, int mode)
545{
546 char safe_name[MAX_ID_NAME - 2];
547 rna_idname_validate(name, safe_name);
548
549 Brush *brush = BKE_brush_add(bmain, safe_name, eObjectMode(mode));
550 id_us_min(&brush->id);
551
553
554 return brush;
555}
556
557static void rna_Main_brush_gpencil_data(Main * /*bmain*/, PointerRNA *id_ptr)
558{
559 ID *id = static_cast<ID *>(id_ptr->data);
560 Brush *brush = reinterpret_cast<Brush *>(id);
562}
563
564static World *rna_Main_worlds_new(Main *bmain, const char *name)
565{
566 char safe_name[MAX_ID_NAME - 2];
567 rna_idname_validate(name, safe_name);
568
569 World *world = BKE_world_add(bmain, safe_name);
570 id_us_min(&world->id);
571
572 nodes::node_tree_shader_default(nullptr, bmain, &world->id);
573
575
576 return world;
577}
578
579static Collection *rna_Main_collections_new(Main *bmain, const char *name)
580{
581 char safe_name[MAX_ID_NAME - 2];
582 rna_idname_validate(name, safe_name);
583
584 Collection *collection = BKE_collection_add(bmain, nullptr, safe_name);
585
587
588 return collection;
589}
590
591static Speaker *rna_Main_speakers_new(Main *bmain, const char *name)
592{
593 char safe_name[MAX_ID_NAME - 2];
594 rna_idname_validate(name, safe_name);
595
596 Speaker *speaker = BKE_speaker_add(bmain, safe_name);
597 id_us_min(&speaker->id);
598
600
601 return speaker;
602}
603
604static bSound *rna_Main_sounds_load(Main *bmain, const char *name, bool check_existing)
605{
606 bSound *sound;
607
608 if (check_existing) {
609 sound = BKE_sound_new_file_exists(bmain, name);
610 }
611 else {
612 sound = BKE_sound_new_file(bmain, name);
613 }
614
615 id_us_min(&sound->id);
616
618
619 return sound;
620}
621
622static Text *rna_Main_texts_new(Main *bmain, const char *name)
623{
624 char safe_name[MAX_ID_NAME - 2];
625 rna_idname_validate(name, safe_name);
626
627 Text *text = BKE_text_add(bmain, safe_name);
628
630
631 return text;
632}
633
634static Text *rna_Main_texts_load(Main *bmain,
635 ReportList *reports,
636 const char *filepath,
637 bool is_internal)
638{
639 Text *txt;
640
641 errno = 0;
642 txt = BKE_text_load_ex(bmain, filepath, BKE_main_blendfile_path(bmain), is_internal);
643
644 if (!txt) {
645 BKE_reportf(reports,
646 RPT_ERROR,
647 "Cannot read '%s': %s",
648 filepath,
649 errno ? strerror(errno) : RPT_("unable to load text"));
650 }
651
653
654 return txt;
655}
656
657static bArmature *rna_Main_armatures_new(Main *bmain, const char *name)
658{
659 char safe_name[MAX_ID_NAME - 2];
660 rna_idname_validate(name, safe_name);
661
662 bArmature *arm = BKE_armature_add(bmain, safe_name);
663 id_us_min(&arm->id);
664
666
667 return arm;
668}
669
670static bAction *rna_Main_actions_new(Main *bmain, const char *name)
671{
672 char safe_name[MAX_ID_NAME - 2];
673 rna_idname_validate(name, safe_name);
674
675 bAction *act = BKE_action_add(bmain, safe_name);
676 id_fake_user_clear(&act->id);
677 id_us_min(&act->id);
678
680
681 return act;
682}
683
684static ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
685{
686 char safe_name[MAX_ID_NAME - 2];
687 rna_idname_validate(name, safe_name);
688
689 ParticleSettings *part = BKE_particlesettings_add(bmain, safe_name);
690 id_us_min(&part->id);
691
693
694 return part;
695}
696
697static Palette *rna_Main_palettes_new(Main *bmain, const char *name)
698{
699 char safe_name[MAX_ID_NAME - 2];
700 rna_idname_validate(name, safe_name);
701
702 Palette *palette = BKE_palette_add(bmain, safe_name);
703 id_us_min(&palette->id);
704
706
707 return static_cast<Palette *>(palette);
708}
709
710static MovieClip *rna_Main_movieclip_load(Main *bmain,
711 ReportList *reports,
712 const char *filepath,
713 bool check_existing)
714{
715 MovieClip *clip;
716
717 errno = 0;
718
719 if (check_existing) {
720 clip = BKE_movieclip_file_add_exists(bmain, filepath);
721 }
722 else {
723 clip = BKE_movieclip_file_add(bmain, filepath);
724 }
725
726 if (clip != nullptr) {
728 }
729 else {
730 BKE_reportf(reports,
731 RPT_ERROR,
732 "Cannot read '%s': %s",
733 filepath,
734 errno ? strerror(errno) : RPT_("unable to load movie clip"));
735 }
736
737 id_us_min(id_cast<ID *>(clip));
738
740
741 return clip;
742}
743
744static Mask *rna_Main_mask_new(Main *bmain, const char *name)
745{
746 char safe_name[MAX_ID_NAME - 2];
747 rna_idname_validate(name, safe_name);
748
749 Mask *mask = BKE_mask_new(bmain, safe_name);
750 id_us_min(&mask->id);
751
753
754 return mask;
755}
756
757static FreestyleLineStyle *rna_Main_linestyles_new(Main *bmain, const char *name)
758{
759 char safe_name[MAX_ID_NAME - 2];
760 rna_idname_validate(name, safe_name);
761
762 FreestyleLineStyle *linestyle = BKE_linestyle_new(bmain, safe_name);
763 id_us_min(&linestyle->id);
764
766
767 return linestyle;
768}
769
770static LightProbe *rna_Main_lightprobe_new(Main *bmain, const char *name, int type)
771{
772 char safe_name[MAX_ID_NAME - 2];
773 rna_idname_validate(name, safe_name);
774
775 LightProbe *probe = BKE_lightprobe_add(bmain, safe_name);
776
778
779 id_us_min(&probe->id);
780
782
783 return probe;
784}
785
786static bGPdata *rna_Main_annotations_new(Main *bmain, const char *name)
787{
788 char safe_name[MAX_ID_NAME - 2];
789 rna_idname_validate(name, safe_name);
790
791 bGPdata *gpd = BKE_annotations_data_addnew(bmain, safe_name);
792 id_us_min(&gpd->id);
793
795
796 return gpd;
797}
798
799static GreasePencil *rna_Main_grease_pencils_new(Main *bmain, const char *name)
800{
801 char safe_name[MAX_ID_NAME - 2];
802 rna_idname_validate(name, safe_name);
803
804 GreasePencil *grease_pencil = BKE_grease_pencil_add(bmain, safe_name);
805 id_us_min(&grease_pencil->id);
806
808
809 return grease_pencil;
810}
811
812static Curves *rna_Main_hair_curves_new(Main *bmain, const char *name)
813{
814 char safe_name[MAX_ID_NAME - 2];
815 rna_idname_validate(name, safe_name);
816
817 Curves *curves = BKE_curves_add(bmain, safe_name);
818 id_us_min(&curves->id);
819
821
822 return curves;
823}
824
825static PointCloud *rna_Main_pointclouds_new(Main *bmain, const char *name)
826{
827 char safe_name[MAX_ID_NAME - 2];
828 rna_idname_validate(name, safe_name);
829
830 PointCloud *pointcloud = BKE_pointcloud_add(bmain, safe_name);
831 id_us_min(&pointcloud->id);
832
834
835 return pointcloud;
836}
837
838static Volume *rna_Main_volumes_new(Main *bmain, const char *name)
839{
840 char safe_name[MAX_ID_NAME - 2];
841 rna_idname_validate(name, safe_name);
842
843 Volume *volume = BKE_volume_add(bmain, safe_name);
844 id_us_min(&volume->id);
845
847
848 return volume;
849}
850
851/* tag functions, all the same */
852# define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
853 static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \
854 { \
855 BKE_main_id_tag_listbase(&bmain->_listbase_name.cast<ID>(), ID_TAG_DOIT, value); \
856 }
857
858RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras, ID_CA)
859RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes, ID_SCE)
860RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects, ID_OB)
861RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials, ID_MA)
862RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees, ID_NT)
863RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes, ID_ME)
864RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights, ID_LA)
865RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries, ID_LI)
866RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens, ID_SCR)
867RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM)
868RNA_MAIN_ID_TAG_FUNCS_DEF(images, images, ID_IM)
869RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices, ID_LT)
870RNA_MAIN_ID_TAG_FUNCS_DEF(curves, curves, ID_CU_LEGACY)
871RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs, ID_MB)
872RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts, ID_VF)
873RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures, ID_TE)
874RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brushes, ID_BR)
875RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds, ID_WO)
876RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections, ID_GR)
877// RNA_MAIN_ID_TAG_FUNCS_DEF(shape_keys, key, ID_KE)
878RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts, ID_TXT)
879RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers, ID_SPK)
880RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds, ID_SO)
881RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures, ID_AR)
882RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions, ID_AC)
883RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles, ID_PA)
884RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL)
885RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils, ID_GD_LEGACY)
886RNA_MAIN_ID_TAG_FUNCS_DEF(grease_pencils, grease_pencils, ID_GP)
887RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips, ID_MC)
888RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks, ID_MSK)
889RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles, ID_LS)
890RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF)
891RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC)
892RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS)
893RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP)
894RNA_MAIN_ID_TAG_FUNCS_DEF(hair_curves, hair_curves, ID_CV)
895RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT)
896RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO)
897
898# undef RNA_MAIN_ID_TAG_FUNCS_DEF
899
900} // namespace blender
901
902#else
903
904namespace blender {
905
907{
908 FunctionRNA *func;
909 PropertyRNA *parm;
910
911# if 0
912 /* maybe we want to add functions in 'bpy.data' still?
913 * for now they are all in collections bpy.data.images.new(...) */
914 func = RNA_def_function(srna, "add_image", "rna_Main_add_image");
915 RNA_def_function_ui_description(func, "Add a new image");
917 func, "filepath", nullptr, 0, "", "File path to load image from");
919 parm = RNA_def_pointer(func, "image", "Image", "", "New image");
920 RNA_def_function_return(func, parm);
921# endif
922
923 func = RNA_def_function(srna, "pack_linked_ids_hierarchy", "rna_Main_pack_linked_ids_hierarchy");
925 func, "Pack the given linked ID and its dependencies into current blendfile");
927 parm = RNA_def_pointer(func, "root_id", "ID", "", "Root linked ID to pack");
929 parm = RNA_def_pointer(func, "packed_id", "ID", "", "The packed ID matching the given root ID");
930 RNA_def_function_return(func, parm);
931}
932
934{
935 StructRNA *srna;
936 FunctionRNA *func;
937 PropertyRNA *parm;
938
939 RNA_def_property_srna(cprop, "BlendDataCameras");
940 srna = RNA_def_struct(brna, "BlendDataCameras", nullptr);
941 RNA_def_struct_sdna(srna, "Main");
942 RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras");
943
944 func = RNA_def_function(srna, "new", "rna_Main_cameras_new");
945 RNA_def_function_ui_description(func, "Add a new camera to the main database");
946 parm = RNA_def_string(func, "name", "Camera", 0, "", "New name for the data-block");
948 /* return type */
949 parm = RNA_def_pointer(func, "camera", "Camera", "", "New camera data-block");
951 RNA_def_function_return(func, parm);
952
953 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
955 RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
956 parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
959 RNA_def_boolean(func,
960 "do_unlink",
961 true,
962 "",
963 "Unlink all usages of this camera before deleting it "
964 "(WARNING: will also delete objects instancing that camera data)");
965 RNA_def_boolean(func,
966 "do_id_user",
967 true,
968 "",
969 "Decrement user counter of all data-blocks used by this camera");
971 func, "do_ui_user", true, "", "Make sure interface does not reference this camera");
972
973 func = RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
974 parm = RNA_def_boolean(func, "value", false, "Value", "");
976}
977
979{
980 StructRNA *srna;
981 FunctionRNA *func;
982 PropertyRNA *parm;
983
984 RNA_def_property_srna(cprop, "BlendDataScenes");
985 srna = RNA_def_struct(brna, "BlendDataScenes", nullptr);
986 RNA_def_struct_sdna(srna, "Main");
987 RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");
988
989 func = RNA_def_function(srna, "new", "rna_Main_scenes_new");
990 RNA_def_function_ui_description(func, "Add a new scene to the main database");
991 parm = RNA_def_string(func, "name", "Scene", 0, "", "New name for the data-block");
993 /* return type */
994 parm = RNA_def_pointer(func, "scene", "Scene", "", "New scene data-block");
996 RNA_def_function_return(func, parm);
997
998 func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
1000 RNA_def_function_ui_description(func, "Remove a scene from the current blendfile");
1001 parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
1005 func, "do_unlink", true, "", "Unlink all usages of this scene before deleting it");
1006
1007 func = RNA_def_function(srna, "tag", "rna_Main_scenes_tag");
1008 parm = RNA_def_boolean(func, "value", false, "Value", "");
1010}
1011
1013{
1014 StructRNA *srna;
1015 FunctionRNA *func;
1016 PropertyRNA *parm;
1017
1018 RNA_def_property_srna(cprop, "BlendDataObjects");
1019 srna = RNA_def_struct(brna, "BlendDataObjects", nullptr);
1020 RNA_def_struct_sdna(srna, "Main");
1021 RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects");
1022
1023 func = RNA_def_function(srna, "new", "rna_Main_objects_new");
1025 RNA_def_function_ui_description(func, "Add a new object to the main database");
1026 parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the data-block");
1028 parm = RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object");
1030
1031 /* return type */
1032 parm = RNA_def_pointer(func, "object", "Object", "", "New object data-block");
1034 RNA_def_function_return(func, parm);
1035
1036 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1037 RNA_def_function_ui_description(func, "Remove an object from the current blendfile");
1039 parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
1043 func, "do_unlink", true, "", "Unlink all usages of this object before deleting it");
1044 RNA_def_boolean(func,
1045 "do_id_user",
1046 true,
1047 "",
1048 "Decrement user counter of all data-blocks used by this object");
1050 func, "do_ui_user", true, "", "Make sure interface does not reference this object");
1051
1052 func = RNA_def_function(srna, "tag", "rna_Main_objects_tag");
1053 parm = RNA_def_boolean(func, "value", false, "Value", "");
1055}
1056
1058{
1059 StructRNA *srna;
1060 FunctionRNA *func;
1061 PropertyRNA *parm;
1062
1063 RNA_def_property_srna(cprop, "BlendDataMaterials");
1064 srna = RNA_def_struct(brna, "BlendDataMaterials", nullptr);
1065 RNA_def_struct_sdna(srna, "Main");
1066 RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials");
1067
1068 func = RNA_def_function(srna, "new", "rna_Main_materials_new");
1069 RNA_def_function_ui_description(func, "Add a new material to the main database");
1070 parm = RNA_def_string(func, "name", "Material", 0, "", "New name for the data-block");
1072 /* return type */
1073 parm = RNA_def_pointer(func, "material", "Material", "", "New material data-block");
1075 RNA_def_function_return(func, parm);
1076
1077 func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_materials_gpencil_data");
1078 RNA_def_function_ui_description(func, "Add Grease Pencil material settings");
1079 parm = RNA_def_pointer(func, "material", "Material", "", "Material");
1081
1082 func = RNA_def_function(srna, "remove_gpencil_data", "rna_Main_materials_gpencil_remove");
1083 RNA_def_function_ui_description(func, "Remove Grease Pencil material settings");
1084 parm = RNA_def_pointer(func, "material", "Material", "", "Material");
1086
1087 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1089 RNA_def_function_ui_description(func, "Remove a material from the current blendfile");
1090 parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
1094 func, "do_unlink", true, "", "Unlink all usages of this material before deleting it");
1095 RNA_def_boolean(func,
1096 "do_id_user",
1097 true,
1098 "",
1099 "Decrement user counter of all data-blocks used by this material");
1101 func, "do_ui_user", true, "", "Make sure interface does not reference this material");
1102
1103 func = RNA_def_function(srna, "tag", "rna_Main_materials_tag");
1104 parm = RNA_def_boolean(func, "value", false, "Value", "");
1106}
1108{
1109 StructRNA *srna;
1110 FunctionRNA *func;
1111 PropertyRNA *parm;
1112
1113 RNA_def_property_srna(cprop, "BlendDataNodeTrees");
1114 srna = RNA_def_struct(brna, "BlendDataNodeTrees", nullptr);
1115 RNA_def_struct_sdna(srna, "Main");
1116 RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees");
1117
1118 func = RNA_def_function(srna, "new", "rna_Main_nodetree_new");
1119 RNA_def_function_ui_description(func, "Add a new node tree to the main database");
1120 parm = RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the data-block");
1122 parm = RNA_def_enum(
1123 func, "type", rna_enum_dummy_DEFAULT_items, 0, "Type", "The type of node_group to add");
1124 RNA_def_property_enum_funcs(parm, nullptr, nullptr, "rna_Main_nodetree_type_itemf");
1126 /* return type */
1127 parm = RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree data-block");
1128 RNA_def_function_return(func, parm);
1129
1130 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1132 RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile");
1133 parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
1137 func, "do_unlink", true, "", "Unlink all usages of this node tree before deleting it");
1138 RNA_def_boolean(func,
1139 "do_id_user",
1140 true,
1141 "",
1142 "Decrement user counter of all data-blocks used by this node tree");
1144 func, "do_ui_user", true, "", "Make sure interface does not reference this node tree");
1145
1146 func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
1147 parm = RNA_def_boolean(func, "value", false, "Value", "");
1149}
1151{
1152 StructRNA *srna;
1153 FunctionRNA *func;
1154 PropertyRNA *parm;
1155
1156 RNA_def_property_srna(cprop, "BlendDataMeshes");
1157 srna = RNA_def_struct(brna, "BlendDataMeshes", nullptr);
1158 RNA_def_struct_sdna(srna, "Main");
1159 RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes");
1160
1161 func = RNA_def_function(srna, "new", "rna_Main_meshes_new");
1162 RNA_def_function_ui_description(func, "Add a new mesh to the main database");
1163 parm = RNA_def_string(func, "name", "Mesh", 0, "", "New name for the data-block");
1165 /* return type */
1166 parm = RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh data-block");
1168 RNA_def_function_return(func, parm);
1169
1170 func = RNA_def_function(srna, "new_from_object", "rna_Main_meshes_new_from_object");
1172 func,
1173 "Add a new mesh created from given object (undeformed geometry if object is original, and "
1174 "final evaluated geometry, with all modifiers etc., if object is evaluated)");
1176 parm = RNA_def_pointer(func, "object", "Object", "", "Object to create mesh from");
1178 RNA_def_boolean(func,
1179 "preserve_all_data_layers",
1180 false,
1181 "",
1182 "Preserve all data layers in the mesh, like UV maps and vertex groups. "
1183 "By default Blender only computes the subset of data layers needed for viewport "
1184 "display and rendering, for better performance.");
1186 func,
1187 "depsgraph",
1188 "Depsgraph",
1189 "Dependency Graph",
1190 "Evaluated dependency graph which is required when preserve_all_data_layers is true");
1191 parm = RNA_def_pointer(func,
1192 "mesh",
1193 "Mesh",
1194 "",
1195 "Mesh created from object, remove it if it is only used for export");
1197 RNA_def_function_return(func, parm);
1198
1199 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1201 RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
1202 parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
1205 RNA_def_boolean(func,
1206 "do_unlink",
1207 true,
1208 "",
1209 "Unlink all usages of this mesh before deleting it "
1210 "(WARNING: will also delete objects instancing that mesh data)");
1211 RNA_def_boolean(func,
1212 "do_id_user",
1213 true,
1214 "",
1215 "Decrement user counter of all data-blocks used by this mesh data");
1217 func, "do_ui_user", true, "", "Make sure interface does not reference this mesh data");
1218
1219 func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
1220 parm = RNA_def_boolean(func, "value", false, "Value", "");
1222}
1223
1225{
1226 StructRNA *srna;
1227 FunctionRNA *func;
1228 PropertyRNA *parm;
1229
1230 RNA_def_property_srna(cprop, "BlendDataLights");
1231 srna = RNA_def_struct(brna, "BlendDataLights", nullptr);
1232 RNA_def_struct_sdna(srna, "Main");
1233 RNA_def_struct_ui_text(srna, "Main Lights", "Collection of lights");
1234
1235 func = RNA_def_function(srna, "new", "rna_Main_lights_new");
1236 RNA_def_function_ui_description(func, "Add a new light to the main database");
1237 parm = RNA_def_string(func, "name", "Light", 0, "", "New name for the data-block");
1239 parm = RNA_def_enum(
1240 func, "type", rna_enum_light_type_items, 0, "Type", "The type of light to add");
1242 /* return type */
1243 parm = RNA_def_pointer(func, "light", "Light", "", "New light data-block");
1245 RNA_def_function_return(func, parm);
1246
1247 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1249 RNA_def_function_ui_description(func, "Remove a light from the current blendfile");
1250 parm = RNA_def_pointer(func, "light", "Light", "", "Light to remove");
1253 RNA_def_boolean(func,
1254 "do_unlink",
1255 true,
1256 "",
1257 "Unlink all usages of this light before deleting it "
1258 "(WARNING: will also delete objects instancing that light data)");
1259 RNA_def_boolean(func,
1260 "do_id_user",
1261 true,
1262 "",
1263 "Decrement user counter of all data-blocks used by this light data");
1265 func, "do_ui_user", true, "", "Make sure interface does not reference this light data");
1266
1267 func = RNA_def_function(srna, "tag", "rna_Main_lights_tag");
1268 parm = RNA_def_boolean(func, "value", false, "Value", "");
1270}
1271
1273{
1274 StructRNA *srna;
1275 FunctionRNA *func;
1276 PropertyRNA *parm;
1277
1278 RNA_def_property_srna(cprop, "BlendDataLibraries");
1279 srna = RNA_def_struct(brna, "BlendDataLibraries", nullptr);
1280 RNA_def_struct_sdna(srna, "Main");
1281 RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
1282
1283 func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
1284 parm = RNA_def_boolean(func, "value", false, "Value", "");
1286
1287 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1289 RNA_def_function_ui_description(func, "Remove a library from the current blendfile");
1290 parm = RNA_def_pointer(func, "library", "Library", "", "Library to remove");
1294 func, "do_unlink", true, "", "Unlink all usages of this library before deleting it");
1295 RNA_def_boolean(func,
1296 "do_id_user",
1297 true,
1298 "",
1299 "Decrement user counter of all data-blocks used by this library");
1301 func, "do_ui_user", true, "", "Make sure interface does not reference this library");
1302}
1303
1305{
1306 StructRNA *srna;
1307 FunctionRNA *func;
1308 PropertyRNA *parm;
1309
1310 RNA_def_property_srna(cprop, "BlendDataScreens");
1311 srna = RNA_def_struct(brna, "BlendDataScreens", nullptr);
1312 RNA_def_struct_sdna(srna, "Main");
1313 RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
1314
1315 func = RNA_def_function(srna, "tag", "rna_Main_screens_tag");
1316 parm = RNA_def_boolean(func, "value", false, "Value", "");
1318}
1319
1321{
1322 StructRNA *srna;
1323 FunctionRNA *func;
1324 PropertyRNA *parm;
1325
1326 RNA_def_property_srna(cprop, "BlendDataWindowManagers");
1327 srna = RNA_def_struct(brna, "BlendDataWindowManagers", nullptr);
1328 RNA_def_struct_sdna(srna, "Main");
1329 RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
1330
1331 func = RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
1332 parm = RNA_def_boolean(func, "value", false, "Value", "");
1334}
1336{
1337 StructRNA *srna;
1338 FunctionRNA *func;
1339 PropertyRNA *parm;
1340
1341 RNA_def_property_srna(cprop, "BlendDataImages");
1342 srna = RNA_def_struct(brna, "BlendDataImages", nullptr);
1343 RNA_def_struct_sdna(srna, "Main");
1344 RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
1345
1346 func = RNA_def_function(srna, "new", "rna_Main_images_new");
1347 RNA_def_function_ui_description(func, "Add a new image to the main database");
1348 parm = RNA_def_string(func, "name", "Image", 0, "", "New name for the data-block");
1350 parm = RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 1, INT_MAX);
1352 parm = RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 1, INT_MAX);
1354 RNA_def_boolean(func, "alpha", false, "Alpha", "Use alpha channel");
1356 func, "float_buffer", false, "Float Buffer", "Create an image with floating-point color");
1357 RNA_def_boolean(func, "stereo3d", false, "Stereo 3D", "Create left and right views");
1359 func, "is_data", false, "Is Data", "Create image with non-color data color space");
1360 RNA_def_boolean(func, "tiled", false, "Tiled", "Create a tiled image");
1361 /* return type */
1362 parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1364 RNA_def_function_return(func, parm);
1365
1366 func = RNA_def_function(srna, "load", "rna_Main_images_load");
1368 RNA_def_function_ui_description(func, "Load a new image into the main database");
1370 func, "filepath", "File Path", 0, "", "Path of the file to load");
1372 RNA_def_boolean(func,
1373 "check_existing",
1374 false,
1375 "",
1376 "Using existing data-block if this file is already loaded");
1377 /* return type */
1378 parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1380 RNA_def_function_return(func, parm);
1381
1382 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1384 RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
1385 parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove");
1389 func, "do_unlink", true, "", "Unlink all usages of this image before deleting it");
1390 RNA_def_boolean(func,
1391 "do_id_user",
1392 true,
1393 "",
1394 "Decrement user counter of all data-blocks used by this image");
1396 func, "do_ui_user", true, "", "Make sure interface does not reference this image");
1397
1398 func = RNA_def_function(srna, "tag", "rna_Main_images_tag");
1399 parm = RNA_def_boolean(func, "value", false, "Value", "");
1401}
1402
1404{
1405 StructRNA *srna;
1406 FunctionRNA *func;
1407 PropertyRNA *parm;
1408
1409 RNA_def_property_srna(cprop, "BlendDataLattices");
1410 srna = RNA_def_struct(brna, "BlendDataLattices", nullptr);
1411 RNA_def_struct_sdna(srna, "Main");
1412 RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
1413
1414 func = RNA_def_function(srna, "new", "rna_Main_lattices_new");
1415 RNA_def_function_ui_description(func, "Add a new lattice to the main database");
1416 parm = RNA_def_string(func, "name", "Lattice", 0, "", "New name for the data-block");
1418 /* return type */
1419 parm = RNA_def_pointer(func, "lattice", "Lattice", "", "New lattice data-block");
1421 RNA_def_function_return(func, parm);
1422
1423 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1425 RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
1426 parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
1429 RNA_def_boolean(func,
1430 "do_unlink",
1431 true,
1432 "",
1433 "Unlink all usages of this lattice before deleting it "
1434 "(WARNING: will also delete objects instancing that lattice data)");
1435 RNA_def_boolean(func,
1436 "do_id_user",
1437 true,
1438 "",
1439 "Decrement user counter of all data-blocks used by this lattice data");
1441 func, "do_ui_user", true, "", "Make sure interface does not reference this lattice data");
1442
1443 func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
1444 parm = RNA_def_boolean(func, "value", false, "Value", "");
1446}
1448{
1449 StructRNA *srna;
1450 FunctionRNA *func;
1451 PropertyRNA *parm;
1452
1453 RNA_def_property_srna(cprop, "BlendDataCurves");
1454 srna = RNA_def_struct(brna, "BlendDataCurves", nullptr);
1455 RNA_def_struct_sdna(srna, "Main");
1456 RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
1457
1458 func = RNA_def_function(srna, "new", "rna_Main_curves_new");
1459 RNA_def_function_ui_description(func, "Add a new curve to the main database");
1460 parm = RNA_def_string(func, "name", "Curve", 0, "", "New name for the data-block");
1462 parm = RNA_def_enum(
1463 func, "type", rna_enum_object_type_curve_items, 0, "Type", "The type of curve to add");
1465 /* return type */
1466 parm = RNA_def_pointer(func, "curve", "Curve", "", "New curve data-block");
1468 RNA_def_function_return(func, parm);
1469
1470 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1472 RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
1473 parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
1476 RNA_def_boolean(func,
1477 "do_unlink",
1478 true,
1479 "",
1480 "Unlink all usages of this curve before deleting it "
1481 "(WARNING: will also delete objects instancing that curve data)");
1482 RNA_def_boolean(func,
1483 "do_id_user",
1484 true,
1485 "",
1486 "Decrement user counter of all data-blocks used by this curve data");
1488 func, "do_ui_user", true, "", "Make sure interface does not reference this curve data");
1489
1490 func = RNA_def_function(srna, "tag", "rna_Main_curves_tag");
1491 parm = RNA_def_boolean(func, "value", false, "Value", "");
1493}
1495{
1496 StructRNA *srna;
1497 FunctionRNA *func;
1498 PropertyRNA *parm;
1499
1500 RNA_def_property_srna(cprop, "BlendDataMetaBalls");
1501 srna = RNA_def_struct(brna, "BlendDataMetaBalls", nullptr);
1502 RNA_def_struct_sdna(srna, "Main");
1503 RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs");
1504
1505 func = RNA_def_function(srna, "new", "rna_Main_metaballs_new");
1506 RNA_def_function_ui_description(func, "Add a new metaball to the main database");
1507 parm = RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the data-block");
1509 /* return type */
1510 parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball data-block");
1512 RNA_def_function_return(func, parm);
1513
1514 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1516 RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile");
1517 parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove");
1520 RNA_def_boolean(func,
1521 "do_unlink",
1522 true,
1523 "",
1524 "Unlink all usages of this metaball before deleting it "
1525 "(WARNING: will also delete objects instancing that metaball data)");
1526 RNA_def_boolean(func,
1527 "do_id_user",
1528 true,
1529 "",
1530 "Decrement user counter of all data-blocks used by this metaball data");
1532 func, "do_ui_user", true, "", "Make sure interface does not reference this metaball data");
1533
1534 func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
1535 parm = RNA_def_boolean(func, "value", false, "Value", "");
1537}
1539{
1540 StructRNA *srna;
1541 FunctionRNA *func;
1542 PropertyRNA *parm;
1543
1544 RNA_def_property_srna(cprop, "BlendDataFonts");
1545 srna = RNA_def_struct(brna, "BlendDataFonts", nullptr);
1546 RNA_def_struct_sdna(srna, "Main");
1547 RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
1548
1549 func = RNA_def_function(srna, "load", "rna_Main_fonts_load");
1551 RNA_def_function_ui_description(func, "Load a new font into the main database");
1553 func, "filepath", "File Path", 0, "", "path of the font to load");
1555 RNA_def_boolean(func,
1556 "check_existing",
1557 false,
1558 "",
1559 "Using existing data-block if this file is already loaded");
1560 /* return type */
1561 parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "New font data-block");
1563 RNA_def_function_return(func, parm);
1564
1565 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1567 RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
1568 parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
1572 func, "do_unlink", true, "", "Unlink all usages of this font before deleting it");
1574 func, "do_id_user", true, "", "Decrement user counter of all data-blocks used by this font");
1576 func, "do_ui_user", true, "", "Make sure interface does not reference this font");
1577
1578 func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
1579 parm = RNA_def_boolean(func, "value", false, "Value", "");
1581}
1583{
1584 StructRNA *srna;
1585 FunctionRNA *func;
1586 PropertyRNA *parm;
1587
1588 RNA_def_property_srna(cprop, "BlendDataTextures");
1589 srna = RNA_def_struct(brna, "BlendDataTextures", nullptr);
1590 RNA_def_struct_sdna(srna, "Main");
1591 RNA_def_struct_ui_text(srna, "Main Textures", "Collection of textures");
1592
1593 func = RNA_def_function(srna, "new", "rna_Main_textures_new");
1594 RNA_def_function_ui_description(func, "Add a new texture to the main database");
1595 parm = RNA_def_string(func, "name", "Texture", 0, "", "New name for the data-block");
1597 parm = RNA_def_enum(
1598 func, "type", rna_enum_texture_type_items, 0, "Type", "The type of texture to add");
1600 /* return type */
1601 parm = RNA_def_pointer(func, "texture", "Texture", "", "New texture data-block");
1603 RNA_def_function_return(func, parm);
1604
1605 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1607 RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
1608 parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
1612 func, "do_unlink", true, "", "Unlink all usages of this texture before deleting it");
1613 RNA_def_boolean(func,
1614 "do_id_user",
1615 true,
1616 "",
1617 "Decrement user counter of all data-blocks used by this texture");
1619 func, "do_ui_user", true, "", "Make sure interface does not reference this texture");
1620
1621 func = RNA_def_function(srna, "tag", "rna_Main_textures_tag");
1622 parm = RNA_def_boolean(func, "value", false, "Value", "");
1624}
1626{
1627 StructRNA *srna;
1628 FunctionRNA *func;
1629 PropertyRNA *parm;
1630
1631 RNA_def_property_srna(cprop, "BlendDataBrushes");
1632 srna = RNA_def_struct(brna, "BlendDataBrushes", nullptr);
1633 RNA_def_struct_sdna(srna, "Main");
1634 RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
1635
1636 func = RNA_def_function(srna, "new", "rna_Main_brushes_new");
1637 RNA_def_function_ui_description(func, "Add a new brush to the main database");
1638 parm = RNA_def_string(func, "name", "Brush", 0, "", "New name for the data-block");
1640 parm = RNA_def_enum(func,
1641 "mode",
1644 "",
1645 "Paint Mode for the new brush");
1646 /* return type */
1647 parm = RNA_def_pointer(func, "brush", "Brush", "", "New brush data-block");
1649 RNA_def_function_return(func, parm);
1650
1651 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1653 RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
1654 parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
1658 func, "do_unlink", true, "", "Unlink all usages of this brush before deleting it");
1659 RNA_def_boolean(func,
1660 "do_id_user",
1661 true,
1662 "",
1663 "Decrement user counter of all data-blocks used by this brush");
1665 func, "do_ui_user", true, "", "Make sure interface does not reference this brush");
1666
1667 func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
1668 parm = RNA_def_boolean(func, "value", false, "Value", "");
1670
1671 func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_brush_gpencil_data");
1672 RNA_def_function_ui_description(func, "Add Grease Pencil brush settings");
1673 parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush");
1675}
1676
1678{
1679 StructRNA *srna;
1680 FunctionRNA *func;
1681 PropertyRNA *parm;
1682
1683 RNA_def_property_srna(cprop, "BlendDataWorlds");
1684 srna = RNA_def_struct(brna, "BlendDataWorlds", nullptr);
1685 RNA_def_struct_sdna(srna, "Main");
1686 RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds");
1687
1688 func = RNA_def_function(srna, "new", "rna_Main_worlds_new");
1689 RNA_def_function_ui_description(func, "Add a new world to the main database");
1690 parm = RNA_def_string(func, "name", "World", 0, "", "New name for the data-block");
1692 /* return type */
1693 parm = RNA_def_pointer(func, "world", "World", "", "New world data-block");
1695 RNA_def_function_return(func, parm);
1696
1697 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1699 RNA_def_function_ui_description(func, "Remove a world from the current blendfile");
1700 parm = RNA_def_pointer(func, "world", "World", "", "World to remove");
1704 func, "do_unlink", true, "", "Unlink all usages of this world before deleting it");
1705 RNA_def_boolean(func,
1706 "do_id_user",
1707 true,
1708 "",
1709 "Decrement user counter of all data-blocks used by this world");
1711 func, "do_ui_user", true, "", "Make sure interface does not reference this world");
1712
1713 func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
1714 parm = RNA_def_boolean(func, "value", false, "Value", "");
1716}
1717
1719{
1720 StructRNA *srna;
1721 FunctionRNA *func;
1722 PropertyRNA *parm;
1723
1724 RNA_def_property_srna(cprop, "BlendDataCollections");
1725 srna = RNA_def_struct(brna, "BlendDataCollections", nullptr);
1726 RNA_def_struct_sdna(srna, "Main");
1727 RNA_def_struct_ui_text(srna, "Main Collections", "Collection of collections");
1728
1729 func = RNA_def_function(srna, "new", "rna_Main_collections_new");
1730 RNA_def_function_ui_description(func, "Add a new collection to the main database");
1731 parm = RNA_def_string(func, "name", "Collection", 0, "", "New name for the data-block");
1733 /* return type */
1734 parm = RNA_def_pointer(func, "collection", "Collection", "", "New collection data-block");
1736 RNA_def_function_return(func, parm);
1737
1738 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1739 RNA_def_function_ui_description(func, "Remove a collection from the current blendfile");
1741 parm = RNA_def_pointer(func, "collection", "Collection", "", "Collection to remove");
1745 func, "do_unlink", true, "", "Unlink all usages of this collection before deleting it");
1746 RNA_def_boolean(func,
1747 "do_id_user",
1748 true,
1749 "",
1750 "Decrement user counter of all data-blocks used by this collection");
1752 func, "do_ui_user", true, "", "Make sure interface does not reference this collection");
1753
1754 func = RNA_def_function(srna, "tag", "rna_Main_collections_tag");
1755 parm = RNA_def_boolean(func, "value", false, "Value", "");
1757}
1758
1760{
1761 StructRNA *srna;
1762 FunctionRNA *func;
1763 PropertyRNA *parm;
1764
1765 RNA_def_property_srna(cprop, "BlendDataSpeakers");
1766 srna = RNA_def_struct(brna, "BlendDataSpeakers", nullptr);
1767 RNA_def_struct_sdna(srna, "Main");
1768 RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers");
1769
1770 func = RNA_def_function(srna, "new", "rna_Main_speakers_new");
1771 RNA_def_function_ui_description(func, "Add a new speaker to the main database");
1772 parm = RNA_def_string(func, "name", "Speaker", 0, "", "New name for the data-block");
1774 /* return type */
1775 parm = RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker data-block");
1777 RNA_def_function_return(func, parm);
1778
1779 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1781 RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
1782 parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
1785 RNA_def_boolean(func,
1786 "do_unlink",
1787 true,
1788 "",
1789 "Unlink all usages of this speaker before deleting it "
1790 "(WARNING: will also delete objects instancing that speaker data)");
1791 RNA_def_boolean(func,
1792 "do_id_user",
1793 true,
1794 "",
1795 "Decrement user counter of all data-blocks used by this speaker data");
1797 func, "do_ui_user", true, "", "Make sure interface does not reference this speaker data");
1798
1799 func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
1800 parm = RNA_def_boolean(func, "value", false, "Value", "");
1802}
1803
1805{
1806 StructRNA *srna;
1807 FunctionRNA *func;
1808 PropertyRNA *parm;
1809
1810 RNA_def_property_srna(cprop, "BlendDataTexts");
1811 srna = RNA_def_struct(brna, "BlendDataTexts", nullptr);
1812 RNA_def_struct_sdna(srna, "Main");
1813 RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
1814
1815 func = RNA_def_function(srna, "new", "rna_Main_texts_new");
1816 RNA_def_function_ui_description(func, "Add a new text to the main database");
1817 parm = RNA_def_string(func, "name", "Text", 0, "", "New name for the data-block");
1819 /* return type */
1820 parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1822 RNA_def_function_return(func, parm);
1823
1824 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1825 RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
1827 parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove");
1831 func, "do_unlink", true, "", "Unlink all usages of this text before deleting it");
1833 func, "do_id_user", true, "", "Decrement user counter of all data-blocks used by this text");
1835 func, "do_ui_user", true, "", "Make sure interface does not reference this text");
1836
1837 /* load func */
1838 func = RNA_def_function(srna, "load", "rna_Main_texts_load");
1840 RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
1842 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1844 parm = RNA_def_boolean(
1845 func, "internal", false, "Make internal", "Make text file internal after loading");
1846 /* return type */
1847 parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1849 RNA_def_function_return(func, parm);
1850
1851 func = RNA_def_function(srna, "tag", "rna_Main_texts_tag");
1852 parm = RNA_def_boolean(func, "value", false, "Value", "");
1854}
1855
1857{
1858 StructRNA *srna;
1859 FunctionRNA *func;
1860 PropertyRNA *parm;
1861
1862 RNA_def_property_srna(cprop, "BlendDataSounds");
1863 srna = RNA_def_struct(brna, "BlendDataSounds", nullptr);
1864 RNA_def_struct_sdna(srna, "Main");
1865 RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
1866
1867 /* load func */
1868 func = RNA_def_function(srna, "load", "rna_Main_sounds_load");
1869 RNA_def_function_ui_description(func, "Add a new sound to the main database from a file");
1871 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1873 RNA_def_boolean(func,
1874 "check_existing",
1875 false,
1876 "",
1877 "Using existing data-block if this file is already loaded");
1878 /* return type */
1879 parm = RNA_def_pointer(func, "sound", "Sound", "", "New text data-block");
1881 RNA_def_function_return(func, parm);
1882
1883 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1885 RNA_def_function_ui_description(func, "Remove a sound from the current blendfile");
1886 parm = RNA_def_pointer(func, "sound", "Sound", "", "Sound to remove");
1890 func, "do_unlink", true, "", "Unlink all usages of this sound before deleting it");
1891 RNA_def_boolean(func,
1892 "do_id_user",
1893 true,
1894 "",
1895 "Decrement user counter of all data-blocks used by this sound");
1897 func, "do_ui_user", true, "", "Make sure interface does not reference this sound");
1898
1899 func = RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
1900 parm = RNA_def_boolean(func, "value", false, "Value", "");
1902}
1903
1905{
1906 StructRNA *srna;
1907 FunctionRNA *func;
1908 PropertyRNA *parm;
1909
1910 RNA_def_property_srna(cprop, "BlendDataArmatures");
1911 srna = RNA_def_struct(brna, "BlendDataArmatures", nullptr);
1912 RNA_def_struct_sdna(srna, "Main");
1913 RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
1914
1915 func = RNA_def_function(srna, "new", "rna_Main_armatures_new");
1916 RNA_def_function_ui_description(func, "Add a new armature to the main database");
1917 parm = RNA_def_string(func, "name", "Armature", 0, "", "New name for the data-block");
1919 /* return type */
1920 parm = RNA_def_pointer(func, "armature", "Armature", "", "New armature data-block");
1922 RNA_def_function_return(func, parm);
1923
1924 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1926 RNA_def_function_ui_description(func, "Remove an armature from the current blendfile");
1927 parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
1930 RNA_def_boolean(func,
1931 "do_unlink",
1932 true,
1933 "",
1934 "Unlink all usages of this armature before deleting it "
1935 "(WARNING: will also delete objects instancing that armature data)");
1936 RNA_def_boolean(func,
1937 "do_id_user",
1938 true,
1939 "",
1940 "Decrement user counter of all data-blocks used by this armature data");
1942 func, "do_ui_user", true, "", "Make sure interface does not reference this armature data");
1943
1944 func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
1945 parm = RNA_def_boolean(func, "value", false, "Value", "");
1947}
1949{
1950 StructRNA *srna;
1951 FunctionRNA *func;
1952 PropertyRNA *parm;
1953
1954 RNA_def_property_srna(cprop, "BlendDataActions");
1955 srna = RNA_def_struct(brna, "BlendDataActions", nullptr);
1956 RNA_def_struct_sdna(srna, "Main");
1957 RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
1958
1959 func = RNA_def_function(srna, "new", "rna_Main_actions_new");
1960 RNA_def_function_ui_description(func, "Add a new action to the main database");
1961 parm = RNA_def_string(func, "name", "Action", 0, "", "New name for the data-block");
1963 /* return type */
1964 parm = RNA_def_pointer(func, "action", "Action", "", "New action data-block");
1966 RNA_def_function_return(func, parm);
1967
1968 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1970 RNA_def_function_ui_description(func, "Remove an action from the current blendfile");
1971 parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove");
1975 func, "do_unlink", true, "", "Unlink all usages of this action before deleting it");
1976 RNA_def_boolean(func,
1977 "do_id_user",
1978 true,
1979 "",
1980 "Decrement user counter of all data-blocks used by this action");
1982 func, "do_ui_user", true, "", "Make sure interface does not reference this action");
1983
1984 func = RNA_def_function(srna, "tag", "rna_Main_actions_tag");
1985 parm = RNA_def_boolean(func, "value", false, "Value", "");
1987}
1988
1990{
1991 StructRNA *srna;
1992 FunctionRNA *func;
1993 PropertyRNA *parm;
1994
1995 RNA_def_property_srna(cprop, "BlendDataParticles");
1996 srna = RNA_def_struct(brna, "BlendDataParticles", nullptr);
1997 RNA_def_struct_sdna(srna, "Main");
1998 RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
1999
2000 func = RNA_def_function(srna, "new", "rna_Main_particles_new");
2002 "Add a new particle settings instance to the main database");
2003 parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the data-block");
2005 /* return type */
2006 parm = RNA_def_pointer(
2007 func, "particle", "ParticleSettings", "", "New particle settings data-block");
2009 RNA_def_function_return(func, parm);
2010
2011 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2014 func, "Remove a particle settings instance from the current blendfile");
2015 parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
2018 RNA_def_boolean(func,
2019 "do_unlink",
2020 true,
2021 "",
2022 "Unlink all usages of those particle settings before deleting them");
2023 RNA_def_boolean(func,
2024 "do_id_user",
2025 true,
2026 "",
2027 "Decrement user counter of all data-blocks used by this particle settings");
2028 RNA_def_boolean(func,
2029 "do_ui_user",
2030 true,
2031 "",
2032 "Make sure interface does not reference this particle settings");
2033
2034 func = RNA_def_function(srna, "tag", "rna_Main_particles_tag");
2035 parm = RNA_def_boolean(func, "value", false, "Value", "");
2037}
2038
2040{
2041 StructRNA *srna;
2042 FunctionRNA *func;
2043 PropertyRNA *parm;
2044
2045 RNA_def_property_srna(cprop, "BlendDataPalettes");
2046 srna = RNA_def_struct(brna, "BlendDataPalettes", nullptr);
2047 RNA_def_struct_sdna(srna, "Main");
2048 RNA_def_struct_ui_text(srna, "Main Palettes", "Collection of palettes");
2049
2050 func = RNA_def_function(srna, "new", "rna_Main_palettes_new");
2051 RNA_def_function_ui_description(func, "Add a new palette to the main database");
2052 parm = RNA_def_string(func, "name", "Palette", 0, "", "New name for the data-block");
2054 /* return type */
2055 parm = RNA_def_pointer(func, "palette", "Palette", "", "New palette data-block");
2057 RNA_def_function_return(func, parm);
2058
2059 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2061 RNA_def_function_ui_description(func, "Remove a palette from the current blendfile");
2062 parm = RNA_def_pointer(func, "palette", "Palette", "", "Palette to remove");
2066 func, "do_unlink", true, "", "Unlink all usages of this palette before deleting it");
2067 RNA_def_boolean(func,
2068 "do_id_user",
2069 true,
2070 "",
2071 "Decrement user counter of all data-blocks used by this palette");
2073 func, "do_ui_user", true, "", "Make sure interface does not reference this palette");
2074
2075 func = RNA_def_function(srna, "tag", "rna_Main_palettes_tag");
2076 parm = RNA_def_boolean(func, "value", false, "Value", "");
2078}
2080{
2081 StructRNA *srna;
2082 FunctionRNA *func;
2083 PropertyRNA *parm;
2084
2085 RNA_def_property_srna(cprop, "BlendDataCacheFiles");
2086 srna = RNA_def_struct(brna, "BlendDataCacheFiles", nullptr);
2087 RNA_def_struct_sdna(srna, "Main");
2088 RNA_def_struct_ui_text(srna, "Main Cache Files", "Collection of cache files");
2089
2090 func = RNA_def_function(srna, "tag", "rna_Main_cachefiles_tag");
2091 parm = RNA_def_boolean(func, "value", false, "Value", "");
2093}
2095{
2096 StructRNA *srna;
2097 FunctionRNA *func;
2098 PropertyRNA *parm;
2099
2100 RNA_def_property_srna(cprop, "BlendDataPaintCurves");
2101 srna = RNA_def_struct(brna, "BlendDataPaintCurves", nullptr);
2102 RNA_def_struct_sdna(srna, "Main");
2103 RNA_def_struct_ui_text(srna, "Main Paint Curves", "Collection of paint curves");
2104
2105 func = RNA_def_function(srna, "tag", "rna_Main_paintcurves_tag");
2106 parm = RNA_def_boolean(func, "value", false, "Value", "");
2108}
2110{
2111 StructRNA *srna;
2112 FunctionRNA *func;
2113 PropertyRNA *parm;
2114
2115 RNA_def_property_srna(cprop, "BlendDataAnnotations");
2116 srna = RNA_def_struct(brna, "BlendDataAnnotations", nullptr);
2117 RNA_def_struct_sdna(srna, "Main");
2118 RNA_def_struct_ui_text(srna, "Main Annotations", "Collection of annotations");
2119
2120 func = RNA_def_function(srna, "tag", "rna_Main_gpencils_tag");
2121 parm = RNA_def_boolean(func, "value", false, "Value", "");
2123
2124 func = RNA_def_function(srna, "new", "rna_Main_annotations_new");
2125 RNA_def_function_ui_description(func, "Add a new annotation data-block to the main database");
2126 parm = RNA_def_string(func, "name", "Annotation", 0, "", "New name for the data-block");
2128 /* return type */
2129 parm = RNA_def_pointer(func, "annotation", "Annotation", "", "New annotation data-block");
2131 RNA_def_function_return(func, parm);
2132
2133 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2135 RNA_def_function_ui_description(func, "Remove annotation instance from the current blendfile");
2136 parm = RNA_def_pointer(func, "annotation", "Annotation", "", "Grease Pencil to remove");
2140 func, "do_unlink", true, "", "Unlink all usages of this annotation before deleting it");
2141 RNA_def_boolean(func,
2142 "do_id_user",
2143 true,
2144 "",
2145 "Decrement user counter of all data-blocks used by this annotation");
2147 func, "do_ui_user", true, "", "Make sure interface does not reference this annotation");
2148}
2149
2151{
2152 StructRNA *srna;
2153 FunctionRNA *func;
2154 PropertyRNA *parm;
2155
2156 RNA_def_property_srna(cprop, "BlendDataGreasePencilsV3");
2157 srna = RNA_def_struct(brna, "BlendDataGreasePencilsV3", nullptr);
2158 RNA_def_struct_sdna(srna, "Main");
2159 RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of Grease Pencils");
2160
2161 func = RNA_def_function(srna, "tag", "rna_Main_grease_pencils_tag");
2162 parm = RNA_def_boolean(func, "value", false, "Value", "");
2164
2165 func = RNA_def_function(srna, "new", "rna_Main_grease_pencils_new");
2166 RNA_def_function_ui_description(func, "Add a new Grease Pencil data-block to the main database");
2167 parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the data-block");
2169 /* return type */
2170 parm = RNA_def_pointer(
2171 func, "grease_pencil", "GreasePencil", "", "New Grease Pencil data-block");
2173 RNA_def_function_return(func, parm);
2174
2175 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2178 "Remove a Grease Pencil instance from the current blendfile");
2179 parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "Grease Pencil to remove");
2183 func, "do_unlink", true, "", "Unlink all usages of this Grease Pencil before deleting it");
2184 RNA_def_boolean(func,
2185 "do_id_user",
2186 true,
2187 "",
2188 "Decrement user counter of all data-blocks used by this Grease Pencil");
2190 func, "do_ui_user", true, "", "Make sure interface does not reference this Grease Pencil");
2191}
2192
2194{
2195 StructRNA *srna;
2196 FunctionRNA *func;
2197 PropertyRNA *parm;
2198
2199 RNA_def_property_srna(cprop, "BlendDataMovieClips");
2200 srna = RNA_def_struct(brna, "BlendDataMovieClips", nullptr);
2201 RNA_def_struct_sdna(srna, "Main");
2202 RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips");
2203
2204 func = RNA_def_function(srna, "tag", "rna_Main_movieclips_tag");
2205 parm = RNA_def_boolean(func, "value", false, "Value", "");
2207
2208 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2210 RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile.");
2211 parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
2215 func, "do_unlink", true, "", "Unlink all usages of this movie clip before deleting it");
2216 RNA_def_boolean(func,
2217 "do_id_user",
2218 true,
2219 "",
2220 "Decrement user counter of all data-blocks used by this movie clip");
2222 func, "do_ui_user", true, "", "Make sure interface does not reference this movie clip");
2223
2224 /* load func */
2225 func = RNA_def_function(srna, "load", "rna_Main_movieclip_load");
2228 func,
2229 "Add a new movie clip to the main database from a file "
2230 "(while ``check_existing`` is disabled for consistency with other load functions, "
2231 "behavior with multiple movie-clips using the same file may incorrectly generate proxies)");
2233 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
2235 RNA_def_boolean(func,
2236 "check_existing",
2237 false,
2238 "",
2239 "Using existing data-block if this file is already loaded");
2240 /* return type */
2241 parm = RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip data-block");
2243 RNA_def_function_return(func, parm);
2244}
2245
2247{
2248 StructRNA *srna;
2249 FunctionRNA *func;
2250 PropertyRNA *parm;
2251
2252 RNA_def_property_srna(cprop, "BlendDataMasks");
2253 srna = RNA_def_struct(brna, "BlendDataMasks", nullptr);
2254 RNA_def_struct_sdna(srna, "Main");
2255 RNA_def_struct_ui_text(srna, "Main Masks", "Collection of masks");
2256
2257 func = RNA_def_function(srna, "tag", "rna_Main_masks_tag");
2258 parm = RNA_def_boolean(func, "value", false, "Value", "");
2260
2261 /* new func */
2262 func = RNA_def_function(srna, "new", "rna_Main_mask_new");
2263 RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database");
2264 parm = RNA_def_string(
2265 func, "name", nullptr, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
2267 /* return type */
2268 parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask data-block");
2270 RNA_def_function_return(func, parm);
2271
2272 /* remove func */
2273 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2275 RNA_def_function_ui_description(func, "Remove a mask from the current blendfile");
2276 parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to remove");
2280 func, "do_unlink", true, "", "Unlink all usages of this mask before deleting it");
2282 func, "do_id_user", true, "", "Decrement user counter of all data-blocks used by this mask");
2284 func, "do_ui_user", true, "", "Make sure interface does not reference this mask");
2285}
2286
2288{
2289 StructRNA *srna;
2290 FunctionRNA *func;
2291 PropertyRNA *parm;
2292
2293 RNA_def_property_srna(cprop, "BlendDataLineStyles");
2294 srna = RNA_def_struct(brna, "BlendDataLineStyles", nullptr);
2295 RNA_def_struct_sdna(srna, "Main");
2296 RNA_def_struct_ui_text(srna, "Main Line Styles", "Collection of line styles");
2297
2298 func = RNA_def_function(srna, "tag", "rna_Main_linestyle_tag");
2299 parm = RNA_def_boolean(func, "value", false, "Value", "");
2301
2302 func = RNA_def_function(srna, "new", "rna_Main_linestyles_new");
2303 RNA_def_function_ui_description(func, "Add a new line style instance to the main database");
2304 parm = RNA_def_string(func, "name", "FreestyleLineStyle", 0, "", "New name for the data-block");
2306 /* return type */
2307 parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "New line style data-block");
2309 RNA_def_function_return(func, parm);
2310
2311 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2313 RNA_def_function_ui_description(func, "Remove a line style instance from the current blendfile");
2314 parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "Line style to remove");
2318 func, "do_unlink", true, "", "Unlink all usages of this line style before deleting it");
2319 RNA_def_boolean(func,
2320 "do_id_user",
2321 true,
2322 "",
2323 "Decrement user counter of all data-blocks used by this line style");
2325 func, "do_ui_user", true, "", "Make sure interface does not reference this line style");
2326}
2327
2329{
2330 StructRNA *srna;
2331 FunctionRNA *func;
2332 PropertyRNA *parm;
2333
2334 RNA_def_property_srna(cprop, "BlendDataWorkSpaces");
2335 srna = RNA_def_struct(brna, "BlendDataWorkSpaces", nullptr);
2336 RNA_def_struct_sdna(srna, "Main");
2337 RNA_def_struct_ui_text(srna, "Main Workspaces", "Collection of workspaces");
2338
2339 func = RNA_def_function(srna, "tag", "rna_Main_workspaces_tag");
2340 parm = RNA_def_boolean(func, "value", false, "Value", "");
2342}
2343
2345{
2346 StructRNA *srna;
2347 FunctionRNA *func;
2348 PropertyRNA *parm;
2349
2350 RNA_def_property_srna(cprop, "BlendDataProbes");
2351 srna = RNA_def_struct(brna, "BlendDataProbes", nullptr);
2352 RNA_def_struct_sdna(srna, "Main");
2353 RNA_def_struct_ui_text(srna, "Main Light Probes", "Collection of light probes");
2354
2355 func = RNA_def_function(srna, "new", "rna_Main_lightprobe_new");
2356 RNA_def_function_ui_description(func, "Add a new light probe to the main database");
2357 parm = RNA_def_string(func, "name", "Probe", 0, "", "New name for the data-block");
2359 parm = RNA_def_enum(
2360 func, "type", rna_enum_lightprobes_type_items, 0, "Type", "The type of light probe to add");
2362 /* return type */
2363 parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "New light probe data-block");
2365 RNA_def_function_return(func, parm);
2366
2367 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2369 RNA_def_function_ui_description(func, "Remove a light probe from the current blendfile");
2370 parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "Light probe to remove");
2373 RNA_def_boolean(func,
2374 "do_unlink",
2375 true,
2376 "",
2377 "Unlink all usages of this light probe before deleting it "
2378 "(WARNING: will also delete objects instancing that light probe data)");
2379 RNA_def_boolean(func,
2380 "do_id_user",
2381 true,
2382 "",
2383 "Decrement user counter of all data-blocks used by this light probe");
2385 func, "do_ui_user", true, "", "Make sure interface does not reference this light probe");
2386
2387 func = RNA_def_function(srna, "tag", "rna_Main_lightprobes_tag");
2388 parm = RNA_def_boolean(func, "value", false, "Value", "");
2390}
2391
2393{
2394 StructRNA *srna;
2395 FunctionRNA *func;
2396 PropertyRNA *parm;
2397
2398 RNA_def_property_srna(cprop, "BlendDataHairCurves");
2399 srna = RNA_def_struct(brna, "BlendDataHairCurves", nullptr);
2400 RNA_def_struct_sdna(srna, "Main");
2401 RNA_def_struct_ui_text(srna, "Main Hair Curves", "Collection of hair curves");
2402
2403 func = RNA_def_function(srna, "new", "rna_Main_hair_curves_new");
2404 RNA_def_function_ui_description(func, "Add a new hair to the main database");
2405 parm = RNA_def_string(func, "name", "Curves", 0, "", "New name for the data-block");
2407 /* return type */
2408 parm = RNA_def_pointer(func, "curves", "Curves", "", "New curves data-block");
2410 RNA_def_function_return(func, parm);
2411
2412 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2414 RNA_def_function_ui_description(func, "Remove a curves data-block from the current blendfile");
2415 parm = RNA_def_pointer(func, "curves", "Curves", "", "Curves data-block to remove");
2418 RNA_def_boolean(func,
2419 "do_unlink",
2420 true,
2421 "",
2422 "Unlink all usages of this curves before deleting it "
2423 "(WARNING: will also delete objects instancing that curves data)");
2424 RNA_def_boolean(func,
2425 "do_id_user",
2426 true,
2427 "",
2428 "Decrement user counter of all data-blocks used by this curves data");
2430 func, "do_ui_user", true, "", "Make sure interface does not reference this curves data");
2431
2432 func = RNA_def_function(srna, "tag", "rna_Main_hair_curves_tag");
2433 parm = RNA_def_boolean(func, "value", false, "Value", "");
2435}
2436
2438{
2439 StructRNA *srna;
2440 FunctionRNA *func;
2441 PropertyRNA *parm;
2442
2443 RNA_def_property_srna(cprop, "BlendDataPointClouds");
2444 srna = RNA_def_struct(brna, "BlendDataPointClouds", nullptr);
2445 RNA_def_struct_sdna(srna, "Main");
2446 RNA_def_struct_ui_text(srna, "Main Point Clouds", "Collection of point clouds");
2447
2448 func = RNA_def_function(srna, "new", "rna_Main_pointclouds_new");
2449 RNA_def_function_ui_description(func, "Add a new point cloud to the main database");
2450 parm = RNA_def_string(func, "name", "PointCloud", 0, "", "New name for the data-block");
2452 /* return type */
2453 parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "New point cloud data-block");
2455 RNA_def_function_return(func, parm);
2456
2457 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2459 RNA_def_function_ui_description(func, "Remove a point cloud from the current blendfile");
2460 parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "Point cloud to remove");
2463 RNA_def_boolean(func,
2464 "do_unlink",
2465 true,
2466 "",
2467 "Unlink all usages of this point cloud before deleting it "
2468 "(WARNING: will also delete objects instancing that point cloud data)");
2469 RNA_def_boolean(func,
2470 "do_id_user",
2471 true,
2472 "",
2473 "Decrement user counter of all data-blocks used by this point cloud data");
2474 RNA_def_boolean(func,
2475 "do_ui_user",
2476 true,
2477 "",
2478 "Make sure interface does not reference this point cloud data");
2479
2480 func = RNA_def_function(srna, "tag", "rna_Main_pointclouds_tag");
2481 parm = RNA_def_boolean(func, "value", false, "Value", "");
2483}
2484
2486{
2487 StructRNA *srna;
2488 FunctionRNA *func;
2489 PropertyRNA *parm;
2490
2491 RNA_def_property_srna(cprop, "BlendDataVolumes");
2492 srna = RNA_def_struct(brna, "BlendDataVolumes", nullptr);
2493 RNA_def_struct_sdna(srna, "Main");
2494 RNA_def_struct_ui_text(srna, "Main Volumes", "Collection of volumes");
2495
2496 func = RNA_def_function(srna, "new", "rna_Main_volumes_new");
2497 RNA_def_function_ui_description(func, "Add a new volume to the main database");
2498 parm = RNA_def_string(func, "name", "Volume", 0, "", "New name for the data-block");
2500 /* return type */
2501 parm = RNA_def_pointer(func, "volume", "Volume", "", "New volume data-block");
2503 RNA_def_function_return(func, parm);
2504
2505 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2507 RNA_def_function_ui_description(func, "Remove a volume from the current blendfile");
2508 parm = RNA_def_pointer(func, "volume", "Volume", "", "Volume to remove");
2511 RNA_def_boolean(func,
2512 "do_unlink",
2513 true,
2514 "",
2515 "Unlink all usages of this volume before deleting it "
2516 "(WARNING: will also delete objects instancing that volume data)");
2517 RNA_def_boolean(func,
2518 "do_id_user",
2519 true,
2520 "",
2521 "Decrement user counter of all data-blocks used by this volume data");
2523 func, "do_ui_user", true, "", "Make sure interface does not reference this volume data");
2524
2525 func = RNA_def_function(srna, "tag", "rna_Main_volumes_tag");
2526 parm = RNA_def_boolean(func, "value", false, "Value", "");
2528}
2529
2530} // namespace blender
2531
2532#endif
Blender kernel action and pose functionality.
Camera data-block and utility functions.
Low-level operations for curves that cannot be defined in the C++ header yet.
Low-level operations for grease pencil.
General operations, lookup, etc. for blender lights.
General operations for probes.
Blender kernel freestyle line style functionality.
General operations, lookup, etc. for materials.
General operations, lookup, etc. for blender objects.
General operations for point clouds.
General operations for speakers.
Volume data-block.
#define FILE_MAX
#define RPT_(msgid)
ID and Library types, which are fundamental for SDNA.
#define ID_IS_PACKED(_id)
Definition DNA_ID.h:703
#define ID_IS_LINKED(_id)
Definition DNA_ID.h:697
#define MAX_ID_NAME
Definition DNA_ID.h:367
#define ID_REAL_USERS(id)
Definition DNA_ID.h:679
Object groups, one object can be in many groups at once.
#define C
Definition RandGen.cpp:29
#define NC_WINDOW
Definition WM_types.hh:388
#define NC_ID
Definition WM_types.hh:408
#define ND_OB_ACTIVE
Definition WM_types.hh:459
#define NC_SCENE
Definition WM_types.hh:391
#define NA_ADDED
Definition WM_types.hh:636
#define ND_LAYER_CONTENT
Definition WM_types.hh:472
string name
Definition scene.h:136
#define INT_MAX
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
Set< ID * > pack_linked_id_hierarchy(Main &bmain, ID &root_id)
Definition library.cc:741
bNodeTree * node_tree_add_tree(Main *bmain, StringRef name, StringRef idname)
Definition node.cc:4992
void node_tree_shader_default(const bContext *C, Main *bmain, ID *id)
BMesh Iterators.
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
const char * BKE_idtype_idcode_to_name(short idcode)
Definition idtype.cc:261
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_main_cachefiles(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_main_volumes(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA * RNA_def_string_file_path(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
struct Text * BKE_text_add(struct Main *bmain, const char *name)
Definition text.cc:284
Mesh * BKE_mesh_new_from_object_to_bmain(Main *bmain, Depsgraph *depsgraph, Object *object, bool preserve_all_data_layers)
void RNA_def_main_grease_pencil(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop)
bArmature * BKE_armature_add(Main *bmain, const char *name)
void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
struct Curves * BKE_curves_add(struct Main *bmain, const char *name)
void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_id_type_items[]
Definition rna_ID.cc:33
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
Scene * BKE_scene_find_replacement(const Main &bmain, const Scene &scene, FunctionRef< bool(const Scene &scene)> scene_validate_cb=nullptr)
Definition scene.cc:2170
void BKE_id_delete(Main *bmain, void *idv, const BKEIDDeleteOptions &options={}) ATTR_NONNULL()
void RNA_def_main_lights(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
void id_us_plus(ID *id)
Definition lib_id.cc:433
bool BKE_scene_can_be_removed(const Main *bmain, const Scene *scene)
Definition scene.cc:2150
void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_lightprobes(BlenderRNA *brna, PropertyRNA *cprop)
Mask * BKE_mask_new(Main *bmain, const char *name)
Volume * BKE_volume_add(Main *bmain, const char *name)
@ WM_JOB_TYPE_LIGHT_BAKE
Definition WM_api.hh:2042
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_lightprobes_type_items[]
@ FUNC_USE_REPORTS
@ FUNC_USE_CONTEXT
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void BKE_id_free_ex(Main *bmain, void *idv, int flag_orig, bool use_flag_from_idtag)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void BKE_brush_init_gpencil_settings(Brush *brush)
Definition brush.cc:719
void RNA_api_main(StructRNA *srna)
const EnumPropertyItem rna_enum_light_type_items[]
Curve * BKE_curve_add(Main *bmain, const char *name, ObjectType type)
Definition curve.cc:429
bAction * BKE_action_add(Main *bmain, const char name[])
@ LIB_ID_FREE_NO_USER_REFCOUNT
@ LIB_ID_FREE_NO_UI_USER
bSound * BKE_sound_new_file_exists(Main *bmain, const char *filepath, short stream_index=0)
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
Definition particle.cc:4135
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_paintcurves(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_object_type_curve_items[]
struct bGPdata * BKE_annotations_data_addnew(struct Main *bmain, const char name[])
void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop)
GreasePencil * BKE_grease_pencil_add(Main *bmain, const char *name)
void RNA_def_main_collections(BlenderRNA *brna, PropertyRNA *cprop)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
Definition main.cc:1058
void RNA_def_main_palettes(BlenderRNA *brna, PropertyRNA *cprop)
bool ED_scene_replace_active_for_deletion(bContext &C, Main &bmain, Scene &scene, Scene *scene_new=nullptr)
Definition scene_edit.cc:96
void BKE_gpencil_material_attr_init(Material *ma)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void BKE_lightprobe_type_set(struct LightProbe *probe, eLightProbeType lightprobe_type)
Definition lightprobe.cc:85
struct Text * BKE_text_load_ex(struct Main *bmain, const char *filepath, const char *relbase, bool is_internal) ATTR_NONNULL(1
Definition text.cc:456
void RNA_def_main_annotations(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Image * BKE_image_load_exists(Main *bmain, const char *filepath, bool check_open=true, bool *r_exists=nullptr)
bke::bNodeTreeType * rna_node_tree_type_from_enum(int value)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
@ OB_MODE_TEXTURE_PAINT
BMesh const char void * data
void BKE_object_materials_sync_length(Main *bmain, Object *ob, ID *id)
bool WM_jobs_has_running(const wmWindowManager *window_manager, const void *owner, const eWM_JobType type, const eWM_JobFlag exclude_flags)
Definition wm_jobs.cc:809
struct Camera * BKE_camera_add(struct Main *bmain, const char *name)
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
void BKE_main_ensure_invariants(Main &bmain, std::optional< Span< ID * > > modified_ids=std::nullopt)
PointCloud * BKE_pointcloud_add(Main *bmain, const char *name)
char char size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
bSound * BKE_sound_new_file(Main *bmain, const char *filepath, short stream_index=0)
struct LightProbe * BKE_lightprobe_add(struct Main *bmain, const char *name)
Scene * BKE_scene_add(Main *bmain, const char *name)
Definition scene.cc:2200
void RNA_def_main_workspaces(BlenderRNA *brna, PropertyRNA *cprop)
FreestyleLineStyle * BKE_linestyle_new(struct Main *bmain, const char *name)
Definition linestyle.cc:762
void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_texture_type_items[]
void RNA_def_main_pointclouds(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:34
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
bool RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **r_identifier)
void RNA_def_main_hair_curves(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
MovieClip * BKE_movieclip_file_add_exists(Main *bmain, const char *filepath)
Definition movieclip.cc:930
void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
VFont * BKE_vfont_load_exists(Main *bmain, const char *filepath)
Definition vfont.cc:382
int BKE_object_obdata_to_type(const ID *id) ATTR_NONNULL(1)
Definition object.cc:2230
const EnumPropertyItem rna_enum_object_mode_items[]
Definition rna_object.cc:39
void BKE_texture_type_set(struct Tex *tex, eTex_Type type)
Definition texture.cc:363
struct World * BKE_world_add(struct Main *bmain, const char *name)
void BKE_main_id_newptr_and_tag_clear(Main *bmain)
Definition lib_id.cc:2097
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
Light * BKE_light_add(Main *bmain, const char *name) ATTR_WARN_UNUSED_RESULT
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
MetaBall * BKE_mball_add(Main *bmain, const char *name)
Definition mball.cc:173
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
ID_Type GS(const char *name)
Definition DNA_ID.h:410
@ PROP_ENUM_NO_CONTEXT
Definition RNA_types.hh:500
@ PROP_THICK_WRAP
Definition RNA_types.hh:493
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:526
@ PROP_NEVER_NULL
Definition RNA_types.hh:447
void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
@ ID_TAG_NO_MAIN
Definition DNA_ID.h:981
struct Tex * BKE_texture_add(struct Main *bmain, const char *name)
Definition texture.cc:370
const EnumPropertyItem * rna_node_tree_type_itemf(void *data, bool(*poll)(void *data, bke::bNodeTreeType *), bool *r_free)
struct Speaker * BKE_speaker_add(struct Main *bmain, const char *name)
Definition speaker.cc:82
VFont * BKE_vfont_load(Main *bmain, const char *filepath)
Definition vfont.cc:304
void DEG_relations_tag_update(Main *bmain)
void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
Material * BKE_material_add(Main *bmain, const char *name)
Object * BKE_object_add_only_object(Main *bmain, ObjectType type, const char *name) ATTR_RETURNS_NONNULL
Definition object.cc:2265
Mesh * BKE_mesh_add(Main *bmain, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
@ PARM_REQUIRED
Definition RNA_types.hh:631
@ PARM_RNAPTR
Definition RNA_types.hh:633
Image * BKE_image_add_generated(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)
void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop)
void id_us_min(ID *id)
Definition lib_id.cc:441
Lattice * BKE_lattice_add(Main *bmain, const char *name)
Definition lattice.cc:392
Brush * BKE_brush_add(Main *bmain, const char *name, eObjectMode ob_mode)
Definition brush.cc:695
void id_fake_user_clear(ID *id)
Definition lib_id.cc:479
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
int BLI_str_utf8_invalid_strip(char *str, size_t str_len) ATTR_NONNULL(1)
MovieClip * BKE_movieclip_file_add(Main *bmain, const char *filepath)
Definition movieclip.cc:866
Palette * BKE_palette_add(Main *bmain, const char *name)
Image * BKE_image_load(Main *bmain, const char *filepath, bool check_open=true)
void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
const NodeType * type
Definition graph/node.h:179
struct ID * newid
Definition DNA_ID.h:419