Blender V5.0
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 "BKE_action.hh"
23# include "BKE_armature.hh"
24# include "BKE_brush.hh"
25# include "BKE_camera.h"
26# include "BKE_collection.hh"
27# include "BKE_curve.hh"
28# include "BKE_curves.h"
29# include "BKE_displist.h"
30# include "BKE_gpencil_legacy.h"
31# include "BKE_grease_pencil.hh"
32# include "BKE_icons.h"
33# include "BKE_idtype.hh"
34# include "BKE_image.hh"
35# include "BKE_lattice.hh"
36# include "BKE_lib_remap.hh"
37# include "BKE_library.hh"
38# include "BKE_light.h"
39# include "BKE_lightprobe.h"
40# include "BKE_linestyle.h"
41# include "BKE_main_invariants.hh"
42# include "BKE_mask.h"
43# include "BKE_material.hh"
44# include "BKE_mball.hh"
45# include "BKE_mesh.hh"
46# include "BKE_movieclip.h"
47# include "BKE_node.hh"
48# include "BKE_object.hh"
49# include "BKE_paint.hh"
50# include "BKE_particle.h"
51# include "BKE_pointcloud.hh"
52# include "BKE_scene.hh"
53# include "BKE_sound.h"
54# include "BKE_speaker.h"
55# include "BKE_text.h"
56# include "BKE_texture.h"
57# include "BKE_vfont.hh"
58# include "BKE_volume.hh"
59# include "BKE_workspace.hh"
60# include "BKE_world.h"
61
62# include "DEG_depsgraph_build.hh"
63# include "DEG_depsgraph_query.hh"
64
65# include "DNA_anim_types.h"
66# include "DNA_armature_types.h"
67# include "DNA_brush_types.h"
68# include "DNA_camera_types.h"
69# include "DNA_collection_types.h"
70# include "DNA_curve_types.h"
71# include "DNA_curves_types.h"
73# include "DNA_lattice_types.h"
74# include "DNA_light_types.h"
75# include "DNA_lightprobe_types.h"
76# include "DNA_mask_types.h"
77# include "DNA_material_types.h"
78# include "DNA_mesh_types.h"
79# include "DNA_meta_types.h"
80# include "DNA_movieclip_types.h"
81# include "DNA_node_types.h"
82# include "DNA_particle_types.h"
83# include "DNA_pointcloud_types.h"
84# include "DNA_sound_types.h"
85# include "DNA_speaker_types.h"
86# include "DNA_text_types.h"
87# include "DNA_texture_types.h"
88# include "DNA_vfont_types.h"
89# include "DNA_volume_types.h"
90# include "DNA_world_types.h"
91
92# include "ED_node.hh"
93# include "ED_screen.hh"
94
95# include "BLT_translation.hh"
96
97# ifdef WITH_PYTHON
98# include "BPY_extern.hh"
99# endif
100
101# include "WM_api.hh"
102# include "WM_types.hh"
103
104static void rna_idname_validate(const char *name, char *r_name)
105{
106 BLI_strncpy(r_name, name, MAX_ID_NAME - 2);
107 BLI_str_utf8_invalid_strip(r_name, strlen(r_name));
108}
109
110static void rna_Main_ID_remove(Main *bmain,
111 ReportList *reports,
112 PointerRNA *id_ptr,
113 bool do_unlink,
114 bool do_id_user,
115 bool do_ui_user)
116{
117 ID *id = static_cast<ID *>(id_ptr->data);
118 if (id->tag & ID_TAG_NO_MAIN) {
119 BKE_reportf(reports,
120 RPT_ERROR,
121 "%s '%s' is outside of main database and cannot be removed from it",
123 id->name + 2);
124 return;
125 }
126 if (do_unlink) {
127 BKE_id_delete(bmain, id);
128 id_ptr->invalidate();
129 /* Force full redraw, mandatory to avoid crashes when running this from UI... */
131 }
132 else if (ID_REAL_USERS(id) <= 0) {
133 const int flag = (do_id_user ? 0 : LIB_ID_FREE_NO_USER_REFCOUNT) |
134 (do_ui_user ? 0 : LIB_ID_FREE_NO_UI_USER);
135 /* Still using ID flags here, this is in-between commit anyway... */
136 BKE_id_free_ex(bmain, id, flag, true);
137 id_ptr->invalidate();
138 }
139 else {
141 reports,
142 RPT_ERROR,
143 "%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)",
145 id->name + 2,
146 ID_REAL_USERS(id));
147 }
148}
149
150static ID *rna_Main_pack_linked_ids_hierarchy(struct BlendData *blenddata,
151 ReportList *reports,
152 ID *root_id)
153{
154 if (!ID_IS_LINKED(root_id)) {
155 BKE_reportf(reports, RPT_ERROR, "Only linked IDs can be packed");
156 return nullptr;
157 }
158 if (ID_IS_PACKED(root_id)) {
159 /* Nothing to do. */
160 return root_id;
161 }
162
163 Main *bmain = reinterpret_cast<Main *>(blenddata);
165
166 ID *packed_root_id = root_id->newid;
168
169 return packed_root_id;
170}
171
172static Camera *rna_Main_cameras_new(Main *bmain, const char *name)
173{
174 char safe_name[MAX_ID_NAME - 2];
175 rna_idname_validate(name, safe_name);
176
177 Camera *camera = BKE_camera_add(bmain, safe_name);
178 id_us_min(&camera->id);
179
181
182 return camera;
183}
184
185static Scene *rna_Main_scenes_new(Main *bmain, const char *name)
186{
187 char safe_name[MAX_ID_NAME - 2];
188 rna_idname_validate(name, safe_name);
189
190 Scene *scene = BKE_scene_add(bmain, safe_name);
191
193
194 return scene;
195}
196static void rna_Main_scenes_remove(
197 Main *bmain, bContext *C, ReportList *reports, PointerRNA *scene_ptr, bool do_unlink)
198{
199 /* don't call BKE_id_free(...) directly */
200 Scene *scene = static_cast<Scene *>(scene_ptr->data);
201
202 if (BKE_scene_can_be_removed(bmain, scene)) {
203 Scene *scene_new = static_cast<Scene *>(scene->id.prev ? scene->id.prev : scene->id.next);
204 if (do_unlink) {
205 /* Don't rely on `CTX_wm_window(C)` as it may have been cleared,
206 * yet windows may still be open that reference this scene. */
207 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
208
209 /* Cancel animation playback. */
210 if (bScreen *screen = ED_screen_animation_playing(wm)) {
211 ScreenAnimData *sad = static_cast<ScreenAnimData *>(screen->animtimer->customdata);
212 if (sad->scene == scene) {
213# ifdef WITH_PYTHON
215# endif
216
218
219# ifdef WITH_PYTHON
221# endif
222 }
223 }
224
225 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
226 if (WM_window_get_active_scene(win) == scene) {
227# ifdef WITH_PYTHON
229# endif
230
231 WM_window_set_active_scene(bmain, C, win, scene_new);
232
233# ifdef WITH_PYTHON
235# endif
236 }
237 }
238 if (CTX_data_scene(C) == scene) {
239# ifdef WITH_PYTHON
241# endif
242
243 CTX_data_scene_set(C, scene_new);
244
245# ifdef WITH_PYTHON
247# endif
248 }
249 }
250 rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink, true, true);
251 }
252 else {
253 BKE_reportf(reports,
254 RPT_ERROR,
255 "Scene '%s' is the last local one, cannot be removed",
256 scene->id.name + 2);
257 }
258}
259
260static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data)
261{
262 if (data != nullptr && (data->tag & ID_TAG_NO_MAIN)) {
263 BKE_report(reports,
264 RPT_ERROR,
265 "Cannot create object in main database with an evaluated data data-block");
266 return nullptr;
267 }
268
269 char safe_name[MAX_ID_NAME - 2];
270 rna_idname_validate(name, safe_name);
271
272 Object *ob;
273 int type = OB_EMPTY;
274
275 if (data) {
277 if (type == -1) {
278 const char *idname;
279 if (RNA_enum_id_from_value(rna_enum_id_type_items, GS(data->name), &idname) == 0) {
280 idname = "UNKNOWN";
281 }
282
283 BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for an object", idname);
284 return nullptr;
285 }
286
288 }
289
290 ob = BKE_object_add_only_object(bmain, type, safe_name);
291
292 ob->data = data;
293 BKE_object_materials_sync_length(bmain, ob, static_cast<ID *>(ob->data));
294
296
297 return ob;
298}
299
300static Material *rna_Main_materials_new(Main *bmain, const char *name)
301{
302 char safe_name[MAX_ID_NAME - 2];
303 rna_idname_validate(name, safe_name);
304
305 Material *material = BKE_material_add(bmain, safe_name);
306 id_us_min(&material->id);
307
308 ED_node_shader_default(nullptr, bmain, &material->id);
309
311
312 return material;
313}
314
315static void rna_Main_materials_gpencil_data(Main * /*bmain*/, PointerRNA *id_ptr)
316{
317 ID *id = static_cast<ID *>(id_ptr->data);
318 Material *ma = (Material *)id;
320}
321
322static void rna_Main_materials_gpencil_remove(Main * /*bmain*/, PointerRNA *id_ptr)
323{
324 ID *id = static_cast<ID *>(id_ptr->data);
325 Material *ma = (Material *)id;
326 if (ma->gp_style) {
328 }
329}
330
331static const EnumPropertyItem *rna_Main_nodetree_type_itemf(bContext * /*C*/,
332 PointerRNA * /*ptr*/,
333 PropertyRNA * /*prop*/,
334 bool *r_free)
335{
336 return rna_node_tree_type_itemf(nullptr, nullptr, r_free);
337}
338static bNodeTree *rna_Main_nodetree_new(Main *bmain, const char *name, int type)
339{
340 char safe_name[MAX_ID_NAME - 2];
341 rna_idname_validate(name, safe_name);
342
344 if (typeinfo) {
345 bNodeTree *ntree = blender::bke::node_tree_add_tree(bmain, safe_name, typeinfo->idname);
347
348 id_us_min(&ntree->id);
349 return ntree;
350 }
351 else {
352 return nullptr;
353 }
354}
355
356static Mesh *rna_Main_meshes_new(Main *bmain, const char *name)
357{
358 char safe_name[MAX_ID_NAME - 2];
359 rna_idname_validate(name, safe_name);
360
361 Mesh *mesh = BKE_mesh_add(bmain, safe_name);
362 id_us_min(&mesh->id);
363
365
366 return mesh;
367}
368
369/* copied from Mesh_getFromObject and adapted to RNA interface */
370static Mesh *rna_Main_meshes_new_from_object(Main *bmain,
371 ReportList *reports,
372 Object *object,
373 bool preserve_all_data_layers,
374 Depsgraph *depsgraph)
375{
376 switch (object->type) {
377 case OB_FONT:
378 case OB_CURVES_LEGACY:
379 case OB_SURF:
380 case OB_MBALL:
381 case OB_MESH:
382 break;
383 default:
384 BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
385 return nullptr;
386 }
387
389 bmain, depsgraph, object, preserve_all_data_layers);
390
392
393 return mesh;
394}
395
396static Light *rna_Main_lights_new(Main *bmain, const char *name, int type)
397{
398 char safe_name[MAX_ID_NAME - 2];
399 rna_idname_validate(name, safe_name);
400
401 Light *lamp = BKE_light_add(bmain, safe_name);
402 lamp->type = type;
403 id_us_min(&lamp->id);
404
406
407 return lamp;
408}
409
410static Image *rna_Main_images_new(Main *bmain,
411 const char *name,
412 int width,
413 int height,
414 bool alpha,
415 bool float_buffer,
416 bool stereo3d,
417 bool is_data,
418 bool tiled)
419{
420 char safe_name[MAX_ID_NAME - 2];
421 rna_idname_validate(name, safe_name);
422
423 float color[4] = {0.0, 0.0, 0.0, 1.0};
424 Image *image = BKE_image_add_generated(bmain,
425 width,
426 height,
427 safe_name,
428 alpha ? 32 : 24,
429 float_buffer,
430 0,
431 color,
432 stereo3d,
433 is_data,
434 tiled);
435 id_us_min(&image->id);
436
438
439 return image;
440}
441static Image *rna_Main_images_load(Main *bmain,
442 ReportList *reports,
443 const char *filepath,
444 bool check_existing)
445{
446 Image *ima;
447
448 errno = 0;
449 if (check_existing) {
450 ima = BKE_image_load_exists(bmain, filepath);
451 }
452 else {
453 ima = BKE_image_load(bmain, filepath);
454 }
455
456 if (!ima) {
457 BKE_reportf(reports,
458 RPT_ERROR,
459 "Cannot read '%s': %s",
460 filepath,
461 errno ? strerror(errno) : RPT_("unsupported image format"));
462 }
463
464 id_us_min((ID *)ima);
465
467
468 return ima;
469}
470
471static Lattice *rna_Main_lattices_new(Main *bmain, const char *name)
472{
473 char safe_name[MAX_ID_NAME - 2];
474 rna_idname_validate(name, safe_name);
475
476 Lattice *lt = BKE_lattice_add(bmain, safe_name);
477 id_us_min(&lt->id);
478
480
481 return lt;
482}
483
484static Curve *rna_Main_curves_new(Main *bmain, const char *name, int type)
485{
486 char safe_name[MAX_ID_NAME - 2];
487 rna_idname_validate(name, safe_name);
488
489 Curve *cu = BKE_curve_add(bmain, safe_name, type);
490 id_us_min(&cu->id);
491
493
494 return cu;
495}
496
497static MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name)
498{
499 char safe_name[MAX_ID_NAME - 2];
500 rna_idname_validate(name, safe_name);
501
502 MetaBall *mb = BKE_mball_add(bmain, safe_name);
503 id_us_min(&mb->id);
504
506
507 return mb;
508}
509
510static VFont *rna_Main_fonts_load(Main *bmain,
511 ReportList *reports,
512 const char *filepath,
513 bool check_existing)
514{
515 VFont *font;
516 errno = 0;
517
518 if (check_existing) {
519 font = BKE_vfont_load_exists(bmain, filepath);
520 }
521 else {
522 font = BKE_vfont_load(bmain, filepath);
523 }
524
525 if (!font) {
526 BKE_reportf(reports,
527 RPT_ERROR,
528 "Cannot read '%s': %s",
529 filepath,
530 errno ? strerror(errno) : RPT_("unsupported font format"));
531 }
532
534
535 return font;
536}
537
538static Tex *rna_Main_textures_new(Main *bmain, const char *name, int type)
539{
540 char safe_name[MAX_ID_NAME - 2];
541 rna_idname_validate(name, safe_name);
542
543 Tex *tex = BKE_texture_add(bmain, safe_name);
544 BKE_texture_type_set(tex, type);
545 id_us_min(&tex->id);
546
548
549 return tex;
550}
551
552static Brush *rna_Main_brushes_new(Main *bmain, const char *name, int mode)
553{
554 char safe_name[MAX_ID_NAME - 2];
555 rna_idname_validate(name, safe_name);
556
557 Brush *brush = BKE_brush_add(bmain, safe_name, eObjectMode(mode));
558 id_us_min(&brush->id);
559
561
562 return brush;
563}
564
565static void rna_Main_brush_gpencil_data(Main * /*bmain*/, PointerRNA *id_ptr)
566{
567 ID *id = static_cast<ID *>(id_ptr->data);
568 Brush *brush = reinterpret_cast<Brush *>(id);
570}
571
572static World *rna_Main_worlds_new(Main *bmain, const char *name)
573{
574 char safe_name[MAX_ID_NAME - 2];
575 rna_idname_validate(name, safe_name);
576
577 World *world = BKE_world_add(bmain, safe_name);
578 id_us_min(&world->id);
579
580 ED_node_shader_default(nullptr, bmain, &world->id);
581
583
584 return world;
585}
586
587static Collection *rna_Main_collections_new(Main *bmain, const char *name)
588{
589 char safe_name[MAX_ID_NAME - 2];
590 rna_idname_validate(name, safe_name);
591
592 Collection *collection = BKE_collection_add(bmain, nullptr, safe_name);
593
595
596 return collection;
597}
598
599static Speaker *rna_Main_speakers_new(Main *bmain, const char *name)
600{
601 char safe_name[MAX_ID_NAME - 2];
602 rna_idname_validate(name, safe_name);
603
604 Speaker *speaker = BKE_speaker_add(bmain, safe_name);
605 id_us_min(&speaker->id);
606
608
609 return speaker;
610}
611
612static bSound *rna_Main_sounds_load(Main *bmain, const char *name, bool check_existing)
613{
614 bSound *sound;
615
616 if (check_existing) {
617 sound = BKE_sound_new_file_exists(bmain, name);
618 }
619 else {
620 sound = BKE_sound_new_file(bmain, name);
621 }
622
623 id_us_min(&sound->id);
624
626
627 return sound;
628}
629
630static Text *rna_Main_texts_new(Main *bmain, const char *name)
631{
632 char safe_name[MAX_ID_NAME - 2];
633 rna_idname_validate(name, safe_name);
634
635 Text *text = BKE_text_add(bmain, safe_name);
636
638
639 return text;
640}
641
642static Text *rna_Main_texts_load(Main *bmain,
643 ReportList *reports,
644 const char *filepath,
645 bool is_internal)
646{
647 Text *txt;
648
649 errno = 0;
650 txt = BKE_text_load_ex(bmain, filepath, BKE_main_blendfile_path(bmain), is_internal);
651
652 if (!txt) {
653 BKE_reportf(reports,
654 RPT_ERROR,
655 "Cannot read '%s': %s",
656 filepath,
657 errno ? strerror(errno) : RPT_("unable to load text"));
658 }
659
661
662 return txt;
663}
664
665static bArmature *rna_Main_armatures_new(Main *bmain, const char *name)
666{
667 char safe_name[MAX_ID_NAME - 2];
668 rna_idname_validate(name, safe_name);
669
670 bArmature *arm = BKE_armature_add(bmain, safe_name);
671 id_us_min(&arm->id);
672
674
675 return arm;
676}
677
678static bAction *rna_Main_actions_new(Main *bmain, const char *name)
679{
680 char safe_name[MAX_ID_NAME - 2];
681 rna_idname_validate(name, safe_name);
682
683 bAction *act = BKE_action_add(bmain, safe_name);
684 id_fake_user_clear(&act->id);
685 id_us_min(&act->id);
686
688
689 return act;
690}
691
692static ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
693{
694 char safe_name[MAX_ID_NAME - 2];
695 rna_idname_validate(name, safe_name);
696
697 ParticleSettings *part = BKE_particlesettings_add(bmain, safe_name);
698 id_us_min(&part->id);
699
701
702 return part;
703}
704
705static Palette *rna_Main_palettes_new(Main *bmain, const char *name)
706{
707 char safe_name[MAX_ID_NAME - 2];
708 rna_idname_validate(name, safe_name);
709
710 Palette *palette = BKE_palette_add(bmain, safe_name);
711 id_us_min(&palette->id);
712
714
715 return (Palette *)palette;
716}
717
718static MovieClip *rna_Main_movieclip_load(Main *bmain,
719 ReportList *reports,
720 const char *filepath,
721 bool check_existing)
722{
723 MovieClip *clip;
724
725 errno = 0;
726
727 if (check_existing) {
728 clip = BKE_movieclip_file_add_exists(bmain, filepath);
729 }
730 else {
731 clip = BKE_movieclip_file_add(bmain, filepath);
732 }
733
734 if (clip != nullptr) {
736 }
737 else {
738 BKE_reportf(reports,
739 RPT_ERROR,
740 "Cannot read '%s': %s",
741 filepath,
742 errno ? strerror(errno) : RPT_("unable to load movie clip"));
743 }
744
745 id_us_min((ID *)clip);
746
748
749 return clip;
750}
751
752static Mask *rna_Main_mask_new(Main *bmain, const char *name)
753{
754 char safe_name[MAX_ID_NAME - 2];
755 rna_idname_validate(name, safe_name);
756
757 Mask *mask = BKE_mask_new(bmain, safe_name);
758 id_us_min(&mask->id);
759
761
762 return mask;
763}
764
765static FreestyleLineStyle *rna_Main_linestyles_new(Main *bmain, const char *name)
766{
767 char safe_name[MAX_ID_NAME - 2];
768 rna_idname_validate(name, safe_name);
769
770 FreestyleLineStyle *linestyle = BKE_linestyle_new(bmain, safe_name);
771 id_us_min(&linestyle->id);
772
774
775 return linestyle;
776}
777
778static LightProbe *rna_Main_lightprobe_new(Main *bmain, const char *name, int type)
779{
780 char safe_name[MAX_ID_NAME - 2];
781 rna_idname_validate(name, safe_name);
782
783 LightProbe *probe = BKE_lightprobe_add(bmain, safe_name);
784
785 BKE_lightprobe_type_set(probe, type);
786
787 id_us_min(&probe->id);
788
790
791 return probe;
792}
793
794static bGPdata *rna_Main_annotations_new(Main *bmain, const char *name)
795{
796 char safe_name[MAX_ID_NAME - 2];
797 rna_idname_validate(name, safe_name);
798
799 bGPdata *gpd = BKE_gpencil_data_addnew(bmain, safe_name);
800 id_us_min(&gpd->id);
801
803
804 return gpd;
805}
806
807static GreasePencil *rna_Main_grease_pencils_new(Main *bmain, const char *name)
808{
809 char safe_name[MAX_ID_NAME - 2];
810 rna_idname_validate(name, safe_name);
811
812 GreasePencil *grease_pencil = BKE_grease_pencil_add(bmain, safe_name);
813 id_us_min(&grease_pencil->id);
814
816
817 return grease_pencil;
818}
819
820static Curves *rna_Main_hair_curves_new(Main *bmain, const char *name)
821{
822 char safe_name[MAX_ID_NAME - 2];
823 rna_idname_validate(name, safe_name);
824
825 Curves *curves = BKE_curves_add(bmain, safe_name);
826 id_us_min(&curves->id);
827
829
830 return curves;
831}
832
833static PointCloud *rna_Main_pointclouds_new(Main *bmain, const char *name)
834{
835 char safe_name[MAX_ID_NAME - 2];
836 rna_idname_validate(name, safe_name);
837
838 PointCloud *pointcloud = BKE_pointcloud_add(bmain, safe_name);
839 id_us_min(&pointcloud->id);
840
842
843 return pointcloud;
844}
845
846static Volume *rna_Main_volumes_new(Main *bmain, const char *name)
847{
848 char safe_name[MAX_ID_NAME - 2];
849 rna_idname_validate(name, safe_name);
850
851 Volume *volume = BKE_volume_add(bmain, safe_name);
852 id_us_min(&volume->id);
853
855
856 return volume;
857}
858
859/* tag functions, all the same */
860# define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
861 static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \
862 { \
863 BKE_main_id_tag_listbase(&bmain->_listbase_name, ID_TAG_DOIT, value); \
864 }
865
866RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras, ID_CA)
867RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes, ID_SCE)
868RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects, ID_OB)
869RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials, ID_MA)
870RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees, ID_NT)
871RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes, ID_ME)
872RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights, ID_LA)
873RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries, ID_LI)
874RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens, ID_SCR)
875RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM)
876RNA_MAIN_ID_TAG_FUNCS_DEF(images, images, ID_IM)
877RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices, ID_LT)
878RNA_MAIN_ID_TAG_FUNCS_DEF(curves, curves, ID_CU_LEGACY)
879RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs, ID_MB)
880RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts, ID_VF)
881RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures, ID_TE)
882RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brushes, ID_BR)
883RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds, ID_WO)
884RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections, ID_GR)
885// RNA_MAIN_ID_TAG_FUNCS_DEF(shape_keys, key, ID_KE)
886RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts, ID_TXT)
887RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers, ID_SPK)
888RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds, ID_SO)
889RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures, ID_AR)
890RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions, ID_AC)
891RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles, ID_PA)
892RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL)
893RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils, ID_GD_LEGACY)
894RNA_MAIN_ID_TAG_FUNCS_DEF(grease_pencils, grease_pencils, ID_GP)
895RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips, ID_MC)
896RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks, ID_MSK)
897RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles, ID_LS)
898RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF)
899RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC)
900RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS)
901RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP)
902RNA_MAIN_ID_TAG_FUNCS_DEF(hair_curves, hair_curves, ID_CV)
903RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT)
904RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO)
905
906# undef RNA_MAIN_ID_TAG_FUNCS_DEF
907
908#else
909
911{
912 FunctionRNA *func;
913 PropertyRNA *parm;
914
915# if 0
916 /* maybe we want to add functions in 'bpy.data' still?
917 * for now they are all in collections bpy.data.images.new(...) */
918 func = RNA_def_function(srna, "add_image", "rna_Main_add_image");
919 RNA_def_function_ui_description(func, "Add a new image");
921 func, "filepath", nullptr, 0, "", "File path to load image from");
923 parm = RNA_def_pointer(func, "image", "Image", "", "New image");
924 RNA_def_function_return(func, parm);
925# endif
926
927 func = RNA_def_function(srna, "pack_linked_ids_hierarchy", "rna_Main_pack_linked_ids_hierarchy");
929 func, "Pack the given linked ID and its dependencies into current blendfile");
931 parm = RNA_def_pointer(func, "root_id", "ID", "", "Root linked ID to pack");
933 parm = RNA_def_pointer(func, "packed_id", "ID", "", "The packed ID matching the given root ID");
934 RNA_def_function_return(func, parm);
935}
936
938{
939 StructRNA *srna;
940 FunctionRNA *func;
941 PropertyRNA *parm;
942
943 RNA_def_property_srna(cprop, "BlendDataCameras");
944 srna = RNA_def_struct(brna, "BlendDataCameras", nullptr);
945 RNA_def_struct_sdna(srna, "Main");
946 RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras");
947
948 func = RNA_def_function(srna, "new", "rna_Main_cameras_new");
949 RNA_def_function_ui_description(func, "Add a new camera to the main database");
950 parm = RNA_def_string(func, "name", "Camera", 0, "", "New name for the data-block");
952 /* return type */
953 parm = RNA_def_pointer(func, "camera", "Camera", "", "New camera data-block");
954 RNA_def_function_return(func, parm);
955
956 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
958 RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
959 parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
962 RNA_def_boolean(func,
963 "do_unlink",
964 true,
965 "",
966 "Unlink all usages of this camera before deleting it "
967 "(WARNING: will also delete objects instancing that camera data)");
968 RNA_def_boolean(func,
969 "do_id_user",
970 true,
971 "",
972 "Decrement user counter of all data-blocks used by this camera");
974 func, "do_ui_user", true, "", "Make sure interface does not reference this camera");
975
976 func = RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
977 parm = RNA_def_boolean(func, "value", false, "Value", "");
979}
980
982{
983 StructRNA *srna;
984 FunctionRNA *func;
985 PropertyRNA *parm;
986
987 RNA_def_property_srna(cprop, "BlendDataScenes");
988 srna = RNA_def_struct(brna, "BlendDataScenes", nullptr);
989 RNA_def_struct_sdna(srna, "Main");
990 RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");
991
992 func = RNA_def_function(srna, "new", "rna_Main_scenes_new");
993 RNA_def_function_ui_description(func, "Add a new scene to the main database");
994 parm = RNA_def_string(func, "name", "Scene", 0, "", "New name for the data-block");
996 /* return type */
997 parm = RNA_def_pointer(func, "scene", "Scene", "", "New scene data-block");
998 RNA_def_function_return(func, parm);
999
1000 func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
1002 RNA_def_function_ui_description(func, "Remove a scene from the current blendfile");
1003 parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
1007 func, "do_unlink", true, "", "Unlink all usages of this scene before deleting it");
1008
1009 func = RNA_def_function(srna, "tag", "rna_Main_scenes_tag");
1010 parm = RNA_def_boolean(func, "value", false, "Value", "");
1012}
1013
1015{
1016 StructRNA *srna;
1017 FunctionRNA *func;
1018 PropertyRNA *parm;
1019
1020 RNA_def_property_srna(cprop, "BlendDataObjects");
1021 srna = RNA_def_struct(brna, "BlendDataObjects", nullptr);
1022 RNA_def_struct_sdna(srna, "Main");
1023 RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects");
1024
1025 func = RNA_def_function(srna, "new", "rna_Main_objects_new");
1027 RNA_def_function_ui_description(func, "Add a new object to the main database");
1028 parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the data-block");
1030 parm = RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object");
1032
1033 /* return type */
1034 parm = RNA_def_pointer(func, "object", "Object", "", "New object data-block");
1035 RNA_def_function_return(func, parm);
1036
1037 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1038 RNA_def_function_ui_description(func, "Remove an object from the current blendfile");
1040 parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
1044 func, "do_unlink", true, "", "Unlink all usages of this object before deleting it");
1045 RNA_def_boolean(func,
1046 "do_id_user",
1047 true,
1048 "",
1049 "Decrement user counter of all data-blocks used by this object");
1051 func, "do_ui_user", true, "", "Make sure interface does not reference this object");
1052
1053 func = RNA_def_function(srna, "tag", "rna_Main_objects_tag");
1054 parm = RNA_def_boolean(func, "value", false, "Value", "");
1056}
1057
1059{
1060 StructRNA *srna;
1061 FunctionRNA *func;
1062 PropertyRNA *parm;
1063
1064 RNA_def_property_srna(cprop, "BlendDataMaterials");
1065 srna = RNA_def_struct(brna, "BlendDataMaterials", nullptr);
1066 RNA_def_struct_sdna(srna, "Main");
1067 RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials");
1068
1069 func = RNA_def_function(srna, "new", "rna_Main_materials_new");
1070 RNA_def_function_ui_description(func, "Add a new material to the main database");
1071 parm = RNA_def_string(func, "name", "Material", 0, "", "New name for the data-block");
1073 /* return type */
1074 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");
1167 RNA_def_function_return(func, parm);
1168
1169 func = RNA_def_function(srna, "new_from_object", "rna_Main_meshes_new_from_object");
1171 func,
1172 "Add a new mesh created from given object (undeformed geometry if object is original, and "
1173 "final evaluated geometry, with all modifiers etc., if object is evaluated)");
1175 parm = RNA_def_pointer(func, "object", "Object", "", "Object to create mesh from");
1177 RNA_def_boolean(func,
1178 "preserve_all_data_layers",
1179 false,
1180 "",
1181 "Preserve all data layers in the mesh, like UV maps and vertex groups. "
1182 "By default Blender only computes the subset of data layers needed for viewport "
1183 "display and rendering, for better performance.");
1185 func,
1186 "depsgraph",
1187 "Depsgraph",
1188 "Dependency Graph",
1189 "Evaluated dependency graph which is required when preserve_all_data_layers is true");
1190 parm = RNA_def_pointer(func,
1191 "mesh",
1192 "Mesh",
1193 "",
1194 "Mesh created from object, remove it if it is only used for export");
1195 RNA_def_function_return(func, parm);
1196
1197 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1199 RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
1200 parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
1203 RNA_def_boolean(func,
1204 "do_unlink",
1205 true,
1206 "",
1207 "Unlink all usages of this mesh before deleting it "
1208 "(WARNING: will also delete objects instancing that mesh data)");
1209 RNA_def_boolean(func,
1210 "do_id_user",
1211 true,
1212 "",
1213 "Decrement user counter of all data-blocks used by this mesh data");
1215 func, "do_ui_user", true, "", "Make sure interface does not reference this mesh data");
1216
1217 func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
1218 parm = RNA_def_boolean(func, "value", false, "Value", "");
1220}
1221
1223{
1224 StructRNA *srna;
1225 FunctionRNA *func;
1226 PropertyRNA *parm;
1227
1228 RNA_def_property_srna(cprop, "BlendDataLights");
1229 srna = RNA_def_struct(brna, "BlendDataLights", nullptr);
1230 RNA_def_struct_sdna(srna, "Main");
1231 RNA_def_struct_ui_text(srna, "Main Lights", "Collection of lights");
1232
1233 func = RNA_def_function(srna, "new", "rna_Main_lights_new");
1234 RNA_def_function_ui_description(func, "Add a new light to the main database");
1235 parm = RNA_def_string(func, "name", "Light", 0, "", "New name for the data-block");
1237 parm = RNA_def_enum(
1238 func, "type", rna_enum_light_type_items, 0, "Type", "The type of light to add");
1240 /* return type */
1241 parm = RNA_def_pointer(func, "light", "Light", "", "New light data-block");
1242 RNA_def_function_return(func, parm);
1243
1244 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1246 RNA_def_function_ui_description(func, "Remove a light from the current blendfile");
1247 parm = RNA_def_pointer(func, "light", "Light", "", "Light to remove");
1250 RNA_def_boolean(func,
1251 "do_unlink",
1252 true,
1253 "",
1254 "Unlink all usages of this light before deleting it "
1255 "(WARNING: will also delete objects instancing that light data)");
1256 RNA_def_boolean(func,
1257 "do_id_user",
1258 true,
1259 "",
1260 "Decrement user counter of all data-blocks used by this light data");
1262 func, "do_ui_user", true, "", "Make sure interface does not reference this light data");
1263
1264 func = RNA_def_function(srna, "tag", "rna_Main_lights_tag");
1265 parm = RNA_def_boolean(func, "value", false, "Value", "");
1267}
1268
1270{
1271 StructRNA *srna;
1272 FunctionRNA *func;
1273 PropertyRNA *parm;
1274
1275 RNA_def_property_srna(cprop, "BlendDataLibraries");
1276 srna = RNA_def_struct(brna, "BlendDataLibraries", nullptr);
1277 RNA_def_struct_sdna(srna, "Main");
1278 RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
1279
1280 func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
1281 parm = RNA_def_boolean(func, "value", false, "Value", "");
1283
1284 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1286 RNA_def_function_ui_description(func, "Remove a library from the current blendfile");
1287 parm = RNA_def_pointer(func, "library", "Library", "", "Library to remove");
1291 func, "do_unlink", true, "", "Unlink all usages of this library before deleting it");
1292 RNA_def_boolean(func,
1293 "do_id_user",
1294 true,
1295 "",
1296 "Decrement user counter of all data-blocks used by this library");
1298 func, "do_ui_user", true, "", "Make sure interface does not reference this library");
1299}
1300
1302{
1303 StructRNA *srna;
1304 FunctionRNA *func;
1305 PropertyRNA *parm;
1306
1307 RNA_def_property_srna(cprop, "BlendDataScreens");
1308 srna = RNA_def_struct(brna, "BlendDataScreens", nullptr);
1309 RNA_def_struct_sdna(srna, "Main");
1310 RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
1311
1312 func = RNA_def_function(srna, "tag", "rna_Main_screens_tag");
1313 parm = RNA_def_boolean(func, "value", false, "Value", "");
1315}
1316
1318{
1319 StructRNA *srna;
1320 FunctionRNA *func;
1321 PropertyRNA *parm;
1322
1323 RNA_def_property_srna(cprop, "BlendDataWindowManagers");
1324 srna = RNA_def_struct(brna, "BlendDataWindowManagers", nullptr);
1325 RNA_def_struct_sdna(srna, "Main");
1326 RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
1327
1328 func = RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
1329 parm = RNA_def_boolean(func, "value", false, "Value", "");
1331}
1333{
1334 StructRNA *srna;
1335 FunctionRNA *func;
1336 PropertyRNA *parm;
1337
1338 RNA_def_property_srna(cprop, "BlendDataImages");
1339 srna = RNA_def_struct(brna, "BlendDataImages", nullptr);
1340 RNA_def_struct_sdna(srna, "Main");
1341 RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
1342
1343 func = RNA_def_function(srna, "new", "rna_Main_images_new");
1344 RNA_def_function_ui_description(func, "Add a new image to the main database");
1345 parm = RNA_def_string(func, "name", "Image", 0, "", "New name for the data-block");
1347 parm = RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 1, INT_MAX);
1349 parm = RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 1, INT_MAX);
1351 RNA_def_boolean(func, "alpha", false, "Alpha", "Use alpha channel");
1353 func, "float_buffer", false, "Float Buffer", "Create an image with floating-point color");
1354 RNA_def_boolean(func, "stereo3d", false, "Stereo 3D", "Create left and right views");
1356 func, "is_data", false, "Is Data", "Create image with non-color data color space");
1357 RNA_def_boolean(func, "tiled", false, "Tiled", "Create a tiled image");
1358 /* return type */
1359 parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1360 RNA_def_function_return(func, parm);
1361
1362 func = RNA_def_function(srna, "load", "rna_Main_images_load");
1364 RNA_def_function_ui_description(func, "Load a new image into the main database");
1366 func, "filepath", "File Path", 0, "", "Path of the file to load");
1368 RNA_def_boolean(func,
1369 "check_existing",
1370 false,
1371 "",
1372 "Using existing data-block if this file is already loaded");
1373 /* return type */
1374 parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1375 RNA_def_function_return(func, parm);
1376
1377 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1379 RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
1380 parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove");
1384 func, "do_unlink", true, "", "Unlink all usages of this image before deleting it");
1385 RNA_def_boolean(func,
1386 "do_id_user",
1387 true,
1388 "",
1389 "Decrement user counter of all data-blocks used by this image");
1391 func, "do_ui_user", true, "", "Make sure interface does not reference this image");
1392
1393 func = RNA_def_function(srna, "tag", "rna_Main_images_tag");
1394 parm = RNA_def_boolean(func, "value", false, "Value", "");
1396}
1397
1399{
1400 StructRNA *srna;
1401 FunctionRNA *func;
1402 PropertyRNA *parm;
1403
1404 RNA_def_property_srna(cprop, "BlendDataLattices");
1405 srna = RNA_def_struct(brna, "BlendDataLattices", nullptr);
1406 RNA_def_struct_sdna(srna, "Main");
1407 RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
1408
1409 func = RNA_def_function(srna, "new", "rna_Main_lattices_new");
1410 RNA_def_function_ui_description(func, "Add a new lattice to the main database");
1411 parm = RNA_def_string(func, "name", "Lattice", 0, "", "New name for the data-block");
1413 /* return type */
1414 parm = RNA_def_pointer(func, "lattice", "Lattice", "", "New lattice data-block");
1415 RNA_def_function_return(func, parm);
1416
1417 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1419 RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
1420 parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
1423 RNA_def_boolean(func,
1424 "do_unlink",
1425 true,
1426 "",
1427 "Unlink all usages of this lattice before deleting it "
1428 "(WARNING: will also delete objects instancing that lattice data)");
1429 RNA_def_boolean(func,
1430 "do_id_user",
1431 true,
1432 "",
1433 "Decrement user counter of all data-blocks used by this lattice data");
1435 func, "do_ui_user", true, "", "Make sure interface does not reference this lattice data");
1436
1437 func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
1438 parm = RNA_def_boolean(func, "value", false, "Value", "");
1440}
1442{
1443 StructRNA *srna;
1444 FunctionRNA *func;
1445 PropertyRNA *parm;
1446
1447 RNA_def_property_srna(cprop, "BlendDataCurves");
1448 srna = RNA_def_struct(brna, "BlendDataCurves", nullptr);
1449 RNA_def_struct_sdna(srna, "Main");
1450 RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
1451
1452 func = RNA_def_function(srna, "new", "rna_Main_curves_new");
1453 RNA_def_function_ui_description(func, "Add a new curve to the main database");
1454 parm = RNA_def_string(func, "name", "Curve", 0, "", "New name for the data-block");
1456 parm = RNA_def_enum(
1457 func, "type", rna_enum_object_type_curve_items, 0, "Type", "The type of curve to add");
1459 /* return type */
1460 parm = RNA_def_pointer(func, "curve", "Curve", "", "New curve data-block");
1461 RNA_def_function_return(func, parm);
1462
1463 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1465 RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
1466 parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
1469 RNA_def_boolean(func,
1470 "do_unlink",
1471 true,
1472 "",
1473 "Unlink all usages of this curve before deleting it "
1474 "(WARNING: will also delete objects instancing that curve data)");
1475 RNA_def_boolean(func,
1476 "do_id_user",
1477 true,
1478 "",
1479 "Decrement user counter of all data-blocks used by this curve data");
1481 func, "do_ui_user", true, "", "Make sure interface does not reference this curve data");
1482
1483 func = RNA_def_function(srna, "tag", "rna_Main_curves_tag");
1484 parm = RNA_def_boolean(func, "value", false, "Value", "");
1486}
1488{
1489 StructRNA *srna;
1490 FunctionRNA *func;
1491 PropertyRNA *parm;
1492
1493 RNA_def_property_srna(cprop, "BlendDataMetaBalls");
1494 srna = RNA_def_struct(brna, "BlendDataMetaBalls", nullptr);
1495 RNA_def_struct_sdna(srna, "Main");
1496 RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs");
1497
1498 func = RNA_def_function(srna, "new", "rna_Main_metaballs_new");
1499 RNA_def_function_ui_description(func, "Add a new metaball to the main database");
1500 parm = RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the data-block");
1502 /* return type */
1503 parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball data-block");
1504 RNA_def_function_return(func, parm);
1505
1506 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1508 RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile");
1509 parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove");
1512 RNA_def_boolean(func,
1513 "do_unlink",
1514 true,
1515 "",
1516 "Unlink all usages of this metaball before deleting it "
1517 "(WARNING: will also delete objects instancing that metaball data)");
1518 RNA_def_boolean(func,
1519 "do_id_user",
1520 true,
1521 "",
1522 "Decrement user counter of all data-blocks used by this metaball data");
1524 func, "do_ui_user", true, "", "Make sure interface does not reference this metaball data");
1525
1526 func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
1527 parm = RNA_def_boolean(func, "value", false, "Value", "");
1529}
1531{
1532 StructRNA *srna;
1533 FunctionRNA *func;
1534 PropertyRNA *parm;
1535
1536 RNA_def_property_srna(cprop, "BlendDataFonts");
1537 srna = RNA_def_struct(brna, "BlendDataFonts", nullptr);
1538 RNA_def_struct_sdna(srna, "Main");
1539 RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
1540
1541 func = RNA_def_function(srna, "load", "rna_Main_fonts_load");
1543 RNA_def_function_ui_description(func, "Load a new font into the main database");
1545 func, "filepath", "File Path", 0, "", "path of the font to load");
1547 RNA_def_boolean(func,
1548 "check_existing",
1549 false,
1550 "",
1551 "Using existing data-block if this file is already loaded");
1552 /* return type */
1553 parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "New font data-block");
1554 RNA_def_function_return(func, parm);
1555
1556 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1558 RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
1559 parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
1563 func, "do_unlink", true, "", "Unlink all usages of this font before deleting it");
1565 func, "do_id_user", true, "", "Decrement user counter of all data-blocks used by this font");
1567 func, "do_ui_user", true, "", "Make sure interface does not reference this font");
1568
1569 func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
1570 parm = RNA_def_boolean(func, "value", false, "Value", "");
1572}
1574{
1575 StructRNA *srna;
1576 FunctionRNA *func;
1577 PropertyRNA *parm;
1578
1579 RNA_def_property_srna(cprop, "BlendDataTextures");
1580 srna = RNA_def_struct(brna, "BlendDataTextures", nullptr);
1581 RNA_def_struct_sdna(srna, "Main");
1582 RNA_def_struct_ui_text(srna, "Main Textures", "Collection of textures");
1583
1584 func = RNA_def_function(srna, "new", "rna_Main_textures_new");
1585 RNA_def_function_ui_description(func, "Add a new texture to the main database");
1586 parm = RNA_def_string(func, "name", "Texture", 0, "", "New name for the data-block");
1588 parm = RNA_def_enum(
1589 func, "type", rna_enum_texture_type_items, 0, "Type", "The type of texture to add");
1591 /* return type */
1592 parm = RNA_def_pointer(func, "texture", "Texture", "", "New texture data-block");
1593 RNA_def_function_return(func, parm);
1594
1595 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1597 RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
1598 parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
1602 func, "do_unlink", true, "", "Unlink all usages of this texture before deleting it");
1603 RNA_def_boolean(func,
1604 "do_id_user",
1605 true,
1606 "",
1607 "Decrement user counter of all data-blocks used by this texture");
1609 func, "do_ui_user", true, "", "Make sure interface does not reference this texture");
1610
1611 func = RNA_def_function(srna, "tag", "rna_Main_textures_tag");
1612 parm = RNA_def_boolean(func, "value", false, "Value", "");
1614}
1616{
1617 StructRNA *srna;
1618 FunctionRNA *func;
1619 PropertyRNA *parm;
1620
1621 RNA_def_property_srna(cprop, "BlendDataBrushes");
1622 srna = RNA_def_struct(brna, "BlendDataBrushes", nullptr);
1623 RNA_def_struct_sdna(srna, "Main");
1624 RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
1625
1626 func = RNA_def_function(srna, "new", "rna_Main_brushes_new");
1627 RNA_def_function_ui_description(func, "Add a new brush to the main database");
1628 parm = RNA_def_string(func, "name", "Brush", 0, "", "New name for the data-block");
1630 parm = RNA_def_enum(func,
1631 "mode",
1634 "",
1635 "Paint Mode for the new brush");
1636 /* return type */
1637 parm = RNA_def_pointer(func, "brush", "Brush", "", "New brush data-block");
1638 RNA_def_function_return(func, parm);
1639
1640 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1642 RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
1643 parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
1647 func, "do_unlink", true, "", "Unlink all usages of this brush before deleting it");
1648 RNA_def_boolean(func,
1649 "do_id_user",
1650 true,
1651 "",
1652 "Decrement user counter of all data-blocks used by this brush");
1654 func, "do_ui_user", true, "", "Make sure interface does not reference this brush");
1655
1656 func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
1657 parm = RNA_def_boolean(func, "value", false, "Value", "");
1659
1660 func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_brush_gpencil_data");
1661 RNA_def_function_ui_description(func, "Add Grease Pencil brush settings");
1662 parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush");
1664}
1665
1667{
1668 StructRNA *srna;
1669 FunctionRNA *func;
1670 PropertyRNA *parm;
1671
1672 RNA_def_property_srna(cprop, "BlendDataWorlds");
1673 srna = RNA_def_struct(brna, "BlendDataWorlds", nullptr);
1674 RNA_def_struct_sdna(srna, "Main");
1675 RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds");
1676
1677 func = RNA_def_function(srna, "new", "rna_Main_worlds_new");
1678 RNA_def_function_ui_description(func, "Add a new world to the main database");
1679 parm = RNA_def_string(func, "name", "World", 0, "", "New name for the data-block");
1681 /* return type */
1682 parm = RNA_def_pointer(func, "world", "World", "", "New world data-block");
1683 RNA_def_function_return(func, parm);
1684
1685 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1687 RNA_def_function_ui_description(func, "Remove a world from the current blendfile");
1688 parm = RNA_def_pointer(func, "world", "World", "", "World to remove");
1692 func, "do_unlink", true, "", "Unlink all usages of this world before deleting it");
1693 RNA_def_boolean(func,
1694 "do_id_user",
1695 true,
1696 "",
1697 "Decrement user counter of all data-blocks used by this world");
1699 func, "do_ui_user", true, "", "Make sure interface does not reference this world");
1700
1701 func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
1702 parm = RNA_def_boolean(func, "value", false, "Value", "");
1704}
1705
1707{
1708 StructRNA *srna;
1709 FunctionRNA *func;
1710 PropertyRNA *parm;
1711
1712 RNA_def_property_srna(cprop, "BlendDataCollections");
1713 srna = RNA_def_struct(brna, "BlendDataCollections", nullptr);
1714 RNA_def_struct_sdna(srna, "Main");
1715 RNA_def_struct_ui_text(srna, "Main Collections", "Collection of collections");
1716
1717 func = RNA_def_function(srna, "new", "rna_Main_collections_new");
1718 RNA_def_function_ui_description(func, "Add a new collection to the main database");
1719 parm = RNA_def_string(func, "name", "Collection", 0, "", "New name for the data-block");
1721 /* return type */
1722 parm = RNA_def_pointer(func, "collection", "Collection", "", "New collection data-block");
1723 RNA_def_function_return(func, parm);
1724
1725 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1726 RNA_def_function_ui_description(func, "Remove a collection from the current blendfile");
1728 parm = RNA_def_pointer(func, "collection", "Collection", "", "Collection to remove");
1732 func, "do_unlink", true, "", "Unlink all usages of this collection before deleting it");
1733 RNA_def_boolean(func,
1734 "do_id_user",
1735 true,
1736 "",
1737 "Decrement user counter of all data-blocks used by this collection");
1739 func, "do_ui_user", true, "", "Make sure interface does not reference this collection");
1740
1741 func = RNA_def_function(srna, "tag", "rna_Main_collections_tag");
1742 parm = RNA_def_boolean(func, "value", false, "Value", "");
1744}
1745
1747{
1748 StructRNA *srna;
1749 FunctionRNA *func;
1750 PropertyRNA *parm;
1751
1752 RNA_def_property_srna(cprop, "BlendDataSpeakers");
1753 srna = RNA_def_struct(brna, "BlendDataSpeakers", nullptr);
1754 RNA_def_struct_sdna(srna, "Main");
1755 RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers");
1756
1757 func = RNA_def_function(srna, "new", "rna_Main_speakers_new");
1758 RNA_def_function_ui_description(func, "Add a new speaker to the main database");
1759 parm = RNA_def_string(func, "name", "Speaker", 0, "", "New name for the data-block");
1761 /* return type */
1762 parm = RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker data-block");
1763 RNA_def_function_return(func, parm);
1764
1765 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1767 RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
1768 parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
1771 RNA_def_boolean(func,
1772 "do_unlink",
1773 true,
1774 "",
1775 "Unlink all usages of this speaker before deleting it "
1776 "(WARNING: will also delete objects instancing that speaker data)");
1777 RNA_def_boolean(func,
1778 "do_id_user",
1779 true,
1780 "",
1781 "Decrement user counter of all data-blocks used by this speaker data");
1783 func, "do_ui_user", true, "", "Make sure interface does not reference this speaker data");
1784
1785 func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
1786 parm = RNA_def_boolean(func, "value", false, "Value", "");
1788}
1789
1791{
1792 StructRNA *srna;
1793 FunctionRNA *func;
1794 PropertyRNA *parm;
1795
1796 RNA_def_property_srna(cprop, "BlendDataTexts");
1797 srna = RNA_def_struct(brna, "BlendDataTexts", nullptr);
1798 RNA_def_struct_sdna(srna, "Main");
1799 RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
1800
1801 func = RNA_def_function(srna, "new", "rna_Main_texts_new");
1802 RNA_def_function_ui_description(func, "Add a new text to the main database");
1803 parm = RNA_def_string(func, "name", "Text", 0, "", "New name for the data-block");
1805 /* return type */
1806 parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1807 RNA_def_function_return(func, parm);
1808
1809 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1810 RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
1812 parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove");
1816 func, "do_unlink", true, "", "Unlink all usages of this text before deleting it");
1818 func, "do_id_user", true, "", "Decrement user counter of all data-blocks used by this text");
1820 func, "do_ui_user", true, "", "Make sure interface does not reference this text");
1821
1822 /* load func */
1823 func = RNA_def_function(srna, "load", "rna_Main_texts_load");
1825 RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
1827 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1829 parm = RNA_def_boolean(
1830 func, "internal", false, "Make internal", "Make text file internal after loading");
1831 /* return type */
1832 parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1833 RNA_def_function_return(func, parm);
1834
1835 func = RNA_def_function(srna, "tag", "rna_Main_texts_tag");
1836 parm = RNA_def_boolean(func, "value", false, "Value", "");
1838}
1839
1841{
1842 StructRNA *srna;
1843 FunctionRNA *func;
1844 PropertyRNA *parm;
1845
1846 RNA_def_property_srna(cprop, "BlendDataSounds");
1847 srna = RNA_def_struct(brna, "BlendDataSounds", nullptr);
1848 RNA_def_struct_sdna(srna, "Main");
1849 RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
1850
1851 /* load func */
1852 func = RNA_def_function(srna, "load", "rna_Main_sounds_load");
1853 RNA_def_function_ui_description(func, "Add a new sound to the main database from a file");
1855 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1857 RNA_def_boolean(func,
1858 "check_existing",
1859 false,
1860 "",
1861 "Using existing data-block if this file is already loaded");
1862 /* return type */
1863 parm = RNA_def_pointer(func, "sound", "Sound", "", "New text data-block");
1864 RNA_def_function_return(func, parm);
1865
1866 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1868 RNA_def_function_ui_description(func, "Remove a sound from the current blendfile");
1869 parm = RNA_def_pointer(func, "sound", "Sound", "", "Sound to remove");
1873 func, "do_unlink", true, "", "Unlink all usages of this sound before deleting it");
1874 RNA_def_boolean(func,
1875 "do_id_user",
1876 true,
1877 "",
1878 "Decrement user counter of all data-blocks used by this sound");
1880 func, "do_ui_user", true, "", "Make sure interface does not reference this sound");
1881
1882 func = RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
1883 parm = RNA_def_boolean(func, "value", false, "Value", "");
1885}
1886
1888{
1889 StructRNA *srna;
1890 FunctionRNA *func;
1891 PropertyRNA *parm;
1892
1893 RNA_def_property_srna(cprop, "BlendDataArmatures");
1894 srna = RNA_def_struct(brna, "BlendDataArmatures", nullptr);
1895 RNA_def_struct_sdna(srna, "Main");
1896 RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
1897
1898 func = RNA_def_function(srna, "new", "rna_Main_armatures_new");
1899 RNA_def_function_ui_description(func, "Add a new armature to the main database");
1900 parm = RNA_def_string(func, "name", "Armature", 0, "", "New name for the data-block");
1902 /* return type */
1903 parm = RNA_def_pointer(func, "armature", "Armature", "", "New armature data-block");
1904 RNA_def_function_return(func, parm);
1905
1906 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1908 RNA_def_function_ui_description(func, "Remove an armature from the current blendfile");
1909 parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
1912 RNA_def_boolean(func,
1913 "do_unlink",
1914 true,
1915 "",
1916 "Unlink all usages of this armature before deleting it "
1917 "(WARNING: will also delete objects instancing that armature data)");
1918 RNA_def_boolean(func,
1919 "do_id_user",
1920 true,
1921 "",
1922 "Decrement user counter of all data-blocks used by this armature data");
1924 func, "do_ui_user", true, "", "Make sure interface does not reference this armature data");
1925
1926 func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
1927 parm = RNA_def_boolean(func, "value", false, "Value", "");
1929}
1931{
1932 StructRNA *srna;
1933 FunctionRNA *func;
1934 PropertyRNA *parm;
1935
1936 RNA_def_property_srna(cprop, "BlendDataActions");
1937 srna = RNA_def_struct(brna, "BlendDataActions", nullptr);
1938 RNA_def_struct_sdna(srna, "Main");
1939 RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
1940
1941 func = RNA_def_function(srna, "new", "rna_Main_actions_new");
1942 RNA_def_function_ui_description(func, "Add a new action to the main database");
1943 parm = RNA_def_string(func, "name", "Action", 0, "", "New name for the data-block");
1945 /* return type */
1946 parm = RNA_def_pointer(func, "action", "Action", "", "New action data-block");
1947 RNA_def_function_return(func, parm);
1948
1949 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1951 RNA_def_function_ui_description(func, "Remove an action from the current blendfile");
1952 parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove");
1956 func, "do_unlink", true, "", "Unlink all usages of this action before deleting it");
1957 RNA_def_boolean(func,
1958 "do_id_user",
1959 true,
1960 "",
1961 "Decrement user counter of all data-blocks used by this action");
1963 func, "do_ui_user", true, "", "Make sure interface does not reference this action");
1964
1965 func = RNA_def_function(srna, "tag", "rna_Main_actions_tag");
1966 parm = RNA_def_boolean(func, "value", false, "Value", "");
1968}
1969
1971{
1972 StructRNA *srna;
1973 FunctionRNA *func;
1974 PropertyRNA *parm;
1975
1976 RNA_def_property_srna(cprop, "BlendDataParticles");
1977 srna = RNA_def_struct(brna, "BlendDataParticles", nullptr);
1978 RNA_def_struct_sdna(srna, "Main");
1979 RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
1980
1981 func = RNA_def_function(srna, "new", "rna_Main_particles_new");
1983 "Add a new particle settings instance to the main database");
1984 parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the data-block");
1986 /* return type */
1987 parm = RNA_def_pointer(
1988 func, "particle", "ParticleSettings", "", "New particle settings data-block");
1989 RNA_def_function_return(func, parm);
1990
1991 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1994 func, "Remove a particle settings instance from the current blendfile");
1995 parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
1998 RNA_def_boolean(func,
1999 "do_unlink",
2000 true,
2001 "",
2002 "Unlink all usages of those particle settings before deleting them");
2003 RNA_def_boolean(func,
2004 "do_id_user",
2005 true,
2006 "",
2007 "Decrement user counter of all data-blocks used by this particle settings");
2008 RNA_def_boolean(func,
2009 "do_ui_user",
2010 true,
2011 "",
2012 "Make sure interface does not reference this particle settings");
2013
2014 func = RNA_def_function(srna, "tag", "rna_Main_particles_tag");
2015 parm = RNA_def_boolean(func, "value", false, "Value", "");
2017}
2018
2020{
2021 StructRNA *srna;
2022 FunctionRNA *func;
2023 PropertyRNA *parm;
2024
2025 RNA_def_property_srna(cprop, "BlendDataPalettes");
2026 srna = RNA_def_struct(brna, "BlendDataPalettes", nullptr);
2027 RNA_def_struct_sdna(srna, "Main");
2028 RNA_def_struct_ui_text(srna, "Main Palettes", "Collection of palettes");
2029
2030 func = RNA_def_function(srna, "new", "rna_Main_palettes_new");
2031 RNA_def_function_ui_description(func, "Add a new palette to the main database");
2032 parm = RNA_def_string(func, "name", "Palette", 0, "", "New name for the data-block");
2034 /* return type */
2035 parm = RNA_def_pointer(func, "palette", "Palette", "", "New palette data-block");
2036 RNA_def_function_return(func, parm);
2037
2038 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2040 RNA_def_function_ui_description(func, "Remove a palette from the current blendfile");
2041 parm = RNA_def_pointer(func, "palette", "Palette", "", "Palette to remove");
2045 func, "do_unlink", true, "", "Unlink all usages of this palette before deleting it");
2046 RNA_def_boolean(func,
2047 "do_id_user",
2048 true,
2049 "",
2050 "Decrement user counter of all data-blocks used by this palette");
2052 func, "do_ui_user", true, "", "Make sure interface does not reference this palette");
2053
2054 func = RNA_def_function(srna, "tag", "rna_Main_palettes_tag");
2055 parm = RNA_def_boolean(func, "value", false, "Value", "");
2057}
2059{
2060 StructRNA *srna;
2061 FunctionRNA *func;
2062 PropertyRNA *parm;
2063
2064 RNA_def_property_srna(cprop, "BlendDataCacheFiles");
2065 srna = RNA_def_struct(brna, "BlendDataCacheFiles", nullptr);
2066 RNA_def_struct_sdna(srna, "Main");
2067 RNA_def_struct_ui_text(srna, "Main Cache Files", "Collection of cache files");
2068
2069 func = RNA_def_function(srna, "tag", "rna_Main_cachefiles_tag");
2070 parm = RNA_def_boolean(func, "value", false, "Value", "");
2072}
2074{
2075 StructRNA *srna;
2076 FunctionRNA *func;
2077 PropertyRNA *parm;
2078
2079 RNA_def_property_srna(cprop, "BlendDataPaintCurves");
2080 srna = RNA_def_struct(brna, "BlendDataPaintCurves", nullptr);
2081 RNA_def_struct_sdna(srna, "Main");
2082 RNA_def_struct_ui_text(srna, "Main Paint Curves", "Collection of paint curves");
2083
2084 func = RNA_def_function(srna, "tag", "rna_Main_paintcurves_tag");
2085 parm = RNA_def_boolean(func, "value", false, "Value", "");
2087}
2089{
2090 StructRNA *srna;
2091 FunctionRNA *func;
2092 PropertyRNA *parm;
2093
2094 RNA_def_property_srna(cprop, "BlendDataAnnotations");
2095 srna = RNA_def_struct(brna, "BlendDataAnnotations", nullptr);
2096 RNA_def_struct_sdna(srna, "Main");
2097 RNA_def_struct_ui_text(srna, "Main Annotations", "Collection of annotations");
2098
2099 func = RNA_def_function(srna, "tag", "rna_Main_gpencils_tag");
2100 parm = RNA_def_boolean(func, "value", false, "Value", "");
2102
2103 func = RNA_def_function(srna, "new", "rna_Main_annotations_new");
2104 RNA_def_function_ui_description(func, "Add a new annotation data-block to the main database");
2105 parm = RNA_def_string(func, "name", "Annotation", 0, "", "New name for the data-block");
2107 /* return type */
2108 parm = RNA_def_pointer(func, "annotation", "Annotation", "", "New annotation data-block");
2109 RNA_def_function_return(func, parm);
2110
2111 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2113 RNA_def_function_ui_description(func, "Remove annotation instance from the current blendfile");
2114 parm = RNA_def_pointer(func, "annotation", "Annotation", "", "Grease Pencil to remove");
2118 func, "do_unlink", true, "", "Unlink all usages of this annotation before deleting it");
2119 RNA_def_boolean(func,
2120 "do_id_user",
2121 true,
2122 "",
2123 "Decrement user counter of all data-blocks used by this annotation");
2125 func, "do_ui_user", true, "", "Make sure interface does not reference this annotation");
2126}
2127
2129{
2130 StructRNA *srna;
2131 FunctionRNA *func;
2132 PropertyRNA *parm;
2133
2134 RNA_def_property_srna(cprop, "BlendDataGreasePencilsV3");
2135 srna = RNA_def_struct(brna, "BlendDataGreasePencilsV3", nullptr);
2136 RNA_def_struct_sdna(srna, "Main");
2137 RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of Grease Pencils");
2138
2139 func = RNA_def_function(srna, "tag", "rna_Main_grease_pencils_tag");
2140 parm = RNA_def_boolean(func, "value", false, "Value", "");
2142
2143 func = RNA_def_function(srna, "new", "rna_Main_grease_pencils_new");
2144 RNA_def_function_ui_description(func, "Add a new Grease Pencil data-block to the main database");
2145 parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the data-block");
2147 /* return type */
2148 parm = RNA_def_pointer(
2149 func, "grease_pencil", "GreasePencil", "", "New Grease Pencil data-block");
2150 RNA_def_function_return(func, parm);
2151
2152 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2155 "Remove a Grease Pencil instance from the current blendfile");
2156 parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "Grease Pencil to remove");
2160 func, "do_unlink", true, "", "Unlink all usages of this Grease Pencil before deleting it");
2161 RNA_def_boolean(func,
2162 "do_id_user",
2163 true,
2164 "",
2165 "Decrement user counter of all data-blocks used by this Grease Pencil");
2167 func, "do_ui_user", true, "", "Make sure interface does not reference this Grease Pencil");
2168}
2169
2171{
2172 StructRNA *srna;
2173 FunctionRNA *func;
2174 PropertyRNA *parm;
2175
2176 RNA_def_property_srna(cprop, "BlendDataMovieClips");
2177 srna = RNA_def_struct(brna, "BlendDataMovieClips", nullptr);
2178 RNA_def_struct_sdna(srna, "Main");
2179 RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips");
2180
2181 func = RNA_def_function(srna, "tag", "rna_Main_movieclips_tag");
2182 parm = RNA_def_boolean(func, "value", false, "Value", "");
2184
2185 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2187 RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile.");
2188 parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
2192 func, "do_unlink", true, "", "Unlink all usages of this movie clip before deleting it");
2193 RNA_def_boolean(func,
2194 "do_id_user",
2195 true,
2196 "",
2197 "Decrement user counter of all data-blocks used by this movie clip");
2199 func, "do_ui_user", true, "", "Make sure interface does not reference this movie clip");
2200
2201 /* load func */
2202 func = RNA_def_function(srna, "load", "rna_Main_movieclip_load");
2205 func,
2206 "Add a new movie clip to the main database from a file "
2207 "(while ``check_existing`` is disabled for consistency with other load functions, "
2208 "behavior with multiple movie-clips using the same file may incorrectly generate proxies)");
2210 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
2212 RNA_def_boolean(func,
2213 "check_existing",
2214 false,
2215 "",
2216 "Using existing data-block if this file is already loaded");
2217 /* return type */
2218 parm = RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip data-block");
2219 RNA_def_function_return(func, parm);
2220}
2221
2223{
2224 StructRNA *srna;
2225 FunctionRNA *func;
2226 PropertyRNA *parm;
2227
2228 RNA_def_property_srna(cprop, "BlendDataMasks");
2229 srna = RNA_def_struct(brna, "BlendDataMasks", nullptr);
2230 RNA_def_struct_sdna(srna, "Main");
2231 RNA_def_struct_ui_text(srna, "Main Masks", "Collection of masks");
2232
2233 func = RNA_def_function(srna, "tag", "rna_Main_masks_tag");
2234 parm = RNA_def_boolean(func, "value", false, "Value", "");
2236
2237 /* new func */
2238 func = RNA_def_function(srna, "new", "rna_Main_mask_new");
2239 RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database");
2240 parm = RNA_def_string(
2241 func, "name", nullptr, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
2243 /* return type */
2244 parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask data-block");
2245 RNA_def_function_return(func, parm);
2246
2247 /* remove func */
2248 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2250 RNA_def_function_ui_description(func, "Remove a mask from the current blendfile");
2251 parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to remove");
2255 func, "do_unlink", true, "", "Unlink all usages of this mask before deleting it");
2257 func, "do_id_user", true, "", "Decrement user counter of all data-blocks used by this mask");
2259 func, "do_ui_user", true, "", "Make sure interface does not reference this mask");
2260}
2261
2263{
2264 StructRNA *srna;
2265 FunctionRNA *func;
2266 PropertyRNA *parm;
2267
2268 RNA_def_property_srna(cprop, "BlendDataLineStyles");
2269 srna = RNA_def_struct(brna, "BlendDataLineStyles", nullptr);
2270 RNA_def_struct_sdna(srna, "Main");
2271 RNA_def_struct_ui_text(srna, "Main Line Styles", "Collection of line styles");
2272
2273 func = RNA_def_function(srna, "tag", "rna_Main_linestyle_tag");
2274 parm = RNA_def_boolean(func, "value", false, "Value", "");
2276
2277 func = RNA_def_function(srna, "new", "rna_Main_linestyles_new");
2278 RNA_def_function_ui_description(func, "Add a new line style instance to the main database");
2279 parm = RNA_def_string(func, "name", "FreestyleLineStyle", 0, "", "New name for the data-block");
2281 /* return type */
2282 parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "New line style data-block");
2283 RNA_def_function_return(func, parm);
2284
2285 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2287 RNA_def_function_ui_description(func, "Remove a line style instance from the current blendfile");
2288 parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "Line style to remove");
2292 func, "do_unlink", true, "", "Unlink all usages of this line style before deleting it");
2293 RNA_def_boolean(func,
2294 "do_id_user",
2295 true,
2296 "",
2297 "Decrement user counter of all data-blocks used by this line style");
2299 func, "do_ui_user", true, "", "Make sure interface does not reference this line style");
2300}
2301
2303{
2304 StructRNA *srna;
2305 FunctionRNA *func;
2306 PropertyRNA *parm;
2307
2308 RNA_def_property_srna(cprop, "BlendDataWorkSpaces");
2309 srna = RNA_def_struct(brna, "BlendDataWorkSpaces", nullptr);
2310 RNA_def_struct_sdna(srna, "Main");
2311 RNA_def_struct_ui_text(srna, "Main Workspaces", "Collection of workspaces");
2312
2313 func = RNA_def_function(srna, "tag", "rna_Main_workspaces_tag");
2314 parm = RNA_def_boolean(func, "value", false, "Value", "");
2316}
2317
2319{
2320 StructRNA *srna;
2321 FunctionRNA *func;
2322 PropertyRNA *parm;
2323
2324 RNA_def_property_srna(cprop, "BlendDataProbes");
2325 srna = RNA_def_struct(brna, "BlendDataProbes", nullptr);
2326 RNA_def_struct_sdna(srna, "Main");
2327 RNA_def_struct_ui_text(srna, "Main Light Probes", "Collection of light probes");
2328
2329 func = RNA_def_function(srna, "new", "rna_Main_lightprobe_new");
2330 RNA_def_function_ui_description(func, "Add a new light probe to the main database");
2331 parm = RNA_def_string(func, "name", "Probe", 0, "", "New name for the data-block");
2333 parm = RNA_def_enum(
2334 func, "type", rna_enum_lightprobes_type_items, 0, "Type", "The type of light probe to add");
2336 /* return type */
2337 parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "New light probe data-block");
2338 RNA_def_function_return(func, parm);
2339
2340 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2342 RNA_def_function_ui_description(func, "Remove a light probe from the current blendfile");
2343 parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "Light probe to remove");
2346 RNA_def_boolean(func,
2347 "do_unlink",
2348 true,
2349 "",
2350 "Unlink all usages of this light probe before deleting it "
2351 "(WARNING: will also delete objects instancing that light probe data)");
2352 RNA_def_boolean(func,
2353 "do_id_user",
2354 true,
2355 "",
2356 "Decrement user counter of all data-blocks used by this light probe");
2358 func, "do_ui_user", true, "", "Make sure interface does not reference this light probe");
2359
2360 func = RNA_def_function(srna, "tag", "rna_Main_lightprobes_tag");
2361 parm = RNA_def_boolean(func, "value", false, "Value", "");
2363}
2364
2366{
2367 StructRNA *srna;
2368 FunctionRNA *func;
2369 PropertyRNA *parm;
2370
2371 RNA_def_property_srna(cprop, "BlendDataHairCurves");
2372 srna = RNA_def_struct(brna, "BlendDataHairCurves", nullptr);
2373 RNA_def_struct_sdna(srna, "Main");
2374 RNA_def_struct_ui_text(srna, "Main Hair Curves", "Collection of hair curves");
2375
2376 func = RNA_def_function(srna, "new", "rna_Main_hair_curves_new");
2377 RNA_def_function_ui_description(func, "Add a new hair to the main database");
2378 parm = RNA_def_string(func, "name", "Curves", 0, "", "New name for the data-block");
2380 /* return type */
2381 parm = RNA_def_pointer(func, "curves", "Curves", "", "New curves data-block");
2382 RNA_def_function_return(func, parm);
2383
2384 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2386 RNA_def_function_ui_description(func, "Remove a curves data-block from the current blendfile");
2387 parm = RNA_def_pointer(func, "curves", "Curves", "", "Curves data-block to remove");
2390 RNA_def_boolean(func,
2391 "do_unlink",
2392 true,
2393 "",
2394 "Unlink all usages of this curves before deleting it "
2395 "(WARNING: will also delete objects instancing that curves data)");
2396 RNA_def_boolean(func,
2397 "do_id_user",
2398 true,
2399 "",
2400 "Decrement user counter of all data-blocks used by this curves data");
2402 func, "do_ui_user", true, "", "Make sure interface does not reference this curves data");
2403
2404 func = RNA_def_function(srna, "tag", "rna_Main_hair_curves_tag");
2405 parm = RNA_def_boolean(func, "value", false, "Value", "");
2407}
2408
2410{
2411 StructRNA *srna;
2412 FunctionRNA *func;
2413 PropertyRNA *parm;
2414
2415 RNA_def_property_srna(cprop, "BlendDataPointClouds");
2416 srna = RNA_def_struct(brna, "BlendDataPointClouds", nullptr);
2417 RNA_def_struct_sdna(srna, "Main");
2418 RNA_def_struct_ui_text(srna, "Main Point Clouds", "Collection of point clouds");
2419
2420 func = RNA_def_function(srna, "new", "rna_Main_pointclouds_new");
2421 RNA_def_function_ui_description(func, "Add a new point cloud to the main database");
2422 parm = RNA_def_string(func, "name", "PointCloud", 0, "", "New name for the data-block");
2424 /* return type */
2425 parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "New point cloud data-block");
2426 RNA_def_function_return(func, parm);
2427
2428 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2430 RNA_def_function_ui_description(func, "Remove a point cloud from the current blendfile");
2431 parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "Point cloud to remove");
2434 RNA_def_boolean(func,
2435 "do_unlink",
2436 true,
2437 "",
2438 "Unlink all usages of this point cloud before deleting it "
2439 "(WARNING: will also delete objects instancing that point cloud data)");
2440 RNA_def_boolean(func,
2441 "do_id_user",
2442 true,
2443 "",
2444 "Decrement user counter of all data-blocks used by this point cloud data");
2445 RNA_def_boolean(func,
2446 "do_ui_user",
2447 true,
2448 "",
2449 "Make sure interface does not reference this point cloud data");
2450
2451 func = RNA_def_function(srna, "tag", "rna_Main_pointclouds_tag");
2452 parm = RNA_def_boolean(func, "value", false, "Value", "");
2454}
2455
2457{
2458 StructRNA *srna;
2459 FunctionRNA *func;
2460 PropertyRNA *parm;
2461
2462 RNA_def_property_srna(cprop, "BlendDataVolumes");
2463 srna = RNA_def_struct(brna, "BlendDataVolumes", nullptr);
2464 RNA_def_struct_sdna(srna, "Main");
2465 RNA_def_struct_ui_text(srna, "Main Volumes", "Collection of volumes");
2466
2467 func = RNA_def_function(srna, "new", "rna_Main_volumes_new");
2468 RNA_def_function_ui_description(func, "Add a new volume to the main database");
2469 parm = RNA_def_string(func, "name", "Volume", 0, "", "New name for the data-block");
2471 /* return type */
2472 parm = RNA_def_pointer(func, "volume", "Volume", "", "New volume data-block");
2473 RNA_def_function_return(func, parm);
2474
2475 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2477 RNA_def_function_ui_description(func, "Remove a volume from the current blendfile");
2478 parm = RNA_def_pointer(func, "volume", "Volume", "", "Volume to remove");
2481 RNA_def_boolean(func,
2482 "do_unlink",
2483 true,
2484 "",
2485 "Unlink all usages of this volume before deleting it "
2486 "(WARNING: will also delete objects instancing that volume data)");
2487 RNA_def_boolean(func,
2488 "do_id_user",
2489 true,
2490 "",
2491 "Decrement user counter of all data-blocks used by this volume data");
2493 func, "do_ui_user", true, "", "Make sure interface does not reference this volume data");
2494
2495 func = RNA_def_function(srna, "tag", "rna_Main_volumes_tag");
2496 parm = RNA_def_boolean(func, "value", false, "Value", "");
2498}
2499
2500#endif
Blender kernel action and pose functionality.
bAction * BKE_action_add(Main *bmain, const char name[])
bArmature * BKE_armature_add(Main *bmain, const char *name)
Brush * BKE_brush_add(Main *bmain, const char *name, eObjectMode ob_mode)
Definition brush.cc:627
void BKE_brush_init_gpencil_settings(Brush *brush)
Definition brush.cc:648
Camera data-block and utility functions.
struct Camera * BKE_camera_add(struct Main *bmain, const char *name)
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
void CTX_data_scene_set(bContext *C, Scene *scene)
Scene * CTX_data_scene(const bContext *C)
Curve * BKE_curve_add(Main *bmain, const char *name, int type)
Definition curve.cc:407
Low-level operations for curves that cannot be defined in the C++ header yet.
struct Curves * BKE_curves_add(struct Main *bmain, const char *name)
display list (or rather multi purpose list) stuff.
struct bGPdata * BKE_gpencil_data_addnew(struct Main *bmain, const char name[])
Low-level operations for grease pencil.
GreasePencil * BKE_grease_pencil_add(Main *bmain, const char *name)
const char * BKE_idtype_idcode_to_name(short idcode)
Definition idtype.cc:164
Image * BKE_image_load(Main *bmain, const char *filepath)
Image * BKE_image_load_exists(Main *bmain, const char *filepath, bool *r_exists=nullptr)
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)
Lattice * BKE_lattice_add(Main *bmain, const char *name)
Definition lattice.cc:387
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL()
void id_us_plus(ID *id)
Definition lib_id.cc:358
void BKE_main_id_newptr_and_tag_clear(Main *bmain)
Definition lib_id.cc:2001
void id_fake_user_clear(ID *id)
Definition lib_id.cc:404
void id_us_min(ID *id)
Definition lib_id.cc:366
@ LIB_ID_FREE_NO_UI_USER
@ LIB_ID_FREE_NO_USER_REFCOUNT
void BKE_id_free_ex(Main *bmain, void *idv, int flag_orig, bool use_flag_from_idtag)
General operations, lookup, etc. for blender lights.
Light * BKE_light_add(Main *bmain, const char *name) ATTR_WARN_UNUSED_RESULT
General operations for probes.
struct LightProbe * BKE_lightprobe_add(struct Main *bmain, const char *name)
void BKE_lightprobe_type_set(struct LightProbe *probe, short lightprobe_type)
Definition lightprobe.cc:83
Blender kernel freestyle line style functionality.
FreestyleLineStyle * BKE_linestyle_new(struct Main *bmain, const char *name)
Definition linestyle.cc:703
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
Definition main.cc:887
void BKE_main_ensure_invariants(Main &bmain, std::optional< blender::Span< ID * > > modified_ids=std::nullopt)
struct Mask * BKE_mask_new(struct Main *bmain, const char *name)
General operations, lookup, etc. for materials.
void BKE_gpencil_material_attr_init(Material *ma)
void BKE_object_materials_sync_length(Main *bmain, Object *ob, ID *id)
Material * BKE_material_add(Main *bmain, const char *name)
MetaBall * BKE_mball_add(Main *bmain, const char *name)
Definition mball.cc:173
Mesh * BKE_mesh_add(Main *bmain, const char *name)
Mesh * BKE_mesh_new_from_object_to_bmain(Main *bmain, Depsgraph *depsgraph, Object *object, bool preserve_all_data_layers)
struct MovieClip * BKE_movieclip_file_add(struct Main *bmain, const char *filepath)
Definition movieclip.cc:955
struct MovieClip * BKE_movieclip_file_add_exists(struct Main *bmain, const char *filepath)
General operations, lookup, etc. for blender objects.
Object * BKE_object_add_only_object(Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
int BKE_object_obdata_to_type(const ID *id) ATTR_NONNULL(1)
Palette * BKE_palette_add(Main *bmain, const char *name)
Definition paint.cc:1427
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
Definition particle.cc:4088
General operations for point clouds.
PointCloud * BKE_pointcloud_add(Main *bmain, const char *name)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
@ RPT_ERROR
Definition BKE_report.hh:39
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:153
bool BKE_scene_can_be_removed(const Main *bmain, const Scene *scene)
Definition scene.cc:1986
Scene * BKE_scene_add(Main *bmain, const char *name)
Definition scene.cc:2001
struct bSound * BKE_sound_new_file(struct Main *bmain, const char *filepath)
struct bSound * BKE_sound_new_file_exists(struct Main *bmain, const char *filepath)
General operations for speakers.
struct Speaker * BKE_speaker_add(struct Main *bmain, const char *name)
Definition speaker.cc:82
struct Text * BKE_text_add(struct Main *bmain, const char *name)
Definition text.cc:281
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.cc:363
struct Tex * BKE_texture_add(struct Main *bmain, const char *name)
Definition texture.cc:370
VFont * BKE_vfont_load(Main *bmain, const char *filepath)
Definition vfont.cc:303
VFont * BKE_vfont_load_exists(Main *bmain, const char *filepath)
Definition vfont.cc:381
Volume data-block.
Volume * BKE_volume_add(Main *bmain, const char *name)
struct World * BKE_world_add(struct Main *bmain, const char *name)
#define LISTBASE_FOREACH(type, var, list)
#define FILE_MAX
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
int BLI_str_utf8_invalid_strip(char *str, size_t str_len) ATTR_NONNULL(1)
#define RPT_(msgid)
#define BPy_BEGIN_ALLOW_THREADS
Definition BPY_extern.hh:52
#define BPy_END_ALLOW_THREADS
Definition BPY_extern.hh:56
void DEG_relations_tag_update(Main *bmain)
ID and Library types, which are fundamental for SDNA.
#define ID_IS_PACKED(_id)
Definition DNA_ID.h:700
@ ID_TAG_NO_MAIN
Definition DNA_ID.h:978
#define ID_IS_LINKED(_id)
Definition DNA_ID.h:694
#define MAX_ID_NAME
Definition DNA_ID.h:373
#define ID_REAL_USERS(id)
Definition DNA_ID.h:676
@ ID_WM
@ ID_CA
@ ID_AR
@ ID_MC
@ ID_CF
@ ID_LI
@ ID_TE
@ ID_IM
@ ID_VO
@ ID_WS
@ ID_NT
@ ID_LA
@ ID_TXT
@ ID_SO
@ ID_SCE
@ ID_LS
@ ID_MSK
@ ID_CV
@ ID_PAL
@ ID_BR
@ ID_LP
@ ID_WO
@ ID_MA
@ ID_AC
@ ID_SCR
@ ID_CU_LEGACY
@ ID_GD_LEGACY
@ ID_VF
@ ID_ME
@ ID_GR
@ ID_SPK
@ ID_MB
@ ID_LT
@ ID_OB
@ ID_GP
@ ID_PA
@ ID_PT
@ ID_PC
Object groups, one object can be in many groups at once.
eObjectMode
@ OB_MODE_TEXTURE_PAINT
@ OB_MBALL
@ OB_EMPTY
@ OB_SURF
@ OB_FONT
@ OB_MESH
@ OB_CURVES_LEGACY
void ED_node_shader_default(const bContext *C, Main *bmain, ID *id)
Definition node_edit.cc:513
wmOperatorStatus ED_screen_animation_play(bContext *C, int sync, int mode)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
#define MEM_SAFE_FREE(v)
blender::bke::bNodeTreeType * rna_node_tree_type_from_enum(int value)
const EnumPropertyItem * rna_node_tree_type_itemf(void *data, bool(*poll)(void *data, blender::bke::bNodeTreeType *), bool *r_free)
ParameterFlag
Definition RNA_types.hh:544
@ PARM_RNAPTR
Definition RNA_types.hh:547
@ PARM_REQUIRED
Definition RNA_types.hh:545
@ FUNC_USE_REPORTS
Definition RNA_types.hh:914
@ FUNC_USE_CONTEXT
Definition RNA_types.hh:913
PropertyFlag
Definition RNA_types.hh:300
@ PROP_THICK_WRAP
Definition RNA_types.hh:423
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:456
@ PROP_ENUM_NO_CONTEXT
Definition RNA_types.hh:430
@ PROP_NEVER_NULL
Definition RNA_types.hh:377
#define C
Definition RandGen.cpp:29
#define NC_WINDOW
Definition WM_types.hh:375
#define NC_ID
Definition WM_types.hh:395
#define NA_ADDED
Definition WM_types.hh:586
BMesh const char void * data
BPy_StructRNA * depsgraph
#define GS(x)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void pack_linked_id_hierarchy(Main &bmain, ID &root_id)
Definition library.cc:658
bNodeTree * node_tree_add_tree(Main *bmain, StringRef name, StringRef idname)
Definition node.cc:4085
const EnumPropertyItem rna_enum_light_type_items[]
const char * name
const EnumPropertyItem rna_enum_id_type_items[]
Definition rna_ID.cc:29
bool RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **r_identifier)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
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 RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
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)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
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_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
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)
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_grease_pencil(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_def_main_lights(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_palettes(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_api_main(StructRNA *srna)
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_annotations(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)
void RNA_def_main_collections(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_workspaces(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_lightprobes_type_items[]
const EnumPropertyItem rna_enum_object_mode_items[]
Definition rna_object.cc:33
const EnumPropertyItem rna_enum_object_type_curve_items[]
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:32
const EnumPropertyItem rna_enum_texture_type_items[]
Definition DNA_ID.h:414
int tag
Definition DNA_ID.h:442
char name[258]
Definition DNA_ID.h:432
struct ID * newid
Definition DNA_ID.h:418
void * prev
Definition DNA_ID.h:417
void * next
Definition DNA_ID.h:417
short type
void * first
ListBase wm
Definition BKE_main.hh:307
struct MaterialGPencilStyle * gp_style
void invalidate()
Definition RNA_types.hh:110
void * data
Definition RNA_types.hh:53
void WM_main_add_notifier(uint type, void *reference)
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
Scene * WM_window_get_active_scene(const wmWindow *win)
uint8_t flag
Definition wm_window.cc:145