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
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_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,
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) {
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 wmWindow *win = CTX_wm_window(C);
183
184 if (WM_window_get_active_scene(win) == scene) {
185
186# ifdef WITH_PYTHON
188# endif
189
190 WM_window_set_active_scene(bmain, C, win, scene_new);
191
192# ifdef WITH_PYTHON
194# endif
195 }
196 }
197 rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink, true, true);
198 }
199 else {
201 RPT_ERROR,
202 "Scene '%s' is the last local one, cannot be removed",
203 scene->id.name + 2);
204 }
205}
206
207static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data)
208{
209 if (data != nullptr && (data->tag & ID_TAG_NO_MAIN)) {
211 RPT_ERROR,
212 "Cannot create object in main database with an evaluated data data-block");
213 return nullptr;
214 }
215
216 char safe_name[MAX_ID_NAME - 2];
217 rna_idname_validate(name, safe_name);
218
219 Object *ob;
220 int type = OB_EMPTY;
221
222 if (data) {
224 if (type == -1) {
225 const char *idname;
226 if (RNA_enum_id_from_value(rna_enum_id_type_items, GS(data->name), &idname) == 0) {
227 idname = "UNKNOWN";
228 }
229
230 BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for an object", idname);
231 return nullptr;
232 }
233
235 }
236
237 ob = BKE_object_add_only_object(bmain, type, safe_name);
238
239 ob->data = data;
240 BKE_object_materials_sync_length(bmain, ob, static_cast<ID *>(ob->data));
241
243
244 return ob;
245}
246
247static Material *rna_Main_materials_new(Main *bmain, const char *name)
248{
249 char safe_name[MAX_ID_NAME - 2];
250 rna_idname_validate(name, safe_name);
251
252 ID *id = (ID *)BKE_material_add(bmain, safe_name);
253 id_us_min(id);
254
256
257 return (Material *)id;
258}
259
260static void rna_Main_materials_gpencil_data(Main * /*bmain*/, PointerRNA *id_ptr)
261{
262 ID *id = static_cast<ID *>(id_ptr->data);
263 Material *ma = (Material *)id;
265}
266
267static void rna_Main_materials_gpencil_remove(Main * /*bmain*/, PointerRNA *id_ptr)
268{
269 ID *id = static_cast<ID *>(id_ptr->data);
270 Material *ma = (Material *)id;
271 if (ma->gp_style) {
273 }
274}
275
276static const EnumPropertyItem *rna_Main_nodetree_type_itemf(bContext * /*C*/,
277 PointerRNA * /*ptr*/,
278 PropertyRNA * /*prop*/,
279 bool *r_free)
280{
281 return rna_node_tree_type_itemf(nullptr, nullptr, r_free);
282}
283static bNodeTree *rna_Main_nodetree_new(Main *bmain, const char *name, int type)
284{
285 char safe_name[MAX_ID_NAME - 2];
286 rna_idname_validate(name, safe_name);
287
289 if (typeinfo) {
290 bNodeTree *ntree = blender::bke::node_tree_add_tree(bmain, safe_name, typeinfo->idname);
292
293 id_us_min(&ntree->id);
294 return ntree;
295 }
296 else {
297 return nullptr;
298 }
299}
300
301static Mesh *rna_Main_meshes_new(Main *bmain, const char *name)
302{
303 char safe_name[MAX_ID_NAME - 2];
304 rna_idname_validate(name, safe_name);
305
306 Mesh *mesh = BKE_mesh_add(bmain, safe_name);
307 id_us_min(&mesh->id);
308
310
311 return mesh;
312}
313
314/* copied from Mesh_getFromObject and adapted to RNA interface */
315static Mesh *rna_Main_meshes_new_from_object(Main *bmain,
317 Object *object,
318 bool preserve_all_data_layers,
319 Depsgraph *depsgraph)
320{
321 switch (object->type) {
322 case OB_FONT:
323 case OB_CURVES_LEGACY:
324 case OB_SURF:
325 case OB_MBALL:
326 case OB_MESH:
327 break;
328 default:
329 BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
330 return nullptr;
331 }
332
334 bmain, depsgraph, object, preserve_all_data_layers);
335
337
338 return mesh;
339}
340
341static Light *rna_Main_lights_new(Main *bmain, const char *name, int type)
342{
343 char safe_name[MAX_ID_NAME - 2];
344 rna_idname_validate(name, safe_name);
345
346 Light *lamp = BKE_light_add(bmain, safe_name);
347 lamp->type = type;
348 id_us_min(&lamp->id);
349
351
352 return lamp;
353}
354
355static Image *rna_Main_images_new(Main *bmain,
356 const char *name,
357 int width,
358 int height,
359 bool alpha,
360 bool float_buffer,
361 bool stereo3d,
362 bool is_data,
363 bool tiled)
364{
365 char safe_name[MAX_ID_NAME - 2];
366 rna_idname_validate(name, safe_name);
367
368 float color[4] = {0.0, 0.0, 0.0, 1.0};
369 Image *image = BKE_image_add_generated(bmain,
370 width,
371 height,
372 safe_name,
373 alpha ? 32 : 24,
374 float_buffer,
375 0,
376 color,
377 stereo3d,
378 is_data,
379 tiled);
380 id_us_min(&image->id);
381
383
384 return image;
385}
386static Image *rna_Main_images_load(Main *bmain,
388 const char *filepath,
389 bool check_existing)
390{
391 Image *ima;
392
393 errno = 0;
394 if (check_existing) {
395 ima = BKE_image_load_exists(bmain, filepath);
396 }
397 else {
398 ima = BKE_image_load(bmain, filepath);
399 }
400
401 if (!ima) {
403 RPT_ERROR,
404 "Cannot read '%s': %s",
405 filepath,
406 errno ? strerror(errno) : RPT_("unsupported image format"));
407 }
408
409 id_us_min((ID *)ima);
410
412
413 return ima;
414}
415
416static Lattice *rna_Main_lattices_new(Main *bmain, const char *name)
417{
418 char safe_name[MAX_ID_NAME - 2];
419 rna_idname_validate(name, safe_name);
420
421 Lattice *lt = BKE_lattice_add(bmain, safe_name);
422 id_us_min(&lt->id);
423
425
426 return lt;
427}
428
429static Curve *rna_Main_curves_new(Main *bmain, const char *name, int type)
430{
431 char safe_name[MAX_ID_NAME - 2];
432 rna_idname_validate(name, safe_name);
433
434 Curve *cu = BKE_curve_add(bmain, safe_name, type);
435 id_us_min(&cu->id);
436
438
439 return cu;
440}
441
442static MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name)
443{
444 char safe_name[MAX_ID_NAME - 2];
445 rna_idname_validate(name, safe_name);
446
447 MetaBall *mb = BKE_mball_add(bmain, safe_name);
448 id_us_min(&mb->id);
449
451
452 return mb;
453}
454
455static VFont *rna_Main_fonts_load(Main *bmain,
457 const char *filepath,
458 bool check_existing)
459{
460 VFont *font;
461 errno = 0;
462
463 if (check_existing) {
464 font = BKE_vfont_load_exists(bmain, filepath);
465 }
466 else {
467 font = BKE_vfont_load(bmain, filepath);
468 }
469
470 if (!font) {
472 RPT_ERROR,
473 "Cannot read '%s': %s",
474 filepath,
475 errno ? strerror(errno) : RPT_("unsupported font format"));
476 }
477
479
480 return font;
481}
482
483static Tex *rna_Main_textures_new(Main *bmain, const char *name, int type)
484{
485 char safe_name[MAX_ID_NAME - 2];
486 rna_idname_validate(name, safe_name);
487
488 Tex *tex = BKE_texture_add(bmain, safe_name);
489 BKE_texture_type_set(tex, type);
490 id_us_min(&tex->id);
491
493
494 return tex;
495}
496
497static Brush *rna_Main_brushes_new(Main *bmain, const char *name, int mode)
498{
499 char safe_name[MAX_ID_NAME - 2];
500 rna_idname_validate(name, safe_name);
501
502 Brush *brush = BKE_brush_add(bmain, safe_name, eObjectMode(mode));
503 id_us_min(&brush->id);
504
506
507 return brush;
508}
509
510static void rna_Main_brush_gpencil_data(Main * /*bmain*/, PointerRNA *id_ptr)
511{
512 ID *id = static_cast<ID *>(id_ptr->data);
513 Brush *brush = reinterpret_cast<Brush *>(id);
515}
516
517static World *rna_Main_worlds_new(Main *bmain, const char *name)
518{
519 char safe_name[MAX_ID_NAME - 2];
520 rna_idname_validate(name, safe_name);
521
522 World *world = BKE_world_add(bmain, safe_name);
523 id_us_min(&world->id);
524
526
527 return world;
528}
529
530static Collection *rna_Main_collections_new(Main *bmain, const char *name)
531{
532 char safe_name[MAX_ID_NAME - 2];
533 rna_idname_validate(name, safe_name);
534
535 Collection *collection = BKE_collection_add(bmain, nullptr, safe_name);
536
538
539 return collection;
540}
541
542static Speaker *rna_Main_speakers_new(Main *bmain, const char *name)
543{
544 char safe_name[MAX_ID_NAME - 2];
545 rna_idname_validate(name, safe_name);
546
547 Speaker *speaker = BKE_speaker_add(bmain, safe_name);
548 id_us_min(&speaker->id);
549
551
552 return speaker;
553}
554
555static bSound *rna_Main_sounds_load(Main *bmain, const char *name, bool check_existing)
556{
557 bSound *sound;
558
559 if (check_existing) {
560 sound = BKE_sound_new_file_exists(bmain, name);
561 }
562 else {
563 sound = BKE_sound_new_file(bmain, name);
564 }
565
566 id_us_min(&sound->id);
567
569
570 return sound;
571}
572
573static Text *rna_Main_texts_new(Main *bmain, const char *name)
574{
575 char safe_name[MAX_ID_NAME - 2];
576 rna_idname_validate(name, safe_name);
577
578 Text *text = BKE_text_add(bmain, safe_name);
579
581
582 return text;
583}
584
585static Text *rna_Main_texts_load(Main *bmain,
587 const char *filepath,
588 bool is_internal)
589{
590 Text *txt;
591
592 errno = 0;
593 txt = BKE_text_load_ex(bmain, filepath, BKE_main_blendfile_path(bmain), is_internal);
594
595 if (!txt) {
597 RPT_ERROR,
598 "Cannot read '%s': %s",
599 filepath,
600 errno ? strerror(errno) : RPT_("unable to load text"));
601 }
602
604
605 return txt;
606}
607
608static bArmature *rna_Main_armatures_new(Main *bmain, const char *name)
609{
610 char safe_name[MAX_ID_NAME - 2];
611 rna_idname_validate(name, safe_name);
612
613 bArmature *arm = BKE_armature_add(bmain, safe_name);
614 id_us_min(&arm->id);
615
617
618 return arm;
619}
620
621static bAction *rna_Main_actions_new(Main *bmain, const char *name)
622{
623 char safe_name[MAX_ID_NAME - 2];
624 rna_idname_validate(name, safe_name);
625
626 bAction *act = BKE_action_add(bmain, safe_name);
627 id_fake_user_clear(&act->id);
628 id_us_min(&act->id);
629
631
632 return act;
633}
634
635static ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
636{
637 char safe_name[MAX_ID_NAME - 2];
638 rna_idname_validate(name, safe_name);
639
640 ParticleSettings *part = BKE_particlesettings_add(bmain, safe_name);
641 id_us_min(&part->id);
642
644
645 return part;
646}
647
648static Palette *rna_Main_palettes_new(Main *bmain, const char *name)
649{
650 char safe_name[MAX_ID_NAME - 2];
651 rna_idname_validate(name, safe_name);
652
653 Palette *palette = BKE_palette_add(bmain, safe_name);
654 id_us_min(&palette->id);
655
657
658 return (Palette *)palette;
659}
660
661static MovieClip *rna_Main_movieclip_load(Main *bmain,
663 const char *filepath,
664 bool check_existing)
665{
666 MovieClip *clip;
667
668 errno = 0;
669
670 if (check_existing) {
671 clip = BKE_movieclip_file_add_exists(bmain, filepath);
672 }
673 else {
674 clip = BKE_movieclip_file_add(bmain, filepath);
675 }
676
677 if (clip != nullptr) {
679 }
680 else {
682 RPT_ERROR,
683 "Cannot read '%s': %s",
684 filepath,
685 errno ? strerror(errno) : RPT_("unable to load movie clip"));
686 }
687
688 id_us_min((ID *)clip);
689
691
692 return clip;
693}
694
695static Mask *rna_Main_mask_new(Main *bmain, const char *name)
696{
697 char safe_name[MAX_ID_NAME - 2];
698 rna_idname_validate(name, safe_name);
699
700 Mask *mask = BKE_mask_new(bmain, safe_name);
701 id_us_min(&mask->id);
702
704
705 return mask;
706}
707
708static FreestyleLineStyle *rna_Main_linestyles_new(Main *bmain, const char *name)
709{
710 char safe_name[MAX_ID_NAME - 2];
711 rna_idname_validate(name, safe_name);
712
713 FreestyleLineStyle *linestyle = BKE_linestyle_new(bmain, safe_name);
714 id_us_min(&linestyle->id);
715
717
718 return linestyle;
719}
720
721static LightProbe *rna_Main_lightprobe_new(Main *bmain, const char *name, int type)
722{
723 char safe_name[MAX_ID_NAME - 2];
724 rna_idname_validate(name, safe_name);
725
726 LightProbe *probe = BKE_lightprobe_add(bmain, safe_name);
727
728 BKE_lightprobe_type_set(probe, type);
729
730 id_us_min(&probe->id);
731
733
734 return probe;
735}
736
737static bGPdata *rna_Main_annotations_new(Main *bmain, const char *name)
738{
739 char safe_name[MAX_ID_NAME - 2];
740 rna_idname_validate(name, safe_name);
741
742 bGPdata *gpd = BKE_gpencil_data_addnew(bmain, safe_name);
743 id_us_min(&gpd->id);
744
746
747 return gpd;
748}
749
750static GreasePencil *rna_Main_grease_pencils_new(Main *bmain, const char *name)
751{
752 char safe_name[MAX_ID_NAME - 2];
753 rna_idname_validate(name, safe_name);
754
755 GreasePencil *grease_pencil = BKE_grease_pencil_add(bmain, safe_name);
756 id_us_min(&grease_pencil->id);
757
759
760 return grease_pencil;
761}
762
763static Curves *rna_Main_hair_curves_new(Main *bmain, const char *name)
764{
765 char safe_name[MAX_ID_NAME - 2];
766 rna_idname_validate(name, safe_name);
767
768 Curves *curves = BKE_curves_add(bmain, safe_name);
769 id_us_min(&curves->id);
770
772
773 return curves;
774}
775
776static PointCloud *rna_Main_pointclouds_new(Main *bmain, const char *name)
777{
778 char safe_name[MAX_ID_NAME - 2];
779 rna_idname_validate(name, safe_name);
780
781 PointCloud *pointcloud = BKE_pointcloud_add(bmain, safe_name);
782 id_us_min(&pointcloud->id);
783
785
786 return pointcloud;
787}
788
789static Volume *rna_Main_volumes_new(Main *bmain, const char *name)
790{
791 char safe_name[MAX_ID_NAME - 2];
792 rna_idname_validate(name, safe_name);
793
794 Volume *volume = BKE_volume_add(bmain, safe_name);
795 id_us_min(&volume->id);
796
798
799 return volume;
800}
801
802/* tag functions, all the same */
803# define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
804 static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \
805 { \
806 BKE_main_id_tag_listbase(&bmain->_listbase_name, ID_TAG_DOIT, value); \
807 }
808
809RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras, ID_CA)
810RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes, ID_SCE)
811RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects, ID_OB)
812RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials, ID_MA)
813RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees, ID_NT)
814RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes, ID_ME)
815RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights, ID_LA)
816RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries, ID_LI)
817RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens, ID_SCR)
818RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM)
819RNA_MAIN_ID_TAG_FUNCS_DEF(images, images, ID_IM)
820RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices, ID_LT)
821RNA_MAIN_ID_TAG_FUNCS_DEF(curves, curves, ID_CU_LEGACY)
822RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs, ID_MB)
823RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts, ID_VF)
824RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures, ID_TE)
825RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brushes, ID_BR)
826RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds, ID_WO)
827RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections, ID_GR)
828// RNA_MAIN_ID_TAG_FUNCS_DEF(shape_keys, key, ID_KE)
829RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts, ID_TXT)
830RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers, ID_SPK)
831RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds, ID_SO)
832RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures, ID_AR)
833RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions, ID_AC)
834RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles, ID_PA)
835RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL)
836RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils, ID_GD_LEGACY)
837RNA_MAIN_ID_TAG_FUNCS_DEF(grease_pencils, grease_pencils, ID_GP)
838RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips, ID_MC)
839RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks, ID_MSK)
840RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles, ID_LS)
841RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF)
842RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC)
843RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS)
844RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP)
845RNA_MAIN_ID_TAG_FUNCS_DEF(hair_curves, hair_curves, ID_CV)
846RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT)
847RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO)
848
849# undef RNA_MAIN_ID_TAG_FUNCS_DEF
850
851#else
852
853void RNA_api_main(StructRNA * /*srna*/)
854{
855# if 0
856 FunctionRNA *func;
857 PropertyRNA *parm;
858
859 /* maybe we want to add functions in 'bpy.data' still?
860 * for now they are all in collections bpy.data.images.new(...) */
861 func = RNA_def_function(srna, "add_image", "rna_Main_add_image");
862 RNA_def_function_ui_description(func, "Add a new image");
864 func, "filepath", nullptr, 0, "", "File path to load image from");
866 parm = RNA_def_pointer(func, "image", "Image", "", "New image");
867 RNA_def_function_return(func, parm);
868# endif
869}
870
872{
873 StructRNA *srna;
874 FunctionRNA *func;
875 PropertyRNA *parm;
876
877 RNA_def_property_srna(cprop, "BlendDataCameras");
878 srna = RNA_def_struct(brna, "BlendDataCameras", nullptr);
879 RNA_def_struct_sdna(srna, "Main");
880 RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras");
881
882 func = RNA_def_function(srna, "new", "rna_Main_cameras_new");
883 RNA_def_function_ui_description(func, "Add a new camera to the main database");
884 parm = RNA_def_string(func, "name", "Camera", 0, "", "New name for the data-block");
886 /* return type */
887 parm = RNA_def_pointer(func, "camera", "Camera", "", "New camera data-block");
888 RNA_def_function_return(func, parm);
889
890 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
892 RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
893 parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
896 RNA_def_boolean(func,
897 "do_unlink",
898 true,
899 "",
900 "Unlink all usages of this camera before deleting it "
901 "(WARNING: will also delete objects instancing that camera data)");
902 RNA_def_boolean(func,
903 "do_id_user",
904 true,
905 "",
906 "Decrement user counter of all datablocks used by this camera");
908 func, "do_ui_user", true, "", "Make sure interface does not reference this camera");
909
910 func = RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
911 parm = RNA_def_boolean(func, "value", false, "Value", "");
913}
914
916{
917 StructRNA *srna;
918 FunctionRNA *func;
919 PropertyRNA *parm;
920
921 RNA_def_property_srna(cprop, "BlendDataScenes");
922 srna = RNA_def_struct(brna, "BlendDataScenes", nullptr);
923 RNA_def_struct_sdna(srna, "Main");
924 RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");
925
926 func = RNA_def_function(srna, "new", "rna_Main_scenes_new");
927 RNA_def_function_ui_description(func, "Add a new scene to the main database");
928 parm = RNA_def_string(func, "name", "Scene", 0, "", "New name for the data-block");
930 /* return type */
931 parm = RNA_def_pointer(func, "scene", "Scene", "", "New scene data-block");
932 RNA_def_function_return(func, parm);
933
934 func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
936 RNA_def_function_ui_description(func, "Remove a scene from the current blendfile");
937 parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
941 func, "do_unlink", true, "", "Unlink all usages of this scene before deleting it");
942
943 func = RNA_def_function(srna, "tag", "rna_Main_scenes_tag");
944 parm = RNA_def_boolean(func, "value", false, "Value", "");
946}
947
949{
950 StructRNA *srna;
951 FunctionRNA *func;
952 PropertyRNA *parm;
953
954 RNA_def_property_srna(cprop, "BlendDataObjects");
955 srna = RNA_def_struct(brna, "BlendDataObjects", nullptr);
956 RNA_def_struct_sdna(srna, "Main");
957 RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects");
958
959 func = RNA_def_function(srna, "new", "rna_Main_objects_new");
961 RNA_def_function_ui_description(func, "Add a new object to the main database");
962 parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the data-block");
964 parm = RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object");
966
967 /* return type */
968 parm = RNA_def_pointer(func, "object", "Object", "", "New object data-block");
969 RNA_def_function_return(func, parm);
970
971 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
972 RNA_def_function_ui_description(func, "Remove an object from the current blendfile");
974 parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
978 func, "do_unlink", true, "", "Unlink all usages of this object before deleting it");
979 RNA_def_boolean(func,
980 "do_id_user",
981 true,
982 "",
983 "Decrement user counter of all datablocks used by this object");
985 func, "do_ui_user", true, "", "Make sure interface does not reference this object");
986
987 func = RNA_def_function(srna, "tag", "rna_Main_objects_tag");
988 parm = RNA_def_boolean(func, "value", false, "Value", "");
990}
991
993{
994 StructRNA *srna;
995 FunctionRNA *func;
996 PropertyRNA *parm;
997
998 RNA_def_property_srna(cprop, "BlendDataMaterials");
999 srna = RNA_def_struct(brna, "BlendDataMaterials", nullptr);
1000 RNA_def_struct_sdna(srna, "Main");
1001 RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials");
1002
1003 func = RNA_def_function(srna, "new", "rna_Main_materials_new");
1004 RNA_def_function_ui_description(func, "Add a new material to the main database");
1005 parm = RNA_def_string(func, "name", "Material", 0, "", "New name for the data-block");
1007 /* return type */
1008 parm = RNA_def_pointer(func, "material", "Material", "", "New material data-block");
1009 RNA_def_function_return(func, parm);
1010
1011 func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_materials_gpencil_data");
1012 RNA_def_function_ui_description(func, "Add Grease Pencil material settings");
1013 parm = RNA_def_pointer(func, "material", "Material", "", "Material");
1015
1016 func = RNA_def_function(srna, "remove_gpencil_data", "rna_Main_materials_gpencil_remove");
1017 RNA_def_function_ui_description(func, "Remove Grease Pencil material settings");
1018 parm = RNA_def_pointer(func, "material", "Material", "", "Material");
1020
1021 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1023 RNA_def_function_ui_description(func, "Remove a material from the current blendfile");
1024 parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
1028 func, "do_unlink", true, "", "Unlink all usages of this material before deleting it");
1029 RNA_def_boolean(func,
1030 "do_id_user",
1031 true,
1032 "",
1033 "Decrement user counter of all datablocks used by this material");
1035 func, "do_ui_user", true, "", "Make sure interface does not reference this material");
1036
1037 func = RNA_def_function(srna, "tag", "rna_Main_materials_tag");
1038 parm = RNA_def_boolean(func, "value", false, "Value", "");
1040}
1042{
1043 StructRNA *srna;
1044 FunctionRNA *func;
1045 PropertyRNA *parm;
1046
1047 RNA_def_property_srna(cprop, "BlendDataNodeTrees");
1048 srna = RNA_def_struct(brna, "BlendDataNodeTrees", nullptr);
1049 RNA_def_struct_sdna(srna, "Main");
1050 RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees");
1051
1052 func = RNA_def_function(srna, "new", "rna_Main_nodetree_new");
1053 RNA_def_function_ui_description(func, "Add a new node tree to the main database");
1054 parm = RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the data-block");
1056 parm = RNA_def_enum(
1057 func, "type", rna_enum_dummy_DEFAULT_items, 0, "Type", "The type of node_group to add");
1058 RNA_def_property_enum_funcs(parm, nullptr, nullptr, "rna_Main_nodetree_type_itemf");
1060 /* return type */
1061 parm = RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree data-block");
1062 RNA_def_function_return(func, parm);
1063
1064 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1066 RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile");
1067 parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
1071 func, "do_unlink", true, "", "Unlink all usages of this node tree before deleting it");
1072 RNA_def_boolean(func,
1073 "do_id_user",
1074 true,
1075 "",
1076 "Decrement user counter of all datablocks used by this node tree");
1078 func, "do_ui_user", true, "", "Make sure interface does not reference this node tree");
1079
1080 func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
1081 parm = RNA_def_boolean(func, "value", false, "Value", "");
1083}
1085{
1086 StructRNA *srna;
1087 FunctionRNA *func;
1088 PropertyRNA *parm;
1089
1090 RNA_def_property_srna(cprop, "BlendDataMeshes");
1091 srna = RNA_def_struct(brna, "BlendDataMeshes", nullptr);
1092 RNA_def_struct_sdna(srna, "Main");
1093 RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes");
1094
1095 func = RNA_def_function(srna, "new", "rna_Main_meshes_new");
1096 RNA_def_function_ui_description(func, "Add a new mesh to the main database");
1097 parm = RNA_def_string(func, "name", "Mesh", 0, "", "New name for the data-block");
1099 /* return type */
1100 parm = RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh data-block");
1101 RNA_def_function_return(func, parm);
1102
1103 func = RNA_def_function(srna, "new_from_object", "rna_Main_meshes_new_from_object");
1105 func,
1106 "Add a new mesh created from given object (undeformed geometry if object is original, and "
1107 "final evaluated geometry, with all modifiers etc., if object is evaluated)");
1109 parm = RNA_def_pointer(func, "object", "Object", "", "Object to create mesh from");
1111 RNA_def_boolean(func,
1112 "preserve_all_data_layers",
1113 false,
1114 "",
1115 "Preserve all data layers in the mesh, like UV maps and vertex groups. "
1116 "By default Blender only computes the subset of data layers needed for viewport "
1117 "display and rendering, for better performance.");
1119 func,
1120 "depsgraph",
1121 "Depsgraph",
1122 "Dependency Graph",
1123 "Evaluated dependency graph which is required when preserve_all_data_layers is true");
1124 parm = RNA_def_pointer(func,
1125 "mesh",
1126 "Mesh",
1127 "",
1128 "Mesh created from object, remove it if it is only used for export");
1129 RNA_def_function_return(func, parm);
1130
1131 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1133 RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
1134 parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
1137 RNA_def_boolean(func,
1138 "do_unlink",
1139 true,
1140 "",
1141 "Unlink all usages of this mesh before deleting it "
1142 "(WARNING: will also delete objects instancing that mesh data)");
1143 RNA_def_boolean(func,
1144 "do_id_user",
1145 true,
1146 "",
1147 "Decrement user counter of all datablocks used by this mesh data");
1149 func, "do_ui_user", true, "", "Make sure interface does not reference this mesh data");
1150
1151 func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
1152 parm = RNA_def_boolean(func, "value", false, "Value", "");
1154}
1155
1157{
1158 StructRNA *srna;
1159 FunctionRNA *func;
1160 PropertyRNA *parm;
1161
1162 RNA_def_property_srna(cprop, "BlendDataLights");
1163 srna = RNA_def_struct(brna, "BlendDataLights", nullptr);
1164 RNA_def_struct_sdna(srna, "Main");
1165 RNA_def_struct_ui_text(srna, "Main Lights", "Collection of lights");
1166
1167 func = RNA_def_function(srna, "new", "rna_Main_lights_new");
1168 RNA_def_function_ui_description(func, "Add a new light to the main database");
1169 parm = RNA_def_string(func, "name", "Light", 0, "", "New name for the data-block");
1171 parm = RNA_def_enum(
1172 func, "type", rna_enum_light_type_items, 0, "Type", "The type of light to add");
1174 /* return type */
1175 parm = RNA_def_pointer(func, "light", "Light", "", "New light data-block");
1176 RNA_def_function_return(func, parm);
1177
1178 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1180 RNA_def_function_ui_description(func, "Remove a light from the current blendfile");
1181 parm = RNA_def_pointer(func, "light", "Light", "", "Light to remove");
1184 RNA_def_boolean(func,
1185 "do_unlink",
1186 true,
1187 "",
1188 "Unlink all usages of this light before deleting it "
1189 "(WARNING: will also delete objects instancing that light data)");
1190 RNA_def_boolean(func,
1191 "do_id_user",
1192 true,
1193 "",
1194 "Decrement user counter of all datablocks used by this light data");
1196 func, "do_ui_user", true, "", "Make sure interface does not reference this light data");
1197
1198 func = RNA_def_function(srna, "tag", "rna_Main_lights_tag");
1199 parm = RNA_def_boolean(func, "value", false, "Value", "");
1201}
1202
1204{
1205 StructRNA *srna;
1206 FunctionRNA *func;
1207 PropertyRNA *parm;
1208
1209 RNA_def_property_srna(cprop, "BlendDataLibraries");
1210 srna = RNA_def_struct(brna, "BlendDataLibraries", nullptr);
1211 RNA_def_struct_sdna(srna, "Main");
1212 RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
1213
1214 func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
1215 parm = RNA_def_boolean(func, "value", false, "Value", "");
1217
1218 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1220 RNA_def_function_ui_description(func, "Remove a library from the current blendfile");
1221 parm = RNA_def_pointer(func, "library", "Library", "", "Library to remove");
1225 func, "do_unlink", true, "", "Unlink all usages of this library before deleting it");
1226 RNA_def_boolean(func,
1227 "do_id_user",
1228 true,
1229 "",
1230 "Decrement user counter of all datablocks used by this library");
1232 func, "do_ui_user", true, "", "Make sure interface does not reference this library");
1233}
1234
1236{
1237 StructRNA *srna;
1238 FunctionRNA *func;
1239 PropertyRNA *parm;
1240
1241 RNA_def_property_srna(cprop, "BlendDataScreens");
1242 srna = RNA_def_struct(brna, "BlendDataScreens", nullptr);
1243 RNA_def_struct_sdna(srna, "Main");
1244 RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
1245
1246 func = RNA_def_function(srna, "tag", "rna_Main_screens_tag");
1247 parm = RNA_def_boolean(func, "value", false, "Value", "");
1249}
1250
1252{
1253 StructRNA *srna;
1254 FunctionRNA *func;
1255 PropertyRNA *parm;
1256
1257 RNA_def_property_srna(cprop, "BlendDataWindowManagers");
1258 srna = RNA_def_struct(brna, "BlendDataWindowManagers", nullptr);
1259 RNA_def_struct_sdna(srna, "Main");
1260 RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
1261
1262 func = RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
1263 parm = RNA_def_boolean(func, "value", false, "Value", "");
1265}
1267{
1268 StructRNA *srna;
1269 FunctionRNA *func;
1270 PropertyRNA *parm;
1271
1272 RNA_def_property_srna(cprop, "BlendDataImages");
1273 srna = RNA_def_struct(brna, "BlendDataImages", nullptr);
1274 RNA_def_struct_sdna(srna, "Main");
1275 RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
1276
1277 func = RNA_def_function(srna, "new", "rna_Main_images_new");
1278 RNA_def_function_ui_description(func, "Add a new image to the main database");
1279 parm = RNA_def_string(func, "name", "Image", 0, "", "New name for the data-block");
1281 parm = RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 1, INT_MAX);
1283 parm = RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 1, INT_MAX);
1285 RNA_def_boolean(func, "alpha", false, "Alpha", "Use alpha channel");
1287 func, "float_buffer", false, "Float Buffer", "Create an image with floating-point color");
1288 RNA_def_boolean(func, "stereo3d", false, "Stereo 3D", "Create left and right views");
1290 func, "is_data", false, "Is Data", "Create image with non-color data color space");
1291 RNA_def_boolean(func, "tiled", false, "Tiled", "Create a tiled image");
1292 /* return type */
1293 parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1294 RNA_def_function_return(func, parm);
1295
1296 func = RNA_def_function(srna, "load", "rna_Main_images_load");
1298 RNA_def_function_ui_description(func, "Load a new image into the main database");
1300 func, "filepath", "File Path", 0, "", "Path of the file to load");
1302 RNA_def_boolean(func,
1303 "check_existing",
1304 false,
1305 "",
1306 "Using existing data-block if this file is already loaded");
1307 /* return type */
1308 parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
1309 RNA_def_function_return(func, parm);
1310
1311 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1313 RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
1314 parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove");
1318 func, "do_unlink", true, "", "Unlink all usages of this image before deleting it");
1320 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this image");
1322 func, "do_ui_user", true, "", "Make sure interface does not reference this image");
1323
1324 func = RNA_def_function(srna, "tag", "rna_Main_images_tag");
1325 parm = RNA_def_boolean(func, "value", false, "Value", "");
1327}
1328
1330{
1331 StructRNA *srna;
1332 FunctionRNA *func;
1333 PropertyRNA *parm;
1334
1335 RNA_def_property_srna(cprop, "BlendDataLattices");
1336 srna = RNA_def_struct(brna, "BlendDataLattices", nullptr);
1337 RNA_def_struct_sdna(srna, "Main");
1338 RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
1339
1340 func = RNA_def_function(srna, "new", "rna_Main_lattices_new");
1341 RNA_def_function_ui_description(func, "Add a new lattice to the main database");
1342 parm = RNA_def_string(func, "name", "Lattice", 0, "", "New name for the data-block");
1344 /* return type */
1345 parm = RNA_def_pointer(func, "lattice", "Lattice", "", "New lattice data-block");
1346 RNA_def_function_return(func, parm);
1347
1348 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1350 RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
1351 parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
1354 RNA_def_boolean(func,
1355 "do_unlink",
1356 true,
1357 "",
1358 "Unlink all usages of this lattice before deleting it "
1359 "(WARNING: will also delete objects instancing that lattice data)");
1360 RNA_def_boolean(func,
1361 "do_id_user",
1362 true,
1363 "",
1364 "Decrement user counter of all datablocks used by this lattice data");
1366 func, "do_ui_user", true, "", "Make sure interface does not reference this lattice data");
1367
1368 func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
1369 parm = RNA_def_boolean(func, "value", false, "Value", "");
1371}
1373{
1374 StructRNA *srna;
1375 FunctionRNA *func;
1376 PropertyRNA *parm;
1377
1378 RNA_def_property_srna(cprop, "BlendDataCurves");
1379 srna = RNA_def_struct(brna, "BlendDataCurves", nullptr);
1380 RNA_def_struct_sdna(srna, "Main");
1381 RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
1382
1383 func = RNA_def_function(srna, "new", "rna_Main_curves_new");
1384 RNA_def_function_ui_description(func, "Add a new curve to the main database");
1385 parm = RNA_def_string(func, "name", "Curve", 0, "", "New name for the data-block");
1387 parm = RNA_def_enum(
1388 func, "type", rna_enum_object_type_curve_items, 0, "Type", "The type of curve to add");
1390 /* return type */
1391 parm = RNA_def_pointer(func, "curve", "Curve", "", "New curve data-block");
1392 RNA_def_function_return(func, parm);
1393
1394 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1396 RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
1397 parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
1400 RNA_def_boolean(func,
1401 "do_unlink",
1402 true,
1403 "",
1404 "Unlink all usages of this curve before deleting it "
1405 "(WARNING: will also delete objects instancing that curve data)");
1406 RNA_def_boolean(func,
1407 "do_id_user",
1408 true,
1409 "",
1410 "Decrement user counter of all datablocks used by this curve data");
1412 func, "do_ui_user", true, "", "Make sure interface does not reference this curve data");
1413
1414 func = RNA_def_function(srna, "tag", "rna_Main_curves_tag");
1415 parm = RNA_def_boolean(func, "value", false, "Value", "");
1417}
1419{
1420 StructRNA *srna;
1421 FunctionRNA *func;
1422 PropertyRNA *parm;
1423
1424 RNA_def_property_srna(cprop, "BlendDataMetaBalls");
1425 srna = RNA_def_struct(brna, "BlendDataMetaBalls", nullptr);
1426 RNA_def_struct_sdna(srna, "Main");
1427 RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs");
1428
1429 func = RNA_def_function(srna, "new", "rna_Main_metaballs_new");
1430 RNA_def_function_ui_description(func, "Add a new metaball to the main database");
1431 parm = RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the data-block");
1433 /* return type */
1434 parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball data-block");
1435 RNA_def_function_return(func, parm);
1436
1437 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1439 RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile");
1440 parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove");
1443 RNA_def_boolean(func,
1444 "do_unlink",
1445 true,
1446 "",
1447 "Unlink all usages of this metaball before deleting it "
1448 "(WARNING: will also delete objects instancing that metaball data)");
1449 RNA_def_boolean(func,
1450 "do_id_user",
1451 true,
1452 "",
1453 "Decrement user counter of all datablocks used by this metaball data");
1455 func, "do_ui_user", true, "", "Make sure interface does not reference this metaball data");
1456
1457 func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
1458 parm = RNA_def_boolean(func, "value", false, "Value", "");
1460}
1462{
1463 StructRNA *srna;
1464 FunctionRNA *func;
1465 PropertyRNA *parm;
1466
1467 RNA_def_property_srna(cprop, "BlendDataFonts");
1468 srna = RNA_def_struct(brna, "BlendDataFonts", nullptr);
1469 RNA_def_struct_sdna(srna, "Main");
1470 RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
1471
1472 func = RNA_def_function(srna, "load", "rna_Main_fonts_load");
1474 RNA_def_function_ui_description(func, "Load a new font into the main database");
1476 func, "filepath", "File Path", 0, "", "path of the font to load");
1478 RNA_def_boolean(func,
1479 "check_existing",
1480 false,
1481 "",
1482 "Using existing data-block if this file is already loaded");
1483 /* return type */
1484 parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "New font data-block");
1485 RNA_def_function_return(func, parm);
1486
1487 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1489 RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
1490 parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
1494 func, "do_unlink", true, "", "Unlink all usages of this font before deleting it");
1496 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this font");
1498 func, "do_ui_user", true, "", "Make sure interface does not reference this font");
1499
1500 func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
1501 parm = RNA_def_boolean(func, "value", false, "Value", "");
1503}
1505{
1506 StructRNA *srna;
1507 FunctionRNA *func;
1508 PropertyRNA *parm;
1509
1510 RNA_def_property_srna(cprop, "BlendDataTextures");
1511 srna = RNA_def_struct(brna, "BlendDataTextures", nullptr);
1512 RNA_def_struct_sdna(srna, "Main");
1513 RNA_def_struct_ui_text(srna, "Main Textures", "Collection of textures");
1514
1515 func = RNA_def_function(srna, "new", "rna_Main_textures_new");
1516 RNA_def_function_ui_description(func, "Add a new texture to the main database");
1517 parm = RNA_def_string(func, "name", "Texture", 0, "", "New name for the data-block");
1519 parm = RNA_def_enum(
1520 func, "type", rna_enum_texture_type_items, 0, "Type", "The type of texture to add");
1522 /* return type */
1523 parm = RNA_def_pointer(func, "texture", "Texture", "", "New texture data-block");
1524 RNA_def_function_return(func, parm);
1525
1526 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1528 RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
1529 parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
1533 func, "do_unlink", true, "", "Unlink all usages of this texture before deleting it");
1534 RNA_def_boolean(func,
1535 "do_id_user",
1536 true,
1537 "",
1538 "Decrement user counter of all datablocks used by this texture");
1540 func, "do_ui_user", true, "", "Make sure interface does not reference this texture");
1541
1542 func = RNA_def_function(srna, "tag", "rna_Main_textures_tag");
1543 parm = RNA_def_boolean(func, "value", false, "Value", "");
1545}
1547{
1548 StructRNA *srna;
1549 FunctionRNA *func;
1550 PropertyRNA *parm;
1551
1552 RNA_def_property_srna(cprop, "BlendDataBrushes");
1553 srna = RNA_def_struct(brna, "BlendDataBrushes", nullptr);
1554 RNA_def_struct_sdna(srna, "Main");
1555 RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
1556
1557 func = RNA_def_function(srna, "new", "rna_Main_brushes_new");
1558 RNA_def_function_ui_description(func, "Add a new brush to the main database");
1559 parm = RNA_def_string(func, "name", "Brush", 0, "", "New name for the data-block");
1561 parm = RNA_def_enum(func,
1562 "mode",
1565 "",
1566 "Paint Mode for the new brush");
1567 /* return type */
1568 parm = RNA_def_pointer(func, "brush", "Brush", "", "New brush data-block");
1569 RNA_def_function_return(func, parm);
1570
1571 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1573 RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
1574 parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
1578 func, "do_unlink", true, "", "Unlink all usages of this brush before deleting it");
1580 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this brush");
1582 func, "do_ui_user", true, "", "Make sure interface does not reference this brush");
1583
1584 func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
1585 parm = RNA_def_boolean(func, "value", false, "Value", "");
1587
1588 func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_brush_gpencil_data");
1589 RNA_def_function_ui_description(func, "Add Grease Pencil brush settings");
1590 parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush");
1592}
1593
1595{
1596 StructRNA *srna;
1597 FunctionRNA *func;
1598 PropertyRNA *parm;
1599
1600 RNA_def_property_srna(cprop, "BlendDataWorlds");
1601 srna = RNA_def_struct(brna, "BlendDataWorlds", nullptr);
1602 RNA_def_struct_sdna(srna, "Main");
1603 RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds");
1604
1605 func = RNA_def_function(srna, "new", "rna_Main_worlds_new");
1606 RNA_def_function_ui_description(func, "Add a new world to the main database");
1607 parm = RNA_def_string(func, "name", "World", 0, "", "New name for the data-block");
1609 /* return type */
1610 parm = RNA_def_pointer(func, "world", "World", "", "New world data-block");
1611 RNA_def_function_return(func, parm);
1612
1613 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1615 RNA_def_function_ui_description(func, "Remove a world from the current blendfile");
1616 parm = RNA_def_pointer(func, "world", "World", "", "World to remove");
1620 func, "do_unlink", true, "", "Unlink all usages of this world before deleting it");
1622 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this world");
1624 func, "do_ui_user", true, "", "Make sure interface does not reference this world");
1625
1626 func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
1627 parm = RNA_def_boolean(func, "value", false, "Value", "");
1629}
1630
1632{
1633 StructRNA *srna;
1634 FunctionRNA *func;
1635 PropertyRNA *parm;
1636
1637 RNA_def_property_srna(cprop, "BlendDataCollections");
1638 srna = RNA_def_struct(brna, "BlendDataCollections", nullptr);
1639 RNA_def_struct_sdna(srna, "Main");
1640 RNA_def_struct_ui_text(srna, "Main Collections", "Collection of collections");
1641
1642 func = RNA_def_function(srna, "new", "rna_Main_collections_new");
1643 RNA_def_function_ui_description(func, "Add a new collection to the main database");
1644 parm = RNA_def_string(func, "name", "Collection", 0, "", "New name for the data-block");
1646 /* return type */
1647 parm = RNA_def_pointer(func, "collection", "Collection", "", "New collection data-block");
1648 RNA_def_function_return(func, parm);
1649
1650 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1651 RNA_def_function_ui_description(func, "Remove a collection from the current blendfile");
1653 parm = RNA_def_pointer(func, "collection", "Collection", "", "Collection to remove");
1657 func, "do_unlink", true, "", "Unlink all usages of this collection before deleting it");
1658 RNA_def_boolean(func,
1659 "do_id_user",
1660 true,
1661 "",
1662 "Decrement user counter of all datablocks used by this collection");
1664 func, "do_ui_user", true, "", "Make sure interface does not reference this collection");
1665
1666 func = RNA_def_function(srna, "tag", "rna_Main_collections_tag");
1667 parm = RNA_def_boolean(func, "value", false, "Value", "");
1669}
1670
1672{
1673 StructRNA *srna;
1674 FunctionRNA *func;
1675 PropertyRNA *parm;
1676
1677 RNA_def_property_srna(cprop, "BlendDataSpeakers");
1678 srna = RNA_def_struct(brna, "BlendDataSpeakers", nullptr);
1679 RNA_def_struct_sdna(srna, "Main");
1680 RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers");
1681
1682 func = RNA_def_function(srna, "new", "rna_Main_speakers_new");
1683 RNA_def_function_ui_description(func, "Add a new speaker to the main database");
1684 parm = RNA_def_string(func, "name", "Speaker", 0, "", "New name for the data-block");
1686 /* return type */
1687 parm = RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker data-block");
1688 RNA_def_function_return(func, parm);
1689
1690 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1692 RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
1693 parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
1696 RNA_def_boolean(func,
1697 "do_unlink",
1698 true,
1699 "",
1700 "Unlink all usages of this speaker before deleting it "
1701 "(WARNING: will also delete objects instancing that speaker data)");
1702 RNA_def_boolean(func,
1703 "do_id_user",
1704 true,
1705 "",
1706 "Decrement user counter of all datablocks used by this speaker data");
1708 func, "do_ui_user", true, "", "Make sure interface does not reference this speaker data");
1709
1710 func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
1711 parm = RNA_def_boolean(func, "value", false, "Value", "");
1713}
1714
1716{
1717 StructRNA *srna;
1718 FunctionRNA *func;
1719 PropertyRNA *parm;
1720
1721 RNA_def_property_srna(cprop, "BlendDataTexts");
1722 srna = RNA_def_struct(brna, "BlendDataTexts", nullptr);
1723 RNA_def_struct_sdna(srna, "Main");
1724 RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
1725
1726 func = RNA_def_function(srna, "new", "rna_Main_texts_new");
1727 RNA_def_function_ui_description(func, "Add a new text to the main database");
1728 parm = RNA_def_string(func, "name", "Text", 0, "", "New name for the data-block");
1730 /* return type */
1731 parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1732 RNA_def_function_return(func, parm);
1733
1734 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1735 RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
1737 parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove");
1741 func, "do_unlink", true, "", "Unlink all usages of this text before deleting it");
1743 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this text");
1745 func, "do_ui_user", true, "", "Make sure interface does not reference this text");
1746
1747 /* load func */
1748 func = RNA_def_function(srna, "load", "rna_Main_texts_load");
1750 RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
1752 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1754 parm = RNA_def_boolean(
1755 func, "internal", false, "Make internal", "Make text file internal after loading");
1756 /* return type */
1757 parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
1758 RNA_def_function_return(func, parm);
1759
1760 func = RNA_def_function(srna, "tag", "rna_Main_texts_tag");
1761 parm = RNA_def_boolean(func, "value", false, "Value", "");
1763}
1764
1766{
1767 StructRNA *srna;
1768 FunctionRNA *func;
1769 PropertyRNA *parm;
1770
1771 RNA_def_property_srna(cprop, "BlendDataSounds");
1772 srna = RNA_def_struct(brna, "BlendDataSounds", nullptr);
1773 RNA_def_struct_sdna(srna, "Main");
1774 RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
1775
1776 /* load func */
1777 func = RNA_def_function(srna, "load", "rna_Main_sounds_load");
1778 RNA_def_function_ui_description(func, "Add a new sound to the main database from a file");
1780 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
1782 RNA_def_boolean(func,
1783 "check_existing",
1784 false,
1785 "",
1786 "Using existing data-block if this file is already loaded");
1787 /* return type */
1788 parm = RNA_def_pointer(func, "sound", "Sound", "", "New text data-block");
1789 RNA_def_function_return(func, parm);
1790
1791 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1793 RNA_def_function_ui_description(func, "Remove a sound from the current blendfile");
1794 parm = RNA_def_pointer(func, "sound", "Sound", "", "Sound to remove");
1798 func, "do_unlink", true, "", "Unlink all usages of this sound before deleting it");
1800 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this sound");
1802 func, "do_ui_user", true, "", "Make sure interface does not reference this sound");
1803
1804 func = RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
1805 parm = RNA_def_boolean(func, "value", false, "Value", "");
1807}
1808
1810{
1811 StructRNA *srna;
1812 FunctionRNA *func;
1813 PropertyRNA *parm;
1814
1815 RNA_def_property_srna(cprop, "BlendDataArmatures");
1816 srna = RNA_def_struct(brna, "BlendDataArmatures", nullptr);
1817 RNA_def_struct_sdna(srna, "Main");
1818 RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
1819
1820 func = RNA_def_function(srna, "new", "rna_Main_armatures_new");
1821 RNA_def_function_ui_description(func, "Add a new armature to the main database");
1822 parm = RNA_def_string(func, "name", "Armature", 0, "", "New name for the data-block");
1824 /* return type */
1825 parm = RNA_def_pointer(func, "armature", "Armature", "", "New armature data-block");
1826 RNA_def_function_return(func, parm);
1827
1828 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1830 RNA_def_function_ui_description(func, "Remove an armature from the current blendfile");
1831 parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
1834 RNA_def_boolean(func,
1835 "do_unlink",
1836 true,
1837 "",
1838 "Unlink all usages of this armature before deleting it "
1839 "(WARNING: will also delete objects instancing that armature data)");
1840 RNA_def_boolean(func,
1841 "do_id_user",
1842 true,
1843 "",
1844 "Decrement user counter of all datablocks used by this armature data");
1846 func, "do_ui_user", true, "", "Make sure interface does not reference this armature data");
1847
1848 func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
1849 parm = RNA_def_boolean(func, "value", false, "Value", "");
1851}
1853{
1854 StructRNA *srna;
1855 FunctionRNA *func;
1856 PropertyRNA *parm;
1857
1858 RNA_def_property_srna(cprop, "BlendDataActions");
1859 srna = RNA_def_struct(brna, "BlendDataActions", nullptr);
1860 RNA_def_struct_sdna(srna, "Main");
1861 RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
1862
1863 func = RNA_def_function(srna, "new", "rna_Main_actions_new");
1864 RNA_def_function_ui_description(func, "Add a new action to the main database");
1865 parm = RNA_def_string(func, "name", "Action", 0, "", "New name for the data-block");
1867 /* return type */
1868 parm = RNA_def_pointer(func, "action", "Action", "", "New action data-block");
1869 RNA_def_function_return(func, parm);
1870
1871 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1873 RNA_def_function_ui_description(func, "Remove an action from the current blendfile");
1874 parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove");
1878 func, "do_unlink", true, "", "Unlink all usages of this action before deleting it");
1879 RNA_def_boolean(func,
1880 "do_id_user",
1881 true,
1882 "",
1883 "Decrement user counter of all datablocks used by this action");
1885 func, "do_ui_user", true, "", "Make sure interface does not reference this action");
1886
1887 func = RNA_def_function(srna, "tag", "rna_Main_actions_tag");
1888 parm = RNA_def_boolean(func, "value", false, "Value", "");
1890}
1891
1893{
1894 StructRNA *srna;
1895 FunctionRNA *func;
1896 PropertyRNA *parm;
1897
1898 RNA_def_property_srna(cprop, "BlendDataParticles");
1899 srna = RNA_def_struct(brna, "BlendDataParticles", nullptr);
1900 RNA_def_struct_sdna(srna, "Main");
1901 RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
1902
1903 func = RNA_def_function(srna, "new", "rna_Main_particles_new");
1905 "Add a new particle settings instance to the main database");
1906 parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the data-block");
1908 /* return type */
1909 parm = RNA_def_pointer(
1910 func, "particle", "ParticleSettings", "", "New particle settings data-block");
1911 RNA_def_function_return(func, parm);
1912
1913 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1916 func, "Remove a particle settings instance from the current blendfile");
1917 parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
1920 RNA_def_boolean(func,
1921 "do_unlink",
1922 true,
1923 "",
1924 "Unlink all usages of those particle settings before deleting them");
1925 RNA_def_boolean(func,
1926 "do_id_user",
1927 true,
1928 "",
1929 "Decrement user counter of all datablocks used by this particle settings");
1930 RNA_def_boolean(func,
1931 "do_ui_user",
1932 true,
1933 "",
1934 "Make sure interface does not reference this particle settings");
1935
1936 func = RNA_def_function(srna, "tag", "rna_Main_particles_tag");
1937 parm = RNA_def_boolean(func, "value", false, "Value", "");
1939}
1940
1942{
1943 StructRNA *srna;
1944 FunctionRNA *func;
1945 PropertyRNA *parm;
1946
1947 RNA_def_property_srna(cprop, "BlendDataPalettes");
1948 srna = RNA_def_struct(brna, "BlendDataPalettes", nullptr);
1949 RNA_def_struct_sdna(srna, "Main");
1950 RNA_def_struct_ui_text(srna, "Main Palettes", "Collection of palettes");
1951
1952 func = RNA_def_function(srna, "new", "rna_Main_palettes_new");
1953 RNA_def_function_ui_description(func, "Add a new palette to the main database");
1954 parm = RNA_def_string(func, "name", "Palette", 0, "", "New name for the data-block");
1956 /* return type */
1957 parm = RNA_def_pointer(func, "palette", "Palette", "", "New palette data-block");
1958 RNA_def_function_return(func, parm);
1959
1960 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
1962 RNA_def_function_ui_description(func, "Remove a palette from the current blendfile");
1963 parm = RNA_def_pointer(func, "palette", "Palette", "", "Palette to remove");
1967 func, "do_unlink", true, "", "Unlink all usages of this palette before deleting it");
1968 RNA_def_boolean(func,
1969 "do_id_user",
1970 true,
1971 "",
1972 "Decrement user counter of all datablocks used by this palette");
1974 func, "do_ui_user", true, "", "Make sure interface does not reference this palette");
1975
1976 func = RNA_def_function(srna, "tag", "rna_Main_palettes_tag");
1977 parm = RNA_def_boolean(func, "value", false, "Value", "");
1979}
1981{
1982 StructRNA *srna;
1983 FunctionRNA *func;
1984 PropertyRNA *parm;
1985
1986 RNA_def_property_srna(cprop, "BlendDataCacheFiles");
1987 srna = RNA_def_struct(brna, "BlendDataCacheFiles", nullptr);
1988 RNA_def_struct_sdna(srna, "Main");
1989 RNA_def_struct_ui_text(srna, "Main Cache Files", "Collection of cache files");
1990
1991 func = RNA_def_function(srna, "tag", "rna_Main_cachefiles_tag");
1992 parm = RNA_def_boolean(func, "value", false, "Value", "");
1994}
1996{
1997 StructRNA *srna;
1998 FunctionRNA *func;
1999 PropertyRNA *parm;
2000
2001 RNA_def_property_srna(cprop, "BlendDataPaintCurves");
2002 srna = RNA_def_struct(brna, "BlendDataPaintCurves", nullptr);
2003 RNA_def_struct_sdna(srna, "Main");
2004 RNA_def_struct_ui_text(srna, "Main Paint Curves", "Collection of paint curves");
2005
2006 func = RNA_def_function(srna, "tag", "rna_Main_paintcurves_tag");
2007 parm = RNA_def_boolean(func, "value", false, "Value", "");
2009}
2011{
2012 StructRNA *srna;
2013 FunctionRNA *func;
2014 PropertyRNA *parm;
2015
2016 RNA_def_property_srna(cprop, "BlendDataGreasePencils");
2017 srna = RNA_def_struct(brna, "BlendDataGreasePencils", nullptr);
2018 RNA_def_struct_sdna(srna, "Main");
2019 RNA_def_struct_ui_text(srna, "Main Annotations", "Collection of annotations");
2020
2021 func = RNA_def_function(srna, "tag", "rna_Main_gpencils_tag");
2022 parm = RNA_def_boolean(func, "value", false, "Value", "");
2024
2025 func = RNA_def_function(srna, "new", "rna_Main_annotations_new");
2026 RNA_def_function_ui_description(func, "Add a new annotation datablock to the main database");
2027 parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the data-block");
2029 /* return type */
2030 parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "New annotation data-block");
2031 RNA_def_function_return(func, parm);
2032
2033 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2035 RNA_def_function_ui_description(func, "Remove annotation instance from the current blendfile");
2036 parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "Grease Pencil to remove");
2040 func, "do_unlink", true, "", "Unlink all usages of this annotation before deleting it");
2041 RNA_def_boolean(func,
2042 "do_id_user",
2043 true,
2044 "",
2045 "Decrement user counter of all datablocks used by this annotation");
2047 func, "do_ui_user", true, "", "Make sure interface does not reference this annotation");
2048}
2049
2051{
2052 StructRNA *srna;
2053 FunctionRNA *func;
2054 PropertyRNA *parm;
2055
2056 RNA_def_property_srna(cprop, "BlendDataGreasePencilsV3");
2057 srna = RNA_def_struct(brna, "BlendDataGreasePencilsV3", nullptr);
2058 RNA_def_struct_sdna(srna, "Main");
2059 RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of Grease Pencils");
2060
2061 func = RNA_def_function(srna, "tag", "rna_Main_grease_pencils_tag");
2062 parm = RNA_def_boolean(func, "value", false, "Value", "");
2064
2065 func = RNA_def_function(srna, "new", "rna_Main_grease_pencils_new");
2066 RNA_def_function_ui_description(func, "Add a new Grease Pencil datablock to the main database");
2067 parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the data-block");
2069 /* return type */
2070 parm = RNA_def_pointer(
2071 func, "grease_pencil", "GreasePencilv3", "", "New Grease Pencil data-block");
2072 RNA_def_function_return(func, parm);
2073
2074 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2077 "Remove a Grease Pencil instance from the current blendfile");
2078 parm = RNA_def_pointer(func, "grease_pencil", "GreasePencilv3", "", "Grease Pencil to remove");
2082 func, "do_unlink", true, "", "Unlink all usages of this Grease Pencil before deleting it");
2083 RNA_def_boolean(func,
2084 "do_id_user",
2085 true,
2086 "",
2087 "Decrement user counter of all datablocks used by this Grease Pencil");
2089 func, "do_ui_user", true, "", "Make sure interface does not reference this Grease Pencil");
2090}
2091
2093{
2094 StructRNA *srna;
2095 FunctionRNA *func;
2096 PropertyRNA *parm;
2097
2098 RNA_def_property_srna(cprop, "BlendDataMovieClips");
2099 srna = RNA_def_struct(brna, "BlendDataMovieClips", nullptr);
2100 RNA_def_struct_sdna(srna, "Main");
2101 RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips");
2102
2103 func = RNA_def_function(srna, "tag", "rna_Main_movieclips_tag");
2104 parm = RNA_def_boolean(func, "value", false, "Value", "");
2106
2107 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2109 RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile.");
2110 parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
2114 func, "do_unlink", true, "", "Unlink all usages of this movie clip before deleting it");
2115 RNA_def_boolean(func,
2116 "do_id_user",
2117 true,
2118 "",
2119 "Decrement user counter of all datablocks used by this movie clip");
2121 func, "do_ui_user", true, "", "Make sure interface does not reference this movie clip");
2122
2123 /* load func */
2124 func = RNA_def_function(srna, "load", "rna_Main_movieclip_load");
2127 func,
2128 "Add a new movie clip to the main database from a file "
2129 "(while ``check_existing`` is disabled for consistency with other load functions, "
2130 "behavior with multiple movie-clips using the same file may incorrectly generate proxies)");
2132 func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
2134 RNA_def_boolean(func,
2135 "check_existing",
2136 false,
2137 "",
2138 "Using existing data-block if this file is already loaded");
2139 /* return type */
2140 parm = RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip data-block");
2141 RNA_def_function_return(func, parm);
2142}
2143
2145{
2146 StructRNA *srna;
2147 FunctionRNA *func;
2148 PropertyRNA *parm;
2149
2150 RNA_def_property_srna(cprop, "BlendDataMasks");
2151 srna = RNA_def_struct(brna, "BlendDataMasks", nullptr);
2152 RNA_def_struct_sdna(srna, "Main");
2153 RNA_def_struct_ui_text(srna, "Main Masks", "Collection of masks");
2154
2155 func = RNA_def_function(srna, "tag", "rna_Main_masks_tag");
2156 parm = RNA_def_boolean(func, "value", false, "Value", "");
2158
2159 /* new func */
2160 func = RNA_def_function(srna, "new", "rna_Main_mask_new");
2161 RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database");
2162 parm = RNA_def_string(
2163 func, "name", nullptr, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
2165 /* return type */
2166 parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask data-block");
2167 RNA_def_function_return(func, parm);
2168
2169 /* remove func */
2170 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2172 RNA_def_function_ui_description(func, "Remove a mask from the current blendfile");
2173 parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to remove");
2177 func, "do_unlink", true, "", "Unlink all usages of this mask before deleting it");
2179 func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this mask");
2181 func, "do_ui_user", true, "", "Make sure interface does not reference this mask");
2182}
2183
2185{
2186 StructRNA *srna;
2187 FunctionRNA *func;
2188 PropertyRNA *parm;
2189
2190 RNA_def_property_srna(cprop, "BlendDataLineStyles");
2191 srna = RNA_def_struct(brna, "BlendDataLineStyles", nullptr);
2192 RNA_def_struct_sdna(srna, "Main");
2193 RNA_def_struct_ui_text(srna, "Main Line Styles", "Collection of line styles");
2194
2195 func = RNA_def_function(srna, "tag", "rna_Main_linestyle_tag");
2196 parm = RNA_def_boolean(func, "value", false, "Value", "");
2198
2199 func = RNA_def_function(srna, "new", "rna_Main_linestyles_new");
2200 RNA_def_function_ui_description(func, "Add a new line style instance to the main database");
2201 parm = RNA_def_string(func, "name", "FreestyleLineStyle", 0, "", "New name for the data-block");
2203 /* return type */
2204 parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "New line style data-block");
2205 RNA_def_function_return(func, parm);
2206
2207 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2209 RNA_def_function_ui_description(func, "Remove a line style instance from the current blendfile");
2210 parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "Line style to remove");
2214 func, "do_unlink", true, "", "Unlink all usages of this line style before deleting it");
2215 RNA_def_boolean(func,
2216 "do_id_user",
2217 true,
2218 "",
2219 "Decrement user counter of all datablocks used by this line style");
2221 func, "do_ui_user", true, "", "Make sure interface does not reference this line style");
2222}
2223
2225{
2226 StructRNA *srna;
2227 FunctionRNA *func;
2228 PropertyRNA *parm;
2229
2230 RNA_def_property_srna(cprop, "BlendDataWorkSpaces");
2231 srna = RNA_def_struct(brna, "BlendDataWorkSpaces", nullptr);
2232 RNA_def_struct_sdna(srna, "Main");
2233 RNA_def_struct_ui_text(srna, "Main Workspaces", "Collection of workspaces");
2234
2235 func = RNA_def_function(srna, "tag", "rna_Main_workspaces_tag");
2236 parm = RNA_def_boolean(func, "value", false, "Value", "");
2238}
2239
2241{
2242 StructRNA *srna;
2243 FunctionRNA *func;
2244 PropertyRNA *parm;
2245
2246 RNA_def_property_srna(cprop, "BlendDataProbes");
2247 srna = RNA_def_struct(brna, "BlendDataProbes", nullptr);
2248 RNA_def_struct_sdna(srna, "Main");
2249 RNA_def_struct_ui_text(srna, "Main Light Probes", "Collection of light probes");
2250
2251 func = RNA_def_function(srna, "new", "rna_Main_lightprobe_new");
2252 RNA_def_function_ui_description(func, "Add a new light probe to the main database");
2253 parm = RNA_def_string(func, "name", "Probe", 0, "", "New name for the data-block");
2255 parm = RNA_def_enum(
2256 func, "type", rna_enum_lightprobes_type_items, 0, "Type", "The type of light probe to add");
2258 /* return type */
2259 parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "New light probe data-block");
2260 RNA_def_function_return(func, parm);
2261
2262 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2264 RNA_def_function_ui_description(func, "Remove a light probe from the current blendfile");
2265 parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "Light probe to remove");
2268 RNA_def_boolean(func,
2269 "do_unlink",
2270 true,
2271 "",
2272 "Unlink all usages of this light probe before deleting it "
2273 "(WARNING: will also delete objects instancing that light probe data)");
2274 RNA_def_boolean(func,
2275 "do_id_user",
2276 true,
2277 "",
2278 "Decrement user counter of all datablocks used by this light probe");
2280 func, "do_ui_user", true, "", "Make sure interface does not reference this light probe");
2281
2282 func = RNA_def_function(srna, "tag", "rna_Main_lightprobes_tag");
2283 parm = RNA_def_boolean(func, "value", false, "Value", "");
2285}
2286
2288{
2289 StructRNA *srna;
2290 FunctionRNA *func;
2291 PropertyRNA *parm;
2292
2293 RNA_def_property_srna(cprop, "BlendDataHairCurves");
2294 srna = RNA_def_struct(brna, "BlendDataHairCurves", nullptr);
2295 RNA_def_struct_sdna(srna, "Main");
2296 RNA_def_struct_ui_text(srna, "Main Hair Curves", "Collection of hair curves");
2297
2298 func = RNA_def_function(srna, "new", "rna_Main_hair_curves_new");
2299 RNA_def_function_ui_description(func, "Add a new hair to the main database");
2300 parm = RNA_def_string(func, "name", "Curves", 0, "", "New name for the data-block");
2302 /* return type */
2303 parm = RNA_def_pointer(func, "curves", "Curves", "", "New curves data-block");
2304 RNA_def_function_return(func, parm);
2305
2306 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2308 RNA_def_function_ui_description(func, "Remove a curves data-block from the current blendfile");
2309 parm = RNA_def_pointer(func, "curves", "Curves", "", "Curves data-block to remove");
2312 RNA_def_boolean(func,
2313 "do_unlink",
2314 true,
2315 "",
2316 "Unlink all usages of this curves before deleting it "
2317 "(WARNING: will also delete objects instancing that curves data)");
2318 RNA_def_boolean(func,
2319 "do_id_user",
2320 true,
2321 "",
2322 "Decrement user counter of all datablocks used by this curves data");
2324 func, "do_ui_user", true, "", "Make sure interface does not reference this curves data");
2325
2326 func = RNA_def_function(srna, "tag", "rna_Main_hair_curves_tag");
2327 parm = RNA_def_boolean(func, "value", false, "Value", "");
2329}
2330
2332{
2333 StructRNA *srna;
2334 FunctionRNA *func;
2335 PropertyRNA *parm;
2336
2337 RNA_def_property_srna(cprop, "BlendDataPointClouds");
2338 srna = RNA_def_struct(brna, "BlendDataPointClouds", nullptr);
2339 RNA_def_struct_sdna(srna, "Main");
2340 RNA_def_struct_ui_text(srna, "Main Point Clouds", "Collection of point clouds");
2341
2342 func = RNA_def_function(srna, "new", "rna_Main_pointclouds_new");
2343 RNA_def_function_ui_description(func, "Add a new point cloud to the main database");
2344 parm = RNA_def_string(func, "name", "PointCloud", 0, "", "New name for the data-block");
2346 /* return type */
2347 parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "New point cloud data-block");
2348 RNA_def_function_return(func, parm);
2349
2350 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2352 RNA_def_function_ui_description(func, "Remove a point cloud from the current blendfile");
2353 parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "Point cloud to remove");
2356 RNA_def_boolean(func,
2357 "do_unlink",
2358 true,
2359 "",
2360 "Unlink all usages of this point cloud before deleting it "
2361 "(WARNING: will also delete objects instancing that point cloud data)");
2362 RNA_def_boolean(func,
2363 "do_id_user",
2364 true,
2365 "",
2366 "Decrement user counter of all datablocks used by this point cloud data");
2367 RNA_def_boolean(func,
2368 "do_ui_user",
2369 true,
2370 "",
2371 "Make sure interface does not reference this point cloud data");
2372
2373 func = RNA_def_function(srna, "tag", "rna_Main_pointclouds_tag");
2374 parm = RNA_def_boolean(func, "value", false, "Value", "");
2376}
2377
2379{
2380 StructRNA *srna;
2381 FunctionRNA *func;
2382 PropertyRNA *parm;
2383
2384 RNA_def_property_srna(cprop, "BlendDataVolumes");
2385 srna = RNA_def_struct(brna, "BlendDataVolumes", nullptr);
2386 RNA_def_struct_sdna(srna, "Main");
2387 RNA_def_struct_ui_text(srna, "Main Volumes", "Collection of volumes");
2388
2389 func = RNA_def_function(srna, "new", "rna_Main_volumes_new");
2390 RNA_def_function_ui_description(func, "Add a new volume to the main database");
2391 parm = RNA_def_string(func, "name", "Volume", 0, "", "New name for the data-block");
2393 /* return type */
2394 parm = RNA_def_pointer(func, "volume", "Volume", "", "New volume data-block");
2395 RNA_def_function_return(func, parm);
2396
2397 func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
2399 RNA_def_function_ui_description(func, "Remove a volume from the current blendfile");
2400 parm = RNA_def_pointer(func, "volume", "Volume", "", "Volume to remove");
2403 RNA_def_boolean(func,
2404 "do_unlink",
2405 true,
2406 "",
2407 "Unlink all usages of this volume before deleting it "
2408 "(WARNING: will also delete objects instancing that volume data)");
2409 RNA_def_boolean(func,
2410 "do_id_user",
2411 true,
2412 "",
2413 "Decrement user counter of all datablocks used by this volume data");
2415 func, "do_ui_user", true, "", "Make sure interface does not reference this volume data");
2416
2417 func = RNA_def_function(srna, "tag", "rna_Main_volumes_tag");
2418 parm = RNA_def_boolean(func, "value", false, "Value", "");
2420}
2421
2422#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)
wmWindow * CTX_wm_window(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
void id_fake_user_clear(ID *id)
Definition lib_id.cc:399
@ LIB_ID_FREE_NO_UI_USER
@ LIB_ID_FREE_NO_USER_REFCOUNT
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:693
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
Definition main.cc:872
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:4086
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 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: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
@ 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
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 C
Definition RandGen.cpp:29
#define NC_WINDOW
Definition WM_types.hh:372
#define NC_ID
Definition WM_types.hh:392
#define NA_ADDED
Definition WM_types.hh:583
ReportList * reports
Definition WM_types.hh:1025
BMesh const char void * data
BPy_StructRNA * depsgraph
#define MEM_SAFE_FREE(v)
#define MAX_ID_NAME
#define ID_REAL_USERS(id)
#define GS(a)
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
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:139