Blender V4.5
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
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_light.h"
38# include "BKE_lightprobe.h"
39# include "BKE_linestyle.h"
40# include "BKE_main_invariants.hh"
41# include "BKE_mask.h"
42# include "BKE_material.hh"
43# include "BKE_mball.hh"
44# include "BKE_mesh.hh"
45# include "BKE_movieclip.h"
46# include "BKE_node.hh"
47# include "BKE_object.hh"
48# include "BKE_paint.hh"
49# include "BKE_particle.h"
50# include "BKE_pointcloud.hh"
51# include "BKE_scene.hh"
52# include "BKE_sound.h"
53# include "BKE_speaker.h"
54# include "BKE_text.h"
55# include "BKE_texture.h"
56# include "BKE_vfont.hh"
57# include "BKE_volume.hh"
58# include "BKE_workspace.hh"
59# include "BKE_world.h"
60
61# include "DEG_depsgraph_build.hh"
62# include "DEG_depsgraph_query.hh"
63
64# include "DNA_anim_types.h"
65# include "DNA_armature_types.h"
66# include "DNA_brush_types.h"
67# include "DNA_camera_types.h"
68# include "DNA_collection_types.h"
69# include "DNA_curve_types.h"
70# include "DNA_curves_types.h"
72# include "DNA_lattice_types.h"
73# include "DNA_light_types.h"
74# include "DNA_lightprobe_types.h"
75# include "DNA_mask_types.h"
76# include "DNA_material_types.h"
77# include "DNA_mesh_types.h"
78# include "DNA_meta_types.h"
79# include "DNA_movieclip_types.h"
80# include "DNA_node_types.h"
81# include "DNA_particle_types.h"
82# include "DNA_pointcloud_types.h"
83# include "DNA_sound_types.h"
84# include "DNA_speaker_types.h"
85# include "DNA_text_types.h"
86# include "DNA_texture_types.h"
87# include "DNA_vfont_types.h"
88# include "DNA_volume_types.h"
89# include "DNA_world_types.h"
90
91# include "ED_node.hh"
92# include "ED_screen.hh"
93
94# include "BLT_translation.hh"
95
96# ifdef WITH_PYTHON
97# include "BPY_extern.hh"
98# endif
99
100# include "WM_api.hh"
101# include "WM_types.hh"
102
103static void rna_idname_validate(const char *name, char *r_name)
104{
105 BLI_strncpy(r_name, name, MAX_ID_NAME - 2);
106 BLI_str_utf8_invalid_strip(r_name, strlen(r_name));
107}
108
109static void rna_Main_ID_remove(Main *bmain,
110 ReportList *reports,
111 PointerRNA *id_ptr,
112 bool do_unlink,
113 bool do_id_user,
114 bool do_ui_user)
115{
116 ID *id = static_cast<ID *>(id_ptr->data);
117 if (id->tag & ID_TAG_NO_MAIN) {
118 BKE_reportf(reports,
119 RPT_ERROR,
120 "%s '%s' is outside of main database and cannot be removed from it",
122 id->name + 2);
123 return;
124 }
125 if (do_unlink) {
126 BKE_id_delete(bmain, id);
127 id_ptr->invalidate();
128 /* Force full redraw, mandatory to avoid crashes when running this from UI... */
130 }
131 else if (ID_REAL_USERS(id) <= 0) {
132 const int flag = (do_id_user ? 0 : LIB_ID_FREE_NO_USER_REFCOUNT) |
133 (do_ui_user ? 0 : LIB_ID_FREE_NO_UI_USER);
134 /* Still using ID flags here, this is in-between commit anyway... */
135 BKE_id_free_ex(bmain, id, flag, true);
136 id_ptr->invalidate();
137 }
138 else {
140 reports,
141 RPT_ERROR,
142 "%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)",
144 id->name + 2,
145 ID_REAL_USERS(id));
146 }
147}
148
149static Camera *rna_Main_cameras_new(Main *bmain, const char *name)
150{
151 char safe_name[MAX_ID_NAME - 2];
152 rna_idname_validate(name, safe_name);
153
154 Camera *camera = BKE_camera_add(bmain, safe_name);
155 id_us_min(&camera->id);
156
158
159 return camera;
160}
161
162static Scene *rna_Main_scenes_new(Main *bmain, const char *name)
163{
164 char safe_name[MAX_ID_NAME - 2];
165 rna_idname_validate(name, safe_name);
166
167 Scene *scene = BKE_scene_add(bmain, safe_name);
168
170
171 return scene;
172}
173static void rna_Main_scenes_remove(
174 Main *bmain, bContext *C, ReportList *reports, PointerRNA *scene_ptr, bool do_unlink)
175{
176 /* don't call BKE_id_free(...) directly */
177 Scene *scene = static_cast<Scene *>(scene_ptr->data);
178
179 if (BKE_scene_can_be_removed(bmain, scene)) {
180 Scene *scene_new = static_cast<Scene *>(scene->id.prev ? scene->id.prev : scene->id.next);
181 if (do_unlink) {
182 /* Don't rely on `CTX_wm_window(C)` as it may have been cleared,
183 * yet windows may still be open that reference this scene. */
184 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
185 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
186 if (WM_window_get_active_scene(win) == scene) {
187# ifdef WITH_PYTHON
189# endif
190
191 WM_window_set_active_scene(bmain, C, win, scene_new);
192
193# ifdef WITH_PYTHON
195# endif
196 }
197 }
198 if (CTX_data_scene(C) == scene) {
199# ifdef WITH_PYTHON
201# endif
202
203 CTX_data_scene_set(C, scene_new);
204
205# ifdef WITH_PYTHON
207# endif
208 }
209 }
210 rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink, true, true);
211 }
212 else {
213 BKE_reportf(reports,
214 RPT_ERROR,
215 "Scene '%s' is the last local one, cannot be removed",
216 scene->id.name + 2);
217 }
218}
219
220static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data)
221{
222 if (data != nullptr && (data->tag & ID_TAG_NO_MAIN)) {
223 BKE_report(reports,
224 RPT_ERROR,
225 "Cannot create object in main database with an evaluated data data-block");
226 return nullptr;
227 }
228
229 char safe_name[MAX_ID_NAME - 2];
230 rna_idname_validate(name, safe_name);
231
232 Object *ob;
233 int type = OB_EMPTY;
234
235 if (data) {
237 if (type == -1) {
238 const char *idname;
239 if (RNA_enum_id_from_value(rna_enum_id_type_items, GS(data->name), &idname) == 0) {
240 idname = "UNKNOWN";
241 }
242
243 BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for an object", idname);
244 return nullptr;
245 }
246
248 }
249
250 ob = BKE_object_add_only_object(bmain, type, safe_name);
251
252 ob->data = data;
253 BKE_object_materials_sync_length(bmain, ob, static_cast<ID *>(ob->data));
254
256
257 return ob;
258}
259
260static Material *rna_Main_materials_new(Main *bmain, const char *name)
261{
262 char safe_name[MAX_ID_NAME - 2];
263 rna_idname_validate(name, safe_name);
264
265 ID *id = (ID *)BKE_material_add(bmain, safe_name);
266 id_us_min(id);
267
269
270 return (Material *)id;
271}
272
273static void rna_Main_materials_gpencil_data(Main * /*bmain*/, PointerRNA *id_ptr)
274{
275 ID *id = static_cast<ID *>(id_ptr->data);
276 Material *ma = (Material *)id;
278}
279
280static void rna_Main_materials_gpencil_remove(Main * /*bmain*/, PointerRNA *id_ptr)
281{
282 ID *id = static_cast<ID *>(id_ptr->data);
283 Material *ma = (Material *)id;
284 if (ma->gp_style) {
286 }
287}
288
289static const EnumPropertyItem *rna_Main_nodetree_type_itemf(bContext * /*C*/,
290 PointerRNA * /*ptr*/,
291 PropertyRNA * /*prop*/,
292 bool *r_free)
293{
294 return rna_node_tree_type_itemf(nullptr, nullptr, r_free);
295}
296static bNodeTree *rna_Main_nodetree_new(Main *bmain, const char *name, int type)
297{
298 char safe_name[MAX_ID_NAME - 2];
299 rna_idname_validate(name, safe_name);
300
302 if (typeinfo) {
303 bNodeTree *ntree = blender::bke::node_tree_add_tree(bmain, safe_name, typeinfo->idname);
305
306 id_us_min(&ntree->id);
307 return ntree;
308 }
309 else {
310 return nullptr;
311 }
312}
313
314static Mesh *rna_Main_meshes_new(Main *bmain, const char *name)
315{
316 char safe_name[MAX_ID_NAME - 2];
317 rna_idname_validate(name, safe_name);
318
319 Mesh *mesh = BKE_mesh_add(bmain, safe_name);
320 id_us_min(&mesh->id);
321
323
324 return mesh;
325}
326
327/* copied from Mesh_getFromObject and adapted to RNA interface */
328static Mesh *rna_Main_meshes_new_from_object(Main *bmain,
329 ReportList *reports,
330 Object *object,
331 bool preserve_all_data_layers,
332 Depsgraph *depsgraph)
333{
334 switch (object->type) {
335 case OB_FONT:
336 case OB_CURVES_LEGACY:
337 case OB_SURF:
338 case OB_MBALL:
339 case OB_MESH:
340 break;
341 default:
342 BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
343 return nullptr;
344 }
345
347 bmain, depsgraph, object, preserve_all_data_layers);
348
350
351 return mesh;
352}
353
354static Light *rna_Main_lights_new(Main *bmain, const char *name, int type)
355{
356 char safe_name[MAX_ID_NAME - 2];
357 rna_idname_validate(name, safe_name);
358
359 Light *lamp = BKE_light_add(bmain, safe_name);
360 lamp->type = type;
361 id_us_min(&lamp->id);
362
364
365 return lamp;
366}
367
368static Image *rna_Main_images_new(Main *bmain,
369 const char *name,
370 int width,
371 int height,
372 bool alpha,
373 bool float_buffer,
374 bool stereo3d,
375 bool is_data,
376 bool tiled)
377{
378 char safe_name[MAX_ID_NAME - 2];
379 rna_idname_validate(name, safe_name);
380
381 float color[4] = {0.0, 0.0, 0.0, 1.0};
382 Image *image = BKE_image_add_generated(bmain,
383 width,
384 height,
385 safe_name,
386 alpha ? 32 : 24,
387 float_buffer,
388 0,
389 color,
390 stereo3d,
391 is_data,
392 tiled);
393 id_us_min(&image->id);
394
396
397 return image;
398}
399static Image *rna_Main_images_load(Main *bmain,
400 ReportList *reports,
401 const char *filepath,
402 bool check_existing)
403{
404 Image *ima;
405
406 errno = 0;
407 if (check_existing) {
408 ima = BKE_image_load_exists(bmain, filepath);
409 }
410 else {
411 ima = BKE_image_load(bmain, filepath);
412 }
413
414 if (!ima) {
415 BKE_reportf(reports,
416 RPT_ERROR,
417 "Cannot read '%s': %s",
418 filepath,
419 errno ? strerror(errno) : RPT_("unsupported image format"));
420 }
421
422 id_us_min((ID *)ima);
423
425
426 return ima;
427}
428
429static Lattice *rna_Main_lattices_new(Main *bmain, const char *name)
430{
431 char safe_name[MAX_ID_NAME - 2];
432 rna_idname_validate(name, safe_name);
433
434 Lattice *lt = BKE_lattice_add(bmain, safe_name);
435 id_us_min(&lt->id);
436
438
439 return lt;
440}
441
442static Curve *rna_Main_curves_new(Main *bmain, const char *name, int type)
443{
444 char safe_name[MAX_ID_NAME - 2];
445 rna_idname_validate(name, safe_name);
446
447 Curve *cu = BKE_curve_add(bmain, safe_name, type);
448 id_us_min(&cu->id);
449
451
452 return cu;
453}
454
455static MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name)
456{
457 char safe_name[MAX_ID_NAME - 2];
458 rna_idname_validate(name, safe_name);
459
460 MetaBall *mb = BKE_mball_add(bmain, safe_name);
461 id_us_min(&mb->id);
462
464
465 return mb;
466}
467
468static VFont *rna_Main_fonts_load(Main *bmain,
469 ReportList *reports,
470 const char *filepath,
471 bool check_existing)
472{
473 VFont *font;
474 errno = 0;
475
476 if (check_existing) {
477 font = BKE_vfont_load_exists(bmain, filepath);
478 }
479 else {
480 font = BKE_vfont_load(bmain, filepath);
481 }
482
483 if (!font) {
484 BKE_reportf(reports,
485 RPT_ERROR,
486 "Cannot read '%s': %s",
487 filepath,
488 errno ? strerror(errno) : RPT_("unsupported font format"));
489 }
490
492
493 return font;
494}
495
496static Tex *rna_Main_textures_new(Main *bmain, const char *name, int type)
497{
498 char safe_name[MAX_ID_NAME - 2];
499 rna_idname_validate(name, safe_name);
500
501 Tex *tex = BKE_texture_add(bmain, safe_name);
503 id_us_min(&tex->id);
504
506
507 return tex;
508}
509
510static Brush *rna_Main_brushes_new(Main *bmain, const char *name, int mode)
511{
512 char safe_name[MAX_ID_NAME - 2];
513 rna_idname_validate(name, safe_name);
514
515 Brush *brush = BKE_brush_add(bmain, safe_name, eObjectMode(mode));
516 id_us_min(&brush->id);
517
519
520 return brush;
521}
522
523static void rna_Main_brush_gpencil_data(Main * /*bmain*/, PointerRNA *id_ptr)
524{
525 ID *id = static_cast<ID *>(id_ptr->data);
526 Brush *brush = reinterpret_cast<Brush *>(id);
528}
529
530static World *rna_Main_worlds_new(Main *bmain, const char *name)
531{
532 char safe_name[MAX_ID_NAME - 2];
533 rna_idname_validate(name, safe_name);
534
535 World *world = BKE_world_add(bmain, safe_name);
536 id_us_min(&world->id);
537
539
540 return world;
541}
542
543static Collection *rna_Main_collections_new(Main *bmain, const char *name)
544{
545 char safe_name[MAX_ID_NAME - 2];
546 rna_idname_validate(name, safe_name);
547
548 Collection *collection = BKE_collection_add(bmain, nullptr, safe_name);
549
551
552 return collection;
553}
554
555static Speaker *rna_Main_speakers_new(Main *bmain, const char *name)
556{
557 char safe_name[MAX_ID_NAME - 2];
558 rna_idname_validate(name, safe_name);
559
560 Speaker *speaker = BKE_speaker_add(bmain, safe_name);
561 id_us_min(&speaker->id);
562
564
565 return speaker;
566}
567
568static bSound *rna_Main_sounds_load(Main *bmain, const char *name, bool check_existing)
569{
570 bSound *sound;
571
572 if (check_existing) {
573 sound = BKE_sound_new_file_exists(bmain, name);
574 }
575 else {
576 sound = BKE_sound_new_file(bmain, name);
577 }
578
579 id_us_min(&sound->id);
580
582
583 return sound;
584}
585
586static Text *rna_Main_texts_new(Main *bmain, const char *name)
587{
588 char safe_name[MAX_ID_NAME - 2];
589 rna_idname_validate(name, safe_name);
590
591 Text *text = BKE_text_add(bmain, safe_name);
592
594
595 return text;
596}
597
598static Text *rna_Main_texts_load(Main *bmain,
599 ReportList *reports,
600 const char *filepath,
601 bool is_internal)
602{
603 Text *txt;
604
605 errno = 0;
606 txt = BKE_text_load_ex(bmain, filepath, BKE_main_blendfile_path(bmain), is_internal);
607
608 if (!txt) {
609 BKE_reportf(reports,
610 RPT_ERROR,
611 "Cannot read '%s': %s",
612 filepath,
613 errno ? strerror(errno) : RPT_("unable to load text"));
614 }
615
617
618 return txt;
619}
620
621static bArmature *rna_Main_armatures_new(Main *bmain, const char *name)
622{
623 char safe_name[MAX_ID_NAME - 2];
624 rna_idname_validate(name, safe_name);
625
626 bArmature *arm = BKE_armature_add(bmain, safe_name);
627 id_us_min(&arm->id);
628
630
631 return arm;
632}
633
634static bAction *rna_Main_actions_new(Main *bmain, const char *name)
635{
636 char safe_name[MAX_ID_NAME - 2];
637 rna_idname_validate(name, safe_name);
638
639 bAction *act = BKE_action_add(bmain, safe_name);
640 id_fake_user_clear(&act->id);
641 id_us_min(&act->id);
642
644
645 return act;
646}
647
648static ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
649{
650 char safe_name[MAX_ID_NAME - 2];
651 rna_idname_validate(name, safe_name);
652
653 ParticleSettings *part = BKE_particlesettings_add(bmain, safe_name);
654 id_us_min(&part->id);
655
657
658 return part;
659}
660
661static Palette *rna_Main_palettes_new(Main *bmain, const char *name)
662{
663 char safe_name[MAX_ID_NAME - 2];
664 rna_idname_validate(name, safe_name);
665
666 Palette *palette = BKE_palette_add(bmain, safe_name);
667 id_us_min(&palette->id);
668
670
671 return (Palette *)palette;
672}
673
674static MovieClip *rna_Main_movieclip_load(Main *bmain,
675 ReportList *reports,
676 const char *filepath,
677 bool check_existing)
678{
679 MovieClip *clip;
680
681 errno = 0;
682
683 if (check_existing) {
684 clip = BKE_movieclip_file_add_exists(bmain, filepath);
685 }
686 else {
687 clip = BKE_movieclip_file_add(bmain, filepath);
688 }
689
690 if (clip != nullptr) {
692 }
693 else {
694 BKE_reportf(reports,
695 RPT_ERROR,
696 "Cannot read '%s': %s",
697 filepath,
698 errno ? strerror(errno) : RPT_("unable to load movie clip"));
699 }
700
701 id_us_min((ID *)clip);
702
704
705 return clip;
706}
707
708static Mask *rna_Main_mask_new(Main *bmain, const char *name)
709{
710 char safe_name[MAX_ID_NAME - 2];
711 rna_idname_validate(name, safe_name);
712
713 Mask *mask = BKE_mask_new(bmain, safe_name);
714 id_us_min(&mask->id);
715
717
718 return mask;
719}
720
721static FreestyleLineStyle *rna_Main_linestyles_new(Main *bmain, const char *name)
722{
723 char safe_name[MAX_ID_NAME - 2];
724 rna_idname_validate(name, safe_name);
725
728
730
731 return linestyle;
732}
733
734static LightProbe *rna_Main_lightprobe_new(Main *bmain, const char *name, int type)
735{
736 char safe_name[MAX_ID_NAME - 2];
737 rna_idname_validate(name, safe_name);
738
739 LightProbe *probe = BKE_lightprobe_add(bmain, safe_name);
740
741 BKE_lightprobe_type_set(probe, type);
742
743 id_us_min(&probe->id);
744
746
747 return probe;
748}
749
750static bGPdata *rna_Main_annotations_new(Main *bmain, const char *name)
751{
752 char safe_name[MAX_ID_NAME - 2];
753 rna_idname_validate(name, safe_name);
754
755 bGPdata *gpd = BKE_gpencil_data_addnew(bmain, safe_name);
756 id_us_min(&gpd->id);
757
759
760 return gpd;
761}
762
763static GreasePencil *rna_Main_grease_pencils_new(Main *bmain, const char *name)
764{
765 char safe_name[MAX_ID_NAME - 2];
766 rna_idname_validate(name, safe_name);
767
768 GreasePencil *grease_pencil = BKE_grease_pencil_add(bmain, safe_name);
769 id_us_min(&grease_pencil->id);
770
772
773 return grease_pencil;
774}
775
776static Curves *rna_Main_hair_curves_new(Main *bmain, const char *name)
777{
778 char safe_name[MAX_ID_NAME - 2];
779 rna_idname_validate(name, safe_name);
780
781 Curves *curves = BKE_curves_add(bmain, safe_name);
782 id_us_min(&curves->id);
783
785
786 return curves;
787}
788
789static PointCloud *rna_Main_pointclouds_new(Main *bmain, const char *name)
790{
791 char safe_name[MAX_ID_NAME - 2];
792 rna_idname_validate(name, safe_name);
793
794 PointCloud *pointcloud = BKE_pointcloud_add(bmain, safe_name);
795 id_us_min(&pointcloud->id);
796
798
799 return pointcloud;
800}
801
802static Volume *rna_Main_volumes_new(Main *bmain, const char *name)
803{
804 char safe_name[MAX_ID_NAME - 2];
805 rna_idname_validate(name, safe_name);
806
807 Volume *volume = BKE_volume_add(bmain, safe_name);
808 id_us_min(&volume->id);
809
811
812 return volume;
813}
814
815/* tag functions, all the same */
816# define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
817 static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \
818 { \
819 BKE_main_id_tag_listbase(&bmain->_listbase_name, ID_TAG_DOIT, value); \
820 }
821
822RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras, ID_CA)
823RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes, ID_SCE)
824RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects, ID_OB)
825RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials, ID_MA)
826RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees, ID_NT)
827RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes, ID_ME)
828RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights, ID_LA)
829RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries, ID_LI)
830RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens, ID_SCR)
831RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM)
832RNA_MAIN_ID_TAG_FUNCS_DEF(images, images, ID_IM)
833RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices, ID_LT)
834RNA_MAIN_ID_TAG_FUNCS_DEF(curves, curves, ID_CU_LEGACY)
835RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs, ID_MB)
836RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts, ID_VF)
837RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures, ID_TE)
838RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brushes, ID_BR)
839RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds, ID_WO)
840RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections, ID_GR)
841// RNA_MAIN_ID_TAG_FUNCS_DEF(shape_keys, key, ID_KE)
842RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts, ID_TXT)
843RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers, ID_SPK)
844RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds, ID_SO)
845RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures, ID_AR)
846RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions, ID_AC)
847RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles, ID_PA)
848RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL)
849RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils, ID_GD_LEGACY)
850RNA_MAIN_ID_TAG_FUNCS_DEF(grease_pencils, grease_pencils, ID_GP)
851RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips, ID_MC)
852RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks, ID_MSK)
853RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles, ID_LS)
854RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF)
855RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC)
856RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS)
857RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP)
858RNA_MAIN_ID_TAG_FUNCS_DEF(hair_curves, hair_curves, ID_CV)
859RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT)
860RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO)
861
862# undef RNA_MAIN_ID_TAG_FUNCS_DEF
863
864#else
865
866void RNA_api_main(StructRNA * /*srna*/)
867{
868# if 0
869 FunctionRNA *func;
870 PropertyRNA *parm;
871
872 /* maybe we want to add functions in 'bpy.data' still?
873 * for now they are all in collections bpy.data.images.new(...) */
874 func = RNA_def_function(srna, "add_image", "rna_Main_add_image");
875 RNA_def_function_ui_description(func, "Add a new image");
877 func, "filepath", nullptr, 0, "", "File path to load image from");
879 parm = RNA_def_pointer(func, "image", "Image", "", "New image");
880 RNA_def_function_return(func, parm);
881# endif
882}
883
885{
886 StructRNA *srna;
887 FunctionRNA *func;
888 PropertyRNA *parm;
889
890 RNA_def_property_srna(cprop, "BlendDataCameras");
891 srna = RNA_def_struct(brna, "BlendDataCameras", nullptr);
892 RNA_def_struct_sdna(srna, "Main");
893 RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras");
894
895 func = RNA_def_function(srna, "new", "rna_Main_cameras_new");
896 RNA_def_function_ui_description(func, "Add a new camera to the main database");
897 parm = RNA_def_string(func, "name", "Camera", 0, "", "New name for the data-block");
899 /* return type */
900 parm = RNA_def_pointer(func, "camera", "Camera", "", "New camera data-block");
901 RNA_def_function_return(func, parm);
902
903 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
905 RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
906 parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
909 RNA_def_boolean(func,
910 "do_unlink",
911 true,
912 "",
913 "Unlink all usages of this camera before deleting it "
914 "(WARNING: will also delete objects instancing that camera data)");
915 RNA_def_boolean(func,
916 "do_id_user",
917 true,
918 "",
919 "Decrement user counter of all datablocks used by this camera");
921 func, "do_ui_user", true, "", "Make sure interface does not reference this camera");
922
923 func = RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
924 parm = RNA_def_boolean(func, "value", false, "Value", "");
926}
927
929{
930 StructRNA *srna;
931 FunctionRNA *func;
932 PropertyRNA *parm;
933
934 RNA_def_property_srna(cprop, "BlendDataScenes");
935 srna = RNA_def_struct(brna, "BlendDataScenes", nullptr);
936 RNA_def_struct_sdna(srna, "Main");
937 RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");
938
939 func = RNA_def_function(srna, "new", "rna_Main_scenes_new");
940 RNA_def_function_ui_description(func, "Add a new scene to the main database");
941 parm = RNA_def_string(func, "name", "Scene", 0, "", "New name for the data-block");
943 /* return type */
944 parm = RNA_def_pointer(func, "scene", "Scene", "", "New scene data-block");
945 RNA_def_function_return(func, parm);
946
947 func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
949 RNA_def_function_ui_description(func, "Remove a scene from the current blendfile");
950 parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
954 func, "do_unlink", true, "", "Unlink all usages of this scene before deleting it");
955
956 func = RNA_def_function(srna, "tag", "rna_Main_scenes_tag");
957 parm = RNA_def_boolean(func, "value", false, "Value", "");
959}
960
962{
963 StructRNA *srna;
964 FunctionRNA *func;
965 PropertyRNA *parm;
966
967 RNA_def_property_srna(cprop, "BlendDataObjects");
968 srna = RNA_def_struct(brna, "BlendDataObjects", nullptr);
969 RNA_def_struct_sdna(srna, "Main");
970 RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects");
971
972 func = RNA_def_function(srna, "new", "rna_Main_objects_new");
974 RNA_def_function_ui_description(func, "Add a new object to the main database");
975 parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the data-block");
977 parm = RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object");
979
980 /* return type */
981 parm = RNA_def_pointer(func, "object", "Object", "", "New object data-block");
982 RNA_def_function_return(func, parm);
983
984 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
985 RNA_def_function_ui_description(func, "Remove an object from the current blendfile");
987 parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
991 func, "do_unlink", true, "", "Unlink all usages of this object before deleting it");
992 RNA_def_boolean(func,
993 "do_id_user",
994 true,
995 "",
996 "Decrement user counter of all datablocks used by this object");
998 func, "do_ui_user", true, "", "Make sure interface does not reference this object");
999
1000 func = RNA_def_function(srna, "tag", "rna_Main_objects_tag");
1001 parm = RNA_def_boolean(func, "value", false, "Value", "");
1003}
1004
1006{
1007 StructRNA *srna;
1008 FunctionRNA *func;
1009 PropertyRNA *parm;
1010
1011 RNA_def_property_srna(cprop, "BlendDataMaterials");
1012 srna = RNA_def_struct(brna, "BlendDataMaterials", nullptr);
1013 RNA_def_struct_sdna(srna, "Main");
1014 RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials");
1015
1016 func = RNA_def_function(srna, "new", "rna_Main_materials_new");
1017 RNA_def_function_ui_description(func, "Add a new material to the main database");
1018 parm = RNA_def_string(func, "name", "Material", 0, "", "New name for the data-block");
1020 /* return type */
1021 parm = RNA_def_pointer(func, "material", "Material", "", "New material data-block");
1022 RNA_def_function_return(func, parm);
1023
1024 func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_materials_gpencil_data");
1025 RNA_def_function_ui_description(func, "Add Grease Pencil material settings");
1026 parm = RNA_def_pointer(func, "material", "Material", "", "Material");
1028
1029 func = RNA_def_function(srna, "remove_gpencil_data", "rna_Main_materials_gpencil_remove");
1030 RNA_def_function_ui_description(func, "Remove Grease Pencil material settings");
1031 parm = RNA_def_pointer(func, "material", "Material", "", "Material");
1033
1034 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1036 RNA_def_function_ui_description(func, "Remove a material from the current blendfile");
1037 parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
1041 func, "do_unlink", true, "", "Unlink all usages of this material before deleting it");
1042 RNA_def_boolean(func,
1043 "do_id_user",
1044 true,
1045 "",
1046 "Decrement user counter of all datablocks used by this material");
1048 func, "do_ui_user", true, "", "Make sure interface does not reference this material");
1049
1050 func = RNA_def_function(srna, "tag", "rna_Main_materials_tag");
1051 parm = RNA_def_boolean(func, "value", false, "Value", "");
1053}
1055{
1056 StructRNA *srna;
1057 FunctionRNA *func;
1058 PropertyRNA *parm;
1059
1060 RNA_def_property_srna(cprop, "BlendDataNodeTrees");
1061 srna = RNA_def_struct(brna, "BlendDataNodeTrees", nullptr);
1062 RNA_def_struct_sdna(srna, "Main");
1063 RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees");
1064
1065 func = RNA_def_function(srna, "new", "rna_Main_nodetree_new");
1066 RNA_def_function_ui_description(func, "Add a new node tree to the main database");
1067 parm = RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the data-block");
1069 parm = RNA_def_enum(
1070 func, "type", rna_enum_dummy_DEFAULT_items, 0, "Type", "The type of node_group to add");
1071 RNA_def_property_enum_funcs(parm, nullptr, nullptr, "rna_Main_nodetree_type_itemf");
1073 /* return type */
1074 parm = RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree data-block");
1075 RNA_def_function_return(func, parm);
1076
1077 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1079 RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile");
1080 parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
1084 func, "do_unlink", true, "", "Unlink all usages of this node tree before deleting it");
1085 RNA_def_boolean(func,
1086 "do_id_user",
1087 true,
1088 "",
1089 "Decrement user counter of all datablocks used by this node tree");
1091 func, "do_ui_user", true, "", "Make sure interface does not reference this node tree");
1092
1093 func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
1094 parm = RNA_def_boolean(func, "value", false, "Value", "");
1096}
1098{
1099 StructRNA *srna;
1100 FunctionRNA *func;
1101 PropertyRNA *parm;
1102
1103 RNA_def_property_srna(cprop, "BlendDataMeshes");
1104 srna = RNA_def_struct(brna, "BlendDataMeshes", nullptr);
1105 RNA_def_struct_sdna(srna, "Main");
1106 RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes");
1107
1108 func = RNA_def_function(srna, "new", "rna_Main_meshes_new");
1109 RNA_def_function_ui_description(func, "Add a new mesh to the main database");
1110 parm = RNA_def_string(func, "name", "Mesh", 0, "", "New name for the data-block");
1112 /* return type */
1113 parm = RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh data-block");
1114 RNA_def_function_return(func, parm);
1115
1116 func = RNA_def_function(srna, "new_from_object", "rna_Main_meshes_new_from_object");
1118 func,
1119 "Add a new mesh created from given object (undeformed geometry if object is original, and "
1120 "final evaluated geometry, with all modifiers etc., if object is evaluated)");
1122 parm = RNA_def_pointer(func, "object", "Object", "", "Object to create mesh from");
1124 RNA_def_boolean(func,
1125 "preserve_all_data_layers",
1126 false,
1127 "",
1128 "Preserve all data layers in the mesh, like UV maps and vertex groups. "
1129 "By default Blender only computes the subset of data layers needed for viewport "
1130 "display and rendering, for better performance.");
1132 func,
1133 "depsgraph",
1134 "Depsgraph",
1135 "Dependency Graph",
1136 "Evaluated dependency graph which is required when preserve_all_data_layers is true");
1137 parm = RNA_def_pointer(func,
1138 "mesh",
1139 "Mesh",
1140 "",
1141 "Mesh created from object, remove it if it is only used for export");
1142 RNA_def_function_return(func, parm);
1143
1144 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1146 RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
1147 parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
1150 RNA_def_boolean(func,
1151 "do_unlink",
1152 true,
1153 "",
1154 "Unlink all usages of this mesh before deleting it "
1155 "(WARNING: will also delete objects instancing that mesh data)");
1156 RNA_def_boolean(func,
1157 "do_id_user",
1158 true,
1159 "",
1160 "Decrement user counter of all datablocks used by this mesh data");
1162 func, "do_ui_user", true, "", "Make sure interface does not reference this mesh data");
1163
1164 func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
1165 parm = RNA_def_boolean(func, "value", false, "Value", "");
1167}
1168
1170{
1171 StructRNA *srna;
1172 FunctionRNA *func;
1173 PropertyRNA *parm;
1174
1175 RNA_def_property_srna(cprop, "BlendDataLights");
1176 srna = RNA_def_struct(brna, "BlendDataLights", nullptr);
1177 RNA_def_struct_sdna(srna, "Main");
1178 RNA_def_struct_ui_text(srna, "Main Lights", "Collection of lights");
1179
1180 func = RNA_def_function(srna, "new", "rna_Main_lights_new");
1181 RNA_def_function_ui_description(func, "Add a new light to the main database");
1182 parm = RNA_def_string(func, "name", "Light", 0, "", "New name for the data-block");
1184 parm = RNA_def_enum(
1185 func, "type", rna_enum_light_type_items, 0, "Type", "The type of light to add");
1187 /* return type */
1188 parm = RNA_def_pointer(func, "light", "Light", "", "New light data-block");
1189 RNA_def_function_return(func, parm);
1190
1191 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1193 RNA_def_function_ui_description(func, "Remove a light from the current blendfile");
1194 parm = RNA_def_pointer(func, "light", "Light", "", "Light to remove");
1197 RNA_def_boolean(func,
1198 "do_unlink",
1199 true,
1200 "",
1201 "Unlink all usages of this light before deleting it "
1202 "(WARNING: will also delete objects instancing that light data)");
1203 RNA_def_boolean(func,
1204 "do_id_user",
1205 true,
1206 "",
1207 "Decrement user counter of all datablocks used by this light data");
1209 func, "do_ui_user", true, "", "Make sure interface does not reference this light data");
1210
1211 func = RNA_def_function(srna, "tag", "rna_Main_lights_tag");
1212 parm = RNA_def_boolean(func, "value", false, "Value", "");
1214}
1215
1217{
1218 StructRNA *srna;
1219 FunctionRNA *func;
1220 PropertyRNA *parm;
1221
1222 RNA_def_property_srna(cprop, "BlendDataLibraries");
1223 srna = RNA_def_struct(brna, "BlendDataLibraries", nullptr);
1224 RNA_def_struct_sdna(srna, "Main");
1225 RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
1226
1227 func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
1228 parm = RNA_def_boolean(func, "value", false, "Value", "");
1230
1231 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1233 RNA_def_function_ui_description(func, "Remove a library from the current blendfile");
1234 parm = RNA_def_pointer(func, "library", "Library", "", "Library to remove");
1238 func, "do_unlink", true, "", "Unlink all usages of this library before deleting it");
1239 RNA_def_boolean(func,
1240 "do_id_user",
1241 true,
1242 "",
1243 "Decrement user counter of all datablocks used by this library");
1245 func, "do_ui_user", true, "", "Make sure interface does not reference this library");
1246}
1247
1249{
1250 StructRNA *srna;
1251 FunctionRNA *func;
1252 PropertyRNA *parm;
1253
1254 RNA_def_property_srna(cprop, "BlendDataScreens");
1255 srna = RNA_def_struct(brna, "BlendDataScreens", nullptr);
1256 RNA_def_struct_sdna(srna, "Main");
1257 RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
1258
1259 func = RNA_def_function(srna, "tag", "rna_Main_screens_tag");
1260 parm = RNA_def_boolean(func, "value", false, "Value", "");
1262}
1263
1265{
1266 StructRNA *srna;
1267 FunctionRNA *func;
1268 PropertyRNA *parm;
1269
1270 RNA_def_property_srna(cprop, "BlendDataWindowManagers");
1271 srna = RNA_def_struct(brna, "BlendDataWindowManagers", nullptr);
1272 RNA_def_struct_sdna(srna, "Main");
1273 RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
1274
1275 func = RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
1276 parm = RNA_def_boolean(func, "value", false, "Value", "");
1278}
1280{
1281 StructRNA *srna;
1282 FunctionRNA *func;
1283 PropertyRNA *parm;
1284
1285 RNA_def_property_srna(cprop, "BlendDataImages");
1286 srna = RNA_def_struct(brna, "BlendDataImages", nullptr);
1287 RNA_def_struct_sdna(srna, "Main");
1288 RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
1289
1290 func = RNA_def_function(srna, "new", "rna_Main_images_new");
1291 RNA_def_function_ui_description(func, "Add a new image to the main database");
1292 parm = RNA_def_string(func, "name", "Image", 0, "", "New name for the data-block");
1294 parm = RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 1, INT_MAX);
1296 parm = RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 1, INT_MAX);
1298 RNA_def_boolean(func, "alpha", false, "Alpha", "Use alpha channel");
1300 func, "float_buffer", false, "Float Buffer", "Create an image with floating-point color");
1301 RNA_def_boolean(func, "stereo3d", false, "Stereo 3D", "Create left and right views");
1303 func, "is_data", false, "Is Data", "Create image with non-color data color space");
1304 RNA_def_boolean(func, "tiled", false, "Tiled", "Create a tiled image");
1305 /* return type */
1306 parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1307 RNA_def_function_return(func, parm);
1308
1309 func = RNA_def_function(srna, "load", "rna_Main_images_load");
1311 RNA_def_function_ui_description(func, "Load a new image into the main database");
1313 func, "filepath", "File Path", 0, "", "Path of the file to load");
1315 RNA_def_boolean(func,
1316 "check_existing",
1317 false,
1318 "",
1319 "Using existing data-block if this file is already loaded");
1320 /* return type */
1321 parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1322 RNA_def_function_return(func, parm);
1323
1324 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1326 RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
1327 parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove");
1331 func, "do_unlink", true, "", "Unlink all usages of this image before deleting it");
1333 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this image");
1335 func, "do_ui_user", true, "", "Make sure interface does not reference this image");
1336
1337 func = RNA_def_function(srna, "tag", "rna_Main_images_tag");
1338 parm = RNA_def_boolean(func, "value", false, "Value", "");
1340}
1341
1343{
1344 StructRNA *srna;
1345 FunctionRNA *func;
1346 PropertyRNA *parm;
1347
1348 RNA_def_property_srna(cprop, "BlendDataLattices");
1349 srna = RNA_def_struct(brna, "BlendDataLattices", nullptr);
1350 RNA_def_struct_sdna(srna, "Main");
1351 RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
1352
1353 func = RNA_def_function(srna, "new", "rna_Main_lattices_new");
1354 RNA_def_function_ui_description(func, "Add a new lattice to the main database");
1355 parm = RNA_def_string(func, "name", "Lattice", 0, "", "New name for the data-block");
1357 /* return type */
1358 parm = RNA_def_pointer(func, "lattice", "Lattice", "", "New lattice data-block");
1359 RNA_def_function_return(func, parm);
1360
1361 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1363 RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
1364 parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
1367 RNA_def_boolean(func,
1368 "do_unlink",
1369 true,
1370 "",
1371 "Unlink all usages of this lattice before deleting it "
1372 "(WARNING: will also delete objects instancing that lattice data)");
1373 RNA_def_boolean(func,
1374 "do_id_user",
1375 true,
1376 "",
1377 "Decrement user counter of all datablocks used by this lattice data");
1379 func, "do_ui_user", true, "", "Make sure interface does not reference this lattice data");
1380
1381 func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
1382 parm = RNA_def_boolean(func, "value", false, "Value", "");
1384}
1386{
1387 StructRNA *srna;
1388 FunctionRNA *func;
1389 PropertyRNA *parm;
1390
1391 RNA_def_property_srna(cprop, "BlendDataCurves");
1392 srna = RNA_def_struct(brna, "BlendDataCurves", nullptr);
1393 RNA_def_struct_sdna(srna, "Main");
1394 RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
1395
1396 func = RNA_def_function(srna, "new", "rna_Main_curves_new");
1397 RNA_def_function_ui_description(func, "Add a new curve to the main database");
1398 parm = RNA_def_string(func, "name", "Curve", 0, "", "New name for the data-block");
1400 parm = RNA_def_enum(
1401 func, "type", rna_enum_object_type_curve_items, 0, "Type", "The type of curve to add");
1403 /* return type */
1404 parm = RNA_def_pointer(func, "curve", "Curve", "", "New curve data-block");
1405 RNA_def_function_return(func, parm);
1406
1407 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1409 RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
1410 parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
1413 RNA_def_boolean(func,
1414 "do_unlink",
1415 true,
1416 "",
1417 "Unlink all usages of this curve before deleting it "
1418 "(WARNING: will also delete objects instancing that curve data)");
1419 RNA_def_boolean(func,
1420 "do_id_user",
1421 true,
1422 "",
1423 "Decrement user counter of all datablocks used by this curve data");
1425 func, "do_ui_user", true, "", "Make sure interface does not reference this curve data");
1426
1427 func = RNA_def_function(srna, "tag", "rna_Main_curves_tag");
1428 parm = RNA_def_boolean(func, "value", false, "Value", "");
1430}
1432{
1433 StructRNA *srna;
1434 FunctionRNA *func;
1435 PropertyRNA *parm;
1436
1437 RNA_def_property_srna(cprop, "BlendDataMetaBalls");
1438 srna = RNA_def_struct(brna, "BlendDataMetaBalls", nullptr);
1439 RNA_def_struct_sdna(srna, "Main");
1440 RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs");
1441
1442 func = RNA_def_function(srna, "new", "rna_Main_metaballs_new");
1443 RNA_def_function_ui_description(func, "Add a new metaball to the main database");
1444 parm = RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the data-block");
1446 /* return type */
1447 parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball data-block");
1448 RNA_def_function_return(func, parm);
1449
1450 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1452 RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile");
1453 parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove");
1456 RNA_def_boolean(func,
1457 "do_unlink",
1458 true,
1459 "",
1460 "Unlink all usages of this metaball before deleting it "
1461 "(WARNING: will also delete objects instancing that metaball data)");
1462 RNA_def_boolean(func,
1463 "do_id_user",
1464 true,
1465 "",
1466 "Decrement user counter of all datablocks used by this metaball data");
1468 func, "do_ui_user", true, "", "Make sure interface does not reference this metaball data");
1469
1470 func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
1471 parm = RNA_def_boolean(func, "value", false, "Value", "");
1473}
1475{
1476 StructRNA *srna;
1477 FunctionRNA *func;
1478 PropertyRNA *parm;
1479
1480 RNA_def_property_srna(cprop, "BlendDataFonts");
1481 srna = RNA_def_struct(brna, "BlendDataFonts", nullptr);
1482 RNA_def_struct_sdna(srna, "Main");
1483 RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
1484
1485 func = RNA_def_function(srna, "load", "rna_Main_fonts_load");
1487 RNA_def_function_ui_description(func, "Load a new font into the main database");
1489 func, "filepath", "File Path", 0, "", "path of the font to load");
1491 RNA_def_boolean(func,
1492 "check_existing",
1493 false,
1494 "",
1495 "Using existing data-block if this file is already loaded");
1496 /* return type */
1497 parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "New font data-block");
1498 RNA_def_function_return(func, parm);
1499
1500 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1502 RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
1503 parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
1507 func, "do_unlink", true, "", "Unlink all usages of this font before deleting it");
1509 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this font");
1511 func, "do_ui_user", true, "", "Make sure interface does not reference this font");
1512
1513 func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
1514 parm = RNA_def_boolean(func, "value", false, "Value", "");
1516}
1518{
1519 StructRNA *srna;
1520 FunctionRNA *func;
1521 PropertyRNA *parm;
1522
1523 RNA_def_property_srna(cprop, "BlendDataTextures");
1524 srna = RNA_def_struct(brna, "BlendDataTextures", nullptr);
1525 RNA_def_struct_sdna(srna, "Main");
1526 RNA_def_struct_ui_text(srna, "Main Textures", "Collection of textures");
1527
1528 func = RNA_def_function(srna, "new", "rna_Main_textures_new");
1529 RNA_def_function_ui_description(func, "Add a new texture to the main database");
1530 parm = RNA_def_string(func, "name", "Texture", 0, "", "New name for the data-block");
1532 parm = RNA_def_enum(
1533 func, "type", rna_enum_texture_type_items, 0, "Type", "The type of texture to add");
1535 /* return type */
1536 parm = RNA_def_pointer(func, "texture", "Texture", "", "New texture data-block");
1537 RNA_def_function_return(func, parm);
1538
1539 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1541 RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
1542 parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
1546 func, "do_unlink", true, "", "Unlink all usages of this texture before deleting it");
1547 RNA_def_boolean(func,
1548 "do_id_user",
1549 true,
1550 "",
1551 "Decrement user counter of all datablocks used by this texture");
1553 func, "do_ui_user", true, "", "Make sure interface does not reference this texture");
1554
1555 func = RNA_def_function(srna, "tag", "rna_Main_textures_tag");
1556 parm = RNA_def_boolean(func, "value", false, "Value", "");
1558}
1560{
1561 StructRNA *srna;
1562 FunctionRNA *func;
1563 PropertyRNA *parm;
1564
1565 RNA_def_property_srna(cprop, "BlendDataBrushes");
1566 srna = RNA_def_struct(brna, "BlendDataBrushes", nullptr);
1567 RNA_def_struct_sdna(srna, "Main");
1568 RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
1569
1570 func = RNA_def_function(srna, "new", "rna_Main_brushes_new");
1571 RNA_def_function_ui_description(func, "Add a new brush to the main database");
1572 parm = RNA_def_string(func, "name", "Brush", 0, "", "New name for the data-block");
1574 parm = RNA_def_enum(func,
1575 "mode",
1578 "",
1579 "Paint Mode for the new brush");
1580 /* return type */
1581 parm = RNA_def_pointer(func, "brush", "Brush", "", "New brush data-block");
1582 RNA_def_function_return(func, parm);
1583
1584 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1586 RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
1587 parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
1591 func, "do_unlink", true, "", "Unlink all usages of this brush before deleting it");
1593 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this brush");
1595 func, "do_ui_user", true, "", "Make sure interface does not reference this brush");
1596
1597 func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
1598 parm = RNA_def_boolean(func, "value", false, "Value", "");
1600
1601 func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_brush_gpencil_data");
1602 RNA_def_function_ui_description(func, "Add Grease Pencil brush settings");
1603 parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush");
1605}
1606
1608{
1609 StructRNA *srna;
1610 FunctionRNA *func;
1611 PropertyRNA *parm;
1612
1613 RNA_def_property_srna(cprop, "BlendDataWorlds");
1614 srna = RNA_def_struct(brna, "BlendDataWorlds", nullptr);
1615 RNA_def_struct_sdna(srna, "Main");
1616 RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds");
1617
1618 func = RNA_def_function(srna, "new", "rna_Main_worlds_new");
1619 RNA_def_function_ui_description(func, "Add a new world to the main database");
1620 parm = RNA_def_string(func, "name", "World", 0, "", "New name for the data-block");
1622 /* return type */
1623 parm = RNA_def_pointer(func, "world", "World", "", "New world data-block");
1624 RNA_def_function_return(func, parm);
1625
1626 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1628 RNA_def_function_ui_description(func, "Remove a world from the current blendfile");
1629 parm = RNA_def_pointer(func, "world", "World", "", "World to remove");
1633 func, "do_unlink", true, "", "Unlink all usages of this world before deleting it");
1635 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this world");
1637 func, "do_ui_user", true, "", "Make sure interface does not reference this world");
1638
1639 func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
1640 parm = RNA_def_boolean(func, "value", false, "Value", "");
1642}
1643
1645{
1646 StructRNA *srna;
1647 FunctionRNA *func;
1648 PropertyRNA *parm;
1649
1650 RNA_def_property_srna(cprop, "BlendDataCollections");
1651 srna = RNA_def_struct(brna, "BlendDataCollections", nullptr);
1652 RNA_def_struct_sdna(srna, "Main");
1653 RNA_def_struct_ui_text(srna, "Main Collections", "Collection of collections");
1654
1655 func = RNA_def_function(srna, "new", "rna_Main_collections_new");
1656 RNA_def_function_ui_description(func, "Add a new collection to the main database");
1657 parm = RNA_def_string(func, "name", "Collection", 0, "", "New name for the data-block");
1659 /* return type */
1660 parm = RNA_def_pointer(func, "collection", "Collection", "", "New collection data-block");
1661 RNA_def_function_return(func, parm);
1662
1663 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1664 RNA_def_function_ui_description(func, "Remove a collection from the current blendfile");
1666 parm = RNA_def_pointer(func, "collection", "Collection", "", "Collection to remove");
1670 func, "do_unlink", true, "", "Unlink all usages of this collection before deleting it");
1671 RNA_def_boolean(func,
1672 "do_id_user",
1673 true,
1674 "",
1675 "Decrement user counter of all datablocks used by this collection");
1677 func, "do_ui_user", true, "", "Make sure interface does not reference this collection");
1678
1679 func = RNA_def_function(srna, "tag", "rna_Main_collections_tag");
1680 parm = RNA_def_boolean(func, "value", false, "Value", "");
1682}
1683
1685{
1686 StructRNA *srna;
1687 FunctionRNA *func;
1688 PropertyRNA *parm;
1689
1690 RNA_def_property_srna(cprop, "BlendDataSpeakers");
1691 srna = RNA_def_struct(brna, "BlendDataSpeakers", nullptr);
1692 RNA_def_struct_sdna(srna, "Main");
1693 RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers");
1694
1695 func = RNA_def_function(srna, "new", "rna_Main_speakers_new");
1696 RNA_def_function_ui_description(func, "Add a new speaker to the main database");
1697 parm = RNA_def_string(func, "name", "Speaker", 0, "", "New name for the data-block");
1699 /* return type */
1700 parm = RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker data-block");
1701 RNA_def_function_return(func, parm);
1702
1703 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1705 RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
1706 parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
1709 RNA_def_boolean(func,
1710 "do_unlink",
1711 true,
1712 "",
1713 "Unlink all usages of this speaker before deleting it "
1714 "(WARNING: will also delete objects instancing that speaker data)");
1715 RNA_def_boolean(func,
1716 "do_id_user",
1717 true,
1718 "",
1719 "Decrement user counter of all datablocks used by this speaker data");
1721 func, "do_ui_user", true, "", "Make sure interface does not reference this speaker data");
1722
1723 func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
1724 parm = RNA_def_boolean(func, "value", false, "Value", "");
1726}
1727
1729{
1730 StructRNA *srna;
1731 FunctionRNA *func;
1732 PropertyRNA *parm;
1733
1734 RNA_def_property_srna(cprop, "BlendDataTexts");
1735 srna = RNA_def_struct(brna, "BlendDataTexts", nullptr);
1736 RNA_def_struct_sdna(srna, "Main");
1737 RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
1738
1739 func = RNA_def_function(srna, "new", "rna_Main_texts_new");
1740 RNA_def_function_ui_description(func, "Add a new text to the main database");
1741 parm = RNA_def_string(func, "name", "Text", 0, "", "New name for the data-block");
1743 /* return type */
1744 parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1745 RNA_def_function_return(func, parm);
1746
1747 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1748 RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
1750 parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove");
1754 func, "do_unlink", true, "", "Unlink all usages of this text before deleting it");
1756 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this text");
1758 func, "do_ui_user", true, "", "Make sure interface does not reference this text");
1759
1760 /* load func */
1761 func = RNA_def_function(srna, "load", "rna_Main_texts_load");
1763 RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
1765 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1767 parm = RNA_def_boolean(
1768 func, "internal", false, "Make internal", "Make text file internal after loading");
1769 /* return type */
1770 parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1771 RNA_def_function_return(func, parm);
1772
1773 func = RNA_def_function(srna, "tag", "rna_Main_texts_tag");
1774 parm = RNA_def_boolean(func, "value", false, "Value", "");
1776}
1777
1779{
1780 StructRNA *srna;
1781 FunctionRNA *func;
1782 PropertyRNA *parm;
1783
1784 RNA_def_property_srna(cprop, "BlendDataSounds");
1785 srna = RNA_def_struct(brna, "BlendDataSounds", nullptr);
1786 RNA_def_struct_sdna(srna, "Main");
1787 RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
1788
1789 /* load func */
1790 func = RNA_def_function(srna, "load", "rna_Main_sounds_load");
1791 RNA_def_function_ui_description(func, "Add a new sound to the main database from a file");
1793 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1795 RNA_def_boolean(func,
1796 "check_existing",
1797 false,
1798 "",
1799 "Using existing data-block if this file is already loaded");
1800 /* return type */
1801 parm = RNA_def_pointer(func, "sound", "Sound", "", "New text data-block");
1802 RNA_def_function_return(func, parm);
1803
1804 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1806 RNA_def_function_ui_description(func, "Remove a sound from the current blendfile");
1807 parm = RNA_def_pointer(func, "sound", "Sound", "", "Sound to remove");
1811 func, "do_unlink", true, "", "Unlink all usages of this sound before deleting it");
1813 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this sound");
1815 func, "do_ui_user", true, "", "Make sure interface does not reference this sound");
1816
1817 func = RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
1818 parm = RNA_def_boolean(func, "value", false, "Value", "");
1820}
1821
1823{
1824 StructRNA *srna;
1825 FunctionRNA *func;
1826 PropertyRNA *parm;
1827
1828 RNA_def_property_srna(cprop, "BlendDataArmatures");
1829 srna = RNA_def_struct(brna, "BlendDataArmatures", nullptr);
1830 RNA_def_struct_sdna(srna, "Main");
1831 RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
1832
1833 func = RNA_def_function(srna, "new", "rna_Main_armatures_new");
1834 RNA_def_function_ui_description(func, "Add a new armature to the main database");
1835 parm = RNA_def_string(func, "name", "Armature", 0, "", "New name for the data-block");
1837 /* return type */
1838 parm = RNA_def_pointer(func, "armature", "Armature", "", "New armature data-block");
1839 RNA_def_function_return(func, parm);
1840
1841 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1843 RNA_def_function_ui_description(func, "Remove an armature from the current blendfile");
1844 parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
1847 RNA_def_boolean(func,
1848 "do_unlink",
1849 true,
1850 "",
1851 "Unlink all usages of this armature before deleting it "
1852 "(WARNING: will also delete objects instancing that armature data)");
1853 RNA_def_boolean(func,
1854 "do_id_user",
1855 true,
1856 "",
1857 "Decrement user counter of all datablocks used by this armature data");
1859 func, "do_ui_user", true, "", "Make sure interface does not reference this armature data");
1860
1861 func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
1862 parm = RNA_def_boolean(func, "value", false, "Value", "");
1864}
1866{
1867 StructRNA *srna;
1868 FunctionRNA *func;
1869 PropertyRNA *parm;
1870
1871 RNA_def_property_srna(cprop, "BlendDataActions");
1872 srna = RNA_def_struct(brna, "BlendDataActions", nullptr);
1873 RNA_def_struct_sdna(srna, "Main");
1874 RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
1875
1876 func = RNA_def_function(srna, "new", "rna_Main_actions_new");
1877 RNA_def_function_ui_description(func, "Add a new action to the main database");
1878 parm = RNA_def_string(func, "name", "Action", 0, "", "New name for the data-block");
1880 /* return type */
1881 parm = RNA_def_pointer(func, "action", "Action", "", "New action data-block");
1882 RNA_def_function_return(func, parm);
1883
1884 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1886 RNA_def_function_ui_description(func, "Remove an action from the current blendfile");
1887 parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove");
1891 func, "do_unlink", true, "", "Unlink all usages of this action before deleting it");
1892 RNA_def_boolean(func,
1893 "do_id_user",
1894 true,
1895 "",
1896 "Decrement user counter of all datablocks used by this action");
1898 func, "do_ui_user", true, "", "Make sure interface does not reference this action");
1899
1900 func = RNA_def_function(srna, "tag", "rna_Main_actions_tag");
1901 parm = RNA_def_boolean(func, "value", false, "Value", "");
1903}
1904
1906{
1907 StructRNA *srna;
1908 FunctionRNA *func;
1909 PropertyRNA *parm;
1910
1911 RNA_def_property_srna(cprop, "BlendDataParticles");
1912 srna = RNA_def_struct(brna, "BlendDataParticles", nullptr);
1913 RNA_def_struct_sdna(srna, "Main");
1914 RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
1915
1916 func = RNA_def_function(srna, "new", "rna_Main_particles_new");
1918 "Add a new particle settings instance to the main database");
1919 parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the data-block");
1921 /* return type */
1922 parm = RNA_def_pointer(
1923 func, "particle", "ParticleSettings", "", "New particle settings data-block");
1924 RNA_def_function_return(func, parm);
1925
1926 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1929 func, "Remove a particle settings instance from the current blendfile");
1930 parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
1933 RNA_def_boolean(func,
1934 "do_unlink",
1935 true,
1936 "",
1937 "Unlink all usages of those particle settings before deleting them");
1938 RNA_def_boolean(func,
1939 "do_id_user",
1940 true,
1941 "",
1942 "Decrement user counter of all datablocks used by this particle settings");
1943 RNA_def_boolean(func,
1944 "do_ui_user",
1945 true,
1946 "",
1947 "Make sure interface does not reference this particle settings");
1948
1949 func = RNA_def_function(srna, "tag", "rna_Main_particles_tag");
1950 parm = RNA_def_boolean(func, "value", false, "Value", "");
1952}
1953
1955{
1956 StructRNA *srna;
1957 FunctionRNA *func;
1958 PropertyRNA *parm;
1959
1960 RNA_def_property_srna(cprop, "BlendDataPalettes");
1961 srna = RNA_def_struct(brna, "BlendDataPalettes", nullptr);
1962 RNA_def_struct_sdna(srna, "Main");
1963 RNA_def_struct_ui_text(srna, "Main Palettes", "Collection of palettes");
1964
1965 func = RNA_def_function(srna, "new", "rna_Main_palettes_new");
1966 RNA_def_function_ui_description(func, "Add a new palette to the main database");
1967 parm = RNA_def_string(func, "name", "Palette", 0, "", "New name for the data-block");
1969 /* return type */
1970 parm = RNA_def_pointer(func, "palette", "Palette", "", "New palette data-block");
1971 RNA_def_function_return(func, parm);
1972
1973 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1975 RNA_def_function_ui_description(func, "Remove a palette from the current blendfile");
1976 parm = RNA_def_pointer(func, "palette", "Palette", "", "Palette to remove");
1980 func, "do_unlink", true, "", "Unlink all usages of this palette before deleting it");
1981 RNA_def_boolean(func,
1982 "do_id_user",
1983 true,
1984 "",
1985 "Decrement user counter of all datablocks used by this palette");
1987 func, "do_ui_user", true, "", "Make sure interface does not reference this palette");
1988
1989 func = RNA_def_function(srna, "tag", "rna_Main_palettes_tag");
1990 parm = RNA_def_boolean(func, "value", false, "Value", "");
1992}
1994{
1995 StructRNA *srna;
1996 FunctionRNA *func;
1997 PropertyRNA *parm;
1998
1999 RNA_def_property_srna(cprop, "BlendDataCacheFiles");
2000 srna = RNA_def_struct(brna, "BlendDataCacheFiles", nullptr);
2001 RNA_def_struct_sdna(srna, "Main");
2002 RNA_def_struct_ui_text(srna, "Main Cache Files", "Collection of cache files");
2003
2004 func = RNA_def_function(srna, "tag", "rna_Main_cachefiles_tag");
2005 parm = RNA_def_boolean(func, "value", false, "Value", "");
2007}
2009{
2010 StructRNA *srna;
2011 FunctionRNA *func;
2012 PropertyRNA *parm;
2013
2014 RNA_def_property_srna(cprop, "BlendDataPaintCurves");
2015 srna = RNA_def_struct(brna, "BlendDataPaintCurves", nullptr);
2016 RNA_def_struct_sdna(srna, "Main");
2017 RNA_def_struct_ui_text(srna, "Main Paint Curves", "Collection of paint curves");
2018
2019 func = RNA_def_function(srna, "tag", "rna_Main_paintcurves_tag");
2020 parm = RNA_def_boolean(func, "value", false, "Value", "");
2022}
2024{
2025 StructRNA *srna;
2026 FunctionRNA *func;
2027 PropertyRNA *parm;
2028
2029 RNA_def_property_srna(cprop, "BlendDataGreasePencils");
2030 srna = RNA_def_struct(brna, "BlendDataGreasePencils", nullptr);
2031 RNA_def_struct_sdna(srna, "Main");
2032 RNA_def_struct_ui_text(srna, "Main Annotations", "Collection of annotations");
2033
2034 func = RNA_def_function(srna, "tag", "rna_Main_gpencils_tag");
2035 parm = RNA_def_boolean(func, "value", false, "Value", "");
2037
2038 func = RNA_def_function(srna, "new", "rna_Main_annotations_new");
2039 RNA_def_function_ui_description(func, "Add a new annotation datablock to the main database");
2040 parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the data-block");
2042 /* return type */
2043 parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "New annotation data-block");
2044 RNA_def_function_return(func, parm);
2045
2046 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2048 RNA_def_function_ui_description(func, "Remove annotation instance from the current blendfile");
2049 parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "Grease Pencil to remove");
2053 func, "do_unlink", true, "", "Unlink all usages of this annotation before deleting it");
2054 RNA_def_boolean(func,
2055 "do_id_user",
2056 true,
2057 "",
2058 "Decrement user counter of all datablocks used by this annotation");
2060 func, "do_ui_user", true, "", "Make sure interface does not reference this annotation");
2061}
2062
2064{
2065 StructRNA *srna;
2066 FunctionRNA *func;
2067 PropertyRNA *parm;
2068
2069 RNA_def_property_srna(cprop, "BlendDataGreasePencilsV3");
2070 srna = RNA_def_struct(brna, "BlendDataGreasePencilsV3", nullptr);
2071 RNA_def_struct_sdna(srna, "Main");
2072 RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of Grease Pencils");
2073
2074 func = RNA_def_function(srna, "tag", "rna_Main_grease_pencils_tag");
2075 parm = RNA_def_boolean(func, "value", false, "Value", "");
2077
2078 func = RNA_def_function(srna, "new", "rna_Main_grease_pencils_new");
2079 RNA_def_function_ui_description(func, "Add a new Grease Pencil datablock to the main database");
2080 parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the data-block");
2082 /* return type */
2083 parm = RNA_def_pointer(
2084 func, "grease_pencil", "GreasePencilv3", "", "New Grease Pencil data-block");
2085 RNA_def_function_return(func, parm);
2086
2087 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2090 "Remove a Grease Pencil instance from the current blendfile");
2091 parm = RNA_def_pointer(func, "grease_pencil", "GreasePencilv3", "", "Grease Pencil to remove");
2095 func, "do_unlink", true, "", "Unlink all usages of this Grease Pencil before deleting it");
2096 RNA_def_boolean(func,
2097 "do_id_user",
2098 true,
2099 "",
2100 "Decrement user counter of all datablocks used by this Grease Pencil");
2102 func, "do_ui_user", true, "", "Make sure interface does not reference this Grease Pencil");
2103}
2104
2106{
2107 StructRNA *srna;
2108 FunctionRNA *func;
2109 PropertyRNA *parm;
2110
2111 RNA_def_property_srna(cprop, "BlendDataMovieClips");
2112 srna = RNA_def_struct(brna, "BlendDataMovieClips", nullptr);
2113 RNA_def_struct_sdna(srna, "Main");
2114 RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips");
2115
2116 func = RNA_def_function(srna, "tag", "rna_Main_movieclips_tag");
2117 parm = RNA_def_boolean(func, "value", false, "Value", "");
2119
2120 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2122 RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile.");
2123 parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
2127 func, "do_unlink", true, "", "Unlink all usages of this movie clip before deleting it");
2128 RNA_def_boolean(func,
2129 "do_id_user",
2130 true,
2131 "",
2132 "Decrement user counter of all datablocks used by this movie clip");
2134 func, "do_ui_user", true, "", "Make sure interface does not reference this movie clip");
2135
2136 /* load func */
2137 func = RNA_def_function(srna, "load", "rna_Main_movieclip_load");
2140 func,
2141 "Add a new movie clip to the main database from a file "
2142 "(while ``check_existing`` is disabled for consistency with other load functions, "
2143 "behavior with multiple movie-clips using the same file may incorrectly generate proxies)");
2145 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
2147 RNA_def_boolean(func,
2148 "check_existing",
2149 false,
2150 "",
2151 "Using existing data-block if this file is already loaded");
2152 /* return type */
2153 parm = RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip data-block");
2154 RNA_def_function_return(func, parm);
2155}
2156
2158{
2159 StructRNA *srna;
2160 FunctionRNA *func;
2161 PropertyRNA *parm;
2162
2163 RNA_def_property_srna(cprop, "BlendDataMasks");
2164 srna = RNA_def_struct(brna, "BlendDataMasks", nullptr);
2165 RNA_def_struct_sdna(srna, "Main");
2166 RNA_def_struct_ui_text(srna, "Main Masks", "Collection of masks");
2167
2168 func = RNA_def_function(srna, "tag", "rna_Main_masks_tag");
2169 parm = RNA_def_boolean(func, "value", false, "Value", "");
2171
2172 /* new func */
2173 func = RNA_def_function(srna, "new", "rna_Main_mask_new");
2174 RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database");
2175 parm = RNA_def_string(
2176 func, "name", nullptr, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
2178 /* return type */
2179 parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask data-block");
2180 RNA_def_function_return(func, parm);
2181
2182 /* remove func */
2183 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2185 RNA_def_function_ui_description(func, "Remove a mask from the current blendfile");
2186 parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to remove");
2190 func, "do_unlink", true, "", "Unlink all usages of this mask before deleting it");
2192 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this mask");
2194 func, "do_ui_user", true, "", "Make sure interface does not reference this mask");
2195}
2196
2198{
2199 StructRNA *srna;
2200 FunctionRNA *func;
2201 PropertyRNA *parm;
2202
2203 RNA_def_property_srna(cprop, "BlendDataLineStyles");
2204 srna = RNA_def_struct(brna, "BlendDataLineStyles", nullptr);
2205 RNA_def_struct_sdna(srna, "Main");
2206 RNA_def_struct_ui_text(srna, "Main Line Styles", "Collection of line styles");
2207
2208 func = RNA_def_function(srna, "tag", "rna_Main_linestyle_tag");
2209 parm = RNA_def_boolean(func, "value", false, "Value", "");
2211
2212 func = RNA_def_function(srna, "new", "rna_Main_linestyles_new");
2213 RNA_def_function_ui_description(func, "Add a new line style instance to the main database");
2214 parm = RNA_def_string(func, "name", "FreestyleLineStyle", 0, "", "New name for the data-block");
2216 /* return type */
2217 parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "New line style data-block");
2218 RNA_def_function_return(func, parm);
2219
2220 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2222 RNA_def_function_ui_description(func, "Remove a line style instance from the current blendfile");
2223 parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "Line style to remove");
2227 func, "do_unlink", true, "", "Unlink all usages of this line style before deleting it");
2228 RNA_def_boolean(func,
2229 "do_id_user",
2230 true,
2231 "",
2232 "Decrement user counter of all datablocks used by this line style");
2234 func, "do_ui_user", true, "", "Make sure interface does not reference this line style");
2235}
2236
2238{
2239 StructRNA *srna;
2240 FunctionRNA *func;
2241 PropertyRNA *parm;
2242
2243 RNA_def_property_srna(cprop, "BlendDataWorkSpaces");
2244 srna = RNA_def_struct(brna, "BlendDataWorkSpaces", nullptr);
2245 RNA_def_struct_sdna(srna, "Main");
2246 RNA_def_struct_ui_text(srna, "Main Workspaces", "Collection of workspaces");
2247
2248 func = RNA_def_function(srna, "tag", "rna_Main_workspaces_tag");
2249 parm = RNA_def_boolean(func, "value", false, "Value", "");
2251}
2252
2254{
2255 StructRNA *srna;
2256 FunctionRNA *func;
2257 PropertyRNA *parm;
2258
2259 RNA_def_property_srna(cprop, "BlendDataProbes");
2260 srna = RNA_def_struct(brna, "BlendDataProbes", nullptr);
2261 RNA_def_struct_sdna(srna, "Main");
2262 RNA_def_struct_ui_text(srna, "Main Light Probes", "Collection of light probes");
2263
2264 func = RNA_def_function(srna, "new", "rna_Main_lightprobe_new");
2265 RNA_def_function_ui_description(func, "Add a new light probe to the main database");
2266 parm = RNA_def_string(func, "name", "Probe", 0, "", "New name for the data-block");
2268 parm = RNA_def_enum(
2269 func, "type", rna_enum_lightprobes_type_items, 0, "Type", "The type of light probe to add");
2271 /* return type */
2272 parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "New light probe data-block");
2273 RNA_def_function_return(func, parm);
2274
2275 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2277 RNA_def_function_ui_description(func, "Remove a light probe from the current blendfile");
2278 parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "Light probe to remove");
2281 RNA_def_boolean(func,
2282 "do_unlink",
2283 true,
2284 "",
2285 "Unlink all usages of this light probe before deleting it "
2286 "(WARNING: will also delete objects instancing that light probe data)");
2287 RNA_def_boolean(func,
2288 "do_id_user",
2289 true,
2290 "",
2291 "Decrement user counter of all datablocks used by this light probe");
2293 func, "do_ui_user", true, "", "Make sure interface does not reference this light probe");
2294
2295 func = RNA_def_function(srna, "tag", "rna_Main_lightprobes_tag");
2296 parm = RNA_def_boolean(func, "value", false, "Value", "");
2298}
2299
2301{
2302 StructRNA *srna;
2303 FunctionRNA *func;
2304 PropertyRNA *parm;
2305
2306 RNA_def_property_srna(cprop, "BlendDataHairCurves");
2307 srna = RNA_def_struct(brna, "BlendDataHairCurves", nullptr);
2308 RNA_def_struct_sdna(srna, "Main");
2309 RNA_def_struct_ui_text(srna, "Main Hair Curves", "Collection of hair curves");
2310
2311 func = RNA_def_function(srna, "new", "rna_Main_hair_curves_new");
2312 RNA_def_function_ui_description(func, "Add a new hair to the main database");
2313 parm = RNA_def_string(func, "name", "Curves", 0, "", "New name for the data-block");
2315 /* return type */
2316 parm = RNA_def_pointer(func, "curves", "Curves", "", "New curves data-block");
2317 RNA_def_function_return(func, parm);
2318
2319 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2321 RNA_def_function_ui_description(func, "Remove a curves data-block from the current blendfile");
2322 parm = RNA_def_pointer(func, "curves", "Curves", "", "Curves data-block to remove");
2325 RNA_def_boolean(func,
2326 "do_unlink",
2327 true,
2328 "",
2329 "Unlink all usages of this curves before deleting it "
2330 "(WARNING: will also delete objects instancing that curves data)");
2331 RNA_def_boolean(func,
2332 "do_id_user",
2333 true,
2334 "",
2335 "Decrement user counter of all datablocks used by this curves data");
2337 func, "do_ui_user", true, "", "Make sure interface does not reference this curves data");
2338
2339 func = RNA_def_function(srna, "tag", "rna_Main_hair_curves_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, "BlendDataPointClouds");
2351 srna = RNA_def_struct(brna, "BlendDataPointClouds", nullptr);
2352 RNA_def_struct_sdna(srna, "Main");
2353 RNA_def_struct_ui_text(srna, "Main Point Clouds", "Collection of point clouds");
2354
2355 func = RNA_def_function(srna, "new", "rna_Main_pointclouds_new");
2356 RNA_def_function_ui_description(func, "Add a new point cloud to the main database");
2357 parm = RNA_def_string(func, "name", "PointCloud", 0, "", "New name for the data-block");
2359 /* return type */
2360 parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "New point cloud data-block");
2361 RNA_def_function_return(func, parm);
2362
2363 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2365 RNA_def_function_ui_description(func, "Remove a point cloud from the current blendfile");
2366 parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "Point cloud to remove");
2369 RNA_def_boolean(func,
2370 "do_unlink",
2371 true,
2372 "",
2373 "Unlink all usages of this point cloud before deleting it "
2374 "(WARNING: will also delete objects instancing that point cloud data)");
2375 RNA_def_boolean(func,
2376 "do_id_user",
2377 true,
2378 "",
2379 "Decrement user counter of all datablocks used by this point cloud data");
2380 RNA_def_boolean(func,
2381 "do_ui_user",
2382 true,
2383 "",
2384 "Make sure interface does not reference this point cloud data");
2385
2386 func = RNA_def_function(srna, "tag", "rna_Main_pointclouds_tag");
2387 parm = RNA_def_boolean(func, "value", false, "Value", "");
2389}
2390
2392{
2393 StructRNA *srna;
2394 FunctionRNA *func;
2395 PropertyRNA *parm;
2396
2397 RNA_def_property_srna(cprop, "BlendDataVolumes");
2398 srna = RNA_def_struct(brna, "BlendDataVolumes", nullptr);
2399 RNA_def_struct_sdna(srna, "Main");
2400 RNA_def_struct_ui_text(srna, "Main Volumes", "Collection of volumes");
2401
2402 func = RNA_def_function(srna, "new", "rna_Main_volumes_new");
2403 RNA_def_function_ui_description(func, "Add a new volume to the main database");
2404 parm = RNA_def_string(func, "name", "Volume", 0, "", "New name for the data-block");
2406 /* return type */
2407 parm = RNA_def_pointer(func, "volume", "Volume", "", "New volume data-block");
2408 RNA_def_function_return(func, parm);
2409
2410 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2412 RNA_def_function_ui_description(func, "Remove a volume from the current blendfile");
2413 parm = RNA_def_pointer(func, "volume", "Volume", "", "Volume to remove");
2416 RNA_def_boolean(func,
2417 "do_unlink",
2418 true,
2419 "",
2420 "Unlink all usages of this volume before deleting it "
2421 "(WARNING: will also delete objects instancing that volume data)");
2422 RNA_def_boolean(func,
2423 "do_id_user",
2424 true,
2425 "",
2426 "Decrement user counter of all datablocks used by this volume data");
2428 func, "do_ui_user", true, "", "Make sure interface does not reference this volume data");
2429
2430 func = RNA_def_function(srna, "tag", "rna_Main_volumes_tag");
2431 parm = RNA_def_boolean(func, "value", false, "Value", "");
2433}
2434
2435#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)
Definition armature.cc:538
Brush * BKE_brush_add(Main *bmain, const char *name, eObjectMode ob_mode)
Definition brush.cc:583
void BKE_brush_init_gpencil_settings(Brush *brush)
Definition brush.cc:604
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:411
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:165
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:392
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL()
void id_us_plus(ID *id)
Definition lib_id.cc:353
@ LIB_ID_FREE_NO_UI_USER
@ LIB_ID_FREE_NO_USER_REFCOUNT
void id_fake_user_clear(ID *id)
Definition lib_id.cc:399
void id_us_min(ID *id)
Definition lib_id.cc:361
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:82
Blender kernel freestyle line style functionality.
FreestyleLineStyle * BKE_linestyle_new(struct Main *bmain, const char *name)
Definition linestyle.cc:710
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
Definition main.cc:877
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:178
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:953
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:1384
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
Definition particle.cc:4119
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
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:126
bool BKE_scene_can_be_removed(const Main *bmain, const Scene *scene)
Definition scene.cc:1995
Scene * BKE_scene_add(Main *bmain, const char *name)
Definition scene.cc:2010
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:81
struct Text * BKE_text_add(struct Main *bmain, const char *name)
Definition text.cc:280
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:367
struct Tex * BKE_texture_add(struct Main *bmain, const char *name)
Definition texture.cc:374
VFont * BKE_vfont_load(Main *bmain, const char *filepath)
Definition vfont.cc:299
VFont * BKE_vfont_load_exists(Main *bmain, const char *filepath)
Definition vfont.cc:377
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
std::string data
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:51
#define BPy_END_ALLOW_THREADS
Definition BPY_extern.hh:55
void DEG_relations_tag_update(Main *bmain)
ID and Library types, which are fundamental for SDNA.
@ ID_TAG_NO_MAIN
Definition DNA_ID.h:886
#define MAX_ID_NAME
Definition DNA_ID.h:363
#define ID_REAL_USERS(id)
Definition DNA_ID.h:599
@ 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
#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:510
@ PARM_RNAPTR
Definition RNA_types.hh:513
@ PARM_REQUIRED
Definition RNA_types.hh:511
@ FUNC_USE_REPORTS
Definition RNA_types.hh:805
@ FUNC_USE_CONTEXT
Definition RNA_types.hh:804
PropertyFlag
Definition RNA_types.hh:286
@ PROP_THICK_WRAP
Definition RNA_types.hh:397
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:430
@ PROP_ENUM_NO_CONTEXT
Definition RNA_types.hh:404
@ PROP_NEVER_NULL
Definition RNA_types.hh:351
#define NC_WINDOW
Definition WM_types.hh:372
#define NC_ID
Definition WM_types.hh:392
#define NA_ADDED
Definition WM_types.hh:583
Scene scene
FreestyleLineStyle linestyle
const Depsgraph * depsgraph
#define GS(x)
StringRefNull name
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
bNodeTree * node_tree_add_tree(Main *bmain, StringRef name, StringRef idname)
Definition node.cc:4362
const EnumPropertyItem rna_enum_light_type_items[]
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_api_main(StructRNA *)
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_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:404
int tag
Definition DNA_ID.h:424
void * prev
Definition DNA_ID.h:407
void * next
Definition DNA_ID.h:407
char name[66]
Definition DNA_ID.h:415
short type
void * first
ListBase wm
Definition BKE_main.hh:276
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)