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