108static void rna_idname_validate(
const char *name,
char *r_name)
114static void rna_Main_ID_remove(
Main *bmain,
121 ID *
id =
static_cast<ID *
>(id_ptr->
data);
125 "%s '%s' is outside of main database and cannot be removed from it",
147 "%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)",
154static Camera *rna_Main_cameras_new(
Main *bmain,
const char *name)
157 rna_idname_validate(name, safe_name);
167static Scene *rna_Main_scenes_new(
Main *bmain,
const char *name)
170 rna_idname_validate(name, safe_name);
178static void rna_Main_scenes_remove(
202 rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink,
true,
true);
207 "Scene '%s' is the last local one, cannot be removed",
217 "Cannot create object in main database with an evaluated data data-block");
222 rna_idname_validate(name, safe_name);
252static Material *rna_Main_materials_new(
Main *bmain,
const char *name)
255 rna_idname_validate(name, safe_name);
265static void rna_Main_materials_gpencil_data(
Main * ,
PointerRNA *id_ptr)
267 ID *
id =
static_cast<ID *
>(id_ptr->
data);
272static void rna_Main_materials_gpencil_remove(
Main * ,
PointerRNA *id_ptr)
274 ID *
id =
static_cast<ID *
>(id_ptr->
data);
288static bNodeTree *rna_Main_nodetree_new(
Main *bmain,
const char *name,
int type)
291 rna_idname_validate(name, safe_name);
306static Mesh *rna_Main_meshes_new(
Main *bmain,
const char *name)
309 rna_idname_validate(name, safe_name);
320static Mesh *rna_Main_meshes_new_from_object(
Main *bmain,
323 bool preserve_all_data_layers,
326 switch (object->
type) {
339 bmain,
depsgraph,
object, preserve_all_data_layers);
346static Light *rna_Main_lights_new(
Main *bmain,
const char *name,
int type)
349 rna_idname_validate(name, safe_name);
360static Image *rna_Main_images_new(
Main *bmain,
371 rna_idname_validate(name, safe_name);
373 float color[4] = {0.0, 0.0, 0.0, 1.0};
391static Image *rna_Main_images_load(
Main *bmain,
393 const char *filepath,
399 if (check_existing) {
409 "Cannot read '%s': %s",
411 errno ? strerror(errno) :
RPT_(
"unsupported image format"));
421static Lattice *rna_Main_lattices_new(
Main *bmain,
const char *name)
424 rna_idname_validate(name, safe_name);
434static Curve *rna_Main_curves_new(
Main *bmain,
const char *name,
int type)
437 rna_idname_validate(name, safe_name);
447static MetaBall *rna_Main_metaballs_new(
Main *bmain,
const char *name)
450 rna_idname_validate(name, safe_name);
460static VFont *rna_Main_fonts_load(
Main *bmain,
462 const char *filepath,
468 if (check_existing) {
478 "Cannot read '%s': %s",
480 errno ? strerror(errno) :
RPT_(
"unsupported font format"));
488static Tex *rna_Main_textures_new(
Main *bmain,
const char *name,
int type)
491 rna_idname_validate(name, safe_name);
502static Brush *rna_Main_brushes_new(
Main *bmain,
const char *name,
int mode)
505 rna_idname_validate(name, safe_name);
515static void rna_Main_brush_gpencil_data(
Main * ,
PointerRNA *id_ptr)
517 ID *
id =
static_cast<ID *
>(id_ptr->
data);
522static World *rna_Main_worlds_new(
Main *bmain,
const char *name)
525 rna_idname_validate(name, safe_name);
535static Collection *rna_Main_collections_new(
Main *bmain,
const char *name)
538 rna_idname_validate(name, safe_name);
547static Speaker *rna_Main_speakers_new(
Main *bmain,
const char *name)
550 rna_idname_validate(name, safe_name);
560static bSound *rna_Main_sounds_load(
Main *bmain,
const char *name,
bool check_existing)
564 if (check_existing) {
578static Text *rna_Main_texts_new(
Main *bmain,
const char *name)
581 rna_idname_validate(name, safe_name);
590static Text *rna_Main_texts_load(
Main *bmain,
592 const char *filepath,
603 "Cannot read '%s': %s",
605 errno ? strerror(errno) :
RPT_(
"unable to load text"));
613static bArmature *rna_Main_armatures_new(
Main *bmain,
const char *name)
616 rna_idname_validate(name, safe_name);
626static bAction *rna_Main_actions_new(
Main *bmain,
const char *name)
629 rna_idname_validate(name, safe_name);
643 rna_idname_validate(name, safe_name);
653static Palette *rna_Main_palettes_new(
Main *bmain,
const char *name)
656 rna_idname_validate(name, safe_name);
668 const char *filepath,
675 if (check_existing) {
682 if (clip !=
nullptr) {
688 "Cannot read '%s': %s",
690 errno ? strerror(errno) :
RPT_(
"unable to load movie clip"));
700static Mask *rna_Main_mask_new(
Main *bmain,
const char *name)
703 rna_idname_validate(name, safe_name);
716 rna_idname_validate(name, safe_name);
726static LightProbe *rna_Main_lightprobe_new(
Main *bmain,
const char *name,
int type)
729 rna_idname_validate(name, safe_name);
742static bGPdata *rna_Main_annotations_new(
Main *bmain,
const char *name)
745 rna_idname_validate(name, safe_name);
755static GreasePencil *rna_Main_grease_pencils_new(
Main *bmain,
const char *name)
758 rna_idname_validate(name, safe_name);
766 return grease_pencil;
769static Curves *rna_Main_hair_curves_new(
Main *bmain,
const char *name)
772 rna_idname_validate(name, safe_name);
782static PointCloud *rna_Main_pointclouds_new(
Main *bmain,
const char *name)
785 rna_idname_validate(name, safe_name);
795static Volume *rna_Main_volumes_new(
Main *bmain,
const char *name)
798 rna_idname_validate(name, safe_name);
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) \
812 BKE_main_id_tag_listbase(&bmain->_listbase_name, ID_TAG_DOIT, value); \
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)
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)
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)
855# undef RNA_MAIN_ID_TAG_FUNCS_DEF
870 func,
"filepath",
nullptr, 0,
"",
"File path to load image from");
890 parm =
RNA_def_string(func,
"name",
"Camera", 0,
"",
"New name for the data-block");
893 parm =
RNA_def_pointer(func,
"camera",
"Camera",
"",
"New camera data-block");
899 parm =
RNA_def_pointer(func,
"camera",
"Camera",
"",
"Camera to remove");
906 "Unlink all usages of this camera before deleting it "
907 "(WARNING: will also delete objects instancing that camera data)");
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");
934 parm =
RNA_def_string(func,
"name",
"Scene", 0,
"",
"New name for the data-block");
937 parm =
RNA_def_pointer(func,
"scene",
"Scene",
"",
"New scene data-block");
947 func,
"do_unlink",
true,
"",
"Unlink all usages of this scene before deleting it");
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");
974 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"New object data-block");
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");
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");
1011 parm =
RNA_def_string(func,
"name",
"Material", 0,
"",
"New name for the data-block");
1014 parm =
RNA_def_pointer(func,
"material",
"Material",
"",
"New material data-block");
1017 func =
RNA_def_function(srna,
"create_gpencil_data",
"rna_Main_materials_gpencil_data");
1022 func =
RNA_def_function(srna,
"remove_gpencil_data",
"rna_Main_materials_gpencil_remove");
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");
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");
1054 {0,
"DUMMY", 0,
"",
""},
1055 {0,
nullptr, 0,
nullptr,
nullptr},
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");
1071 parm =
RNA_def_pointer(func,
"tree",
"NodeTree",
"",
"New node tree data-block");
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");
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");
1107 parm =
RNA_def_string(func,
"name",
"Mesh", 0,
"",
"New name for the data-block");
1110 parm =
RNA_def_pointer(func,
"mesh",
"Mesh",
"",
"New mesh data-block");
1113 func =
RNA_def_function(srna,
"new_from_object",
"rna_Main_meshes_new_from_object");
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");
1122 "preserve_all_data_layers",
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.");
1133 "Evaluated dependency graph which is required when preserve_all_data_layers is true");
1138 "Mesh created from object, remove it if it is only used for export");
1151 "Unlink all usages of this mesh before deleting it "
1152 "(WARNING: will also delete objects instancing that mesh data)");
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");
1179 parm =
RNA_def_string(func,
"name",
"Light", 0,
"",
"New name for the data-block");
1185 parm =
RNA_def_pointer(func,
"light",
"Light",
"",
"New light data-block");
1191 parm =
RNA_def_pointer(func,
"light",
"Light",
"",
"Light to remove");
1198 "Unlink all usages of this light before deleting it "
1199 "(WARNING: will also delete objects instancing that light data)");
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");
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");
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");
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);
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");
1303 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"New image data-block");
1310 func,
"filepath",
"File Path", 0,
"",
"Path of the file to load");
1316 "Using existing data-block if this file is already loaded");
1318 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"New image data-block");
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");
1352 parm =
RNA_def_string(func,
"name",
"Lattice", 0,
"",
"New name for the data-block");
1355 parm =
RNA_def_pointer(func,
"lattice",
"Lattice",
"",
"New lattice data-block");
1361 parm =
RNA_def_pointer(func,
"lattice",
"Lattice",
"",
"Lattice to remove");
1368 "Unlink all usages of this lattice before deleting it "
1369 "(WARNING: will also delete objects instancing that lattice data)");
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");
1395 parm =
RNA_def_string(func,
"name",
"Curve", 0,
"",
"New name for the data-block");
1401 parm =
RNA_def_pointer(func,
"curve",
"Curve",
"",
"New curve data-block");
1407 parm =
RNA_def_pointer(func,
"curve",
"Curve",
"",
"Curve to remove");
1414 "Unlink all usages of this curve before deleting it "
1415 "(WARNING: will also delete objects instancing that curve data)");
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");
1441 parm =
RNA_def_string(func,
"name",
"MetaBall", 0,
"",
"New name for the data-block");
1444 parm =
RNA_def_pointer(func,
"metaball",
"MetaBall",
"",
"New metaball data-block");
1450 parm =
RNA_def_pointer(func,
"metaball",
"MetaBall",
"",
"Metaball to remove");
1457 "Unlink all usages of this metaball before deleting it "
1458 "(WARNING: will also delete objects instancing that metaball data)");
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");
1486 func,
"filepath",
"File Path", 0,
"",
"path of the font to load");
1492 "Using existing data-block if this file is already loaded");
1494 parm =
RNA_def_pointer(func,
"vfont",
"VectorFont",
"",
"New font data-block");
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");
1527 parm =
RNA_def_string(func,
"name",
"Texture", 0,
"",
"New name for the data-block");
1533 parm =
RNA_def_pointer(func,
"texture",
"Texture",
"",
"New texture data-block");
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");
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");
1569 parm =
RNA_def_string(func,
"name",
"Brush", 0,
"",
"New name for the data-block");
1576 "Paint Mode for the new brush");
1578 parm =
RNA_def_pointer(func,
"brush",
"Brush",
"",
"New brush data-block");
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");
1598 func =
RNA_def_function(srna,
"create_gpencil_data",
"rna_Main_brush_gpencil_data");
1617 parm =
RNA_def_string(func,
"name",
"World", 0,
"",
"New name for the data-block");
1620 parm =
RNA_def_pointer(func,
"world",
"World",
"",
"New world data-block");
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");
1654 parm =
RNA_def_string(func,
"name",
"Collection", 0,
"",
"New name for the data-block");
1657 parm =
RNA_def_pointer(func,
"collection",
"Collection",
"",
"New collection data-block");
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");
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");
1694 parm =
RNA_def_string(func,
"name",
"Speaker", 0,
"",
"New name for the data-block");
1697 parm =
RNA_def_pointer(func,
"speaker",
"Speaker",
"",
"New speaker data-block");
1703 parm =
RNA_def_pointer(func,
"speaker",
"Speaker",
"",
"Speaker to remove");
1710 "Unlink all usages of this speaker before deleting it "
1711 "(WARNING: will also delete objects instancing that speaker data)");
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");
1738 parm =
RNA_def_string(func,
"name",
"Text", 0,
"",
"New name for the data-block");
1741 parm =
RNA_def_pointer(func,
"text",
"Text",
"",
"New text data-block");
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");
1762 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
1765 func,
"internal",
false,
"Make internal",
"Make text file internal after loading");
1767 parm =
RNA_def_pointer(func,
"text",
"Text",
"",
"New text data-block");
1790 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
1796 "Using existing data-block if this file is already loaded");
1798 parm =
RNA_def_pointer(func,
"sound",
"Sound",
"",
"New text data-block");
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");
1832 parm =
RNA_def_string(func,
"name",
"Armature", 0,
"",
"New name for the data-block");
1835 parm =
RNA_def_pointer(func,
"armature",
"Armature",
"",
"New armature data-block");
1841 parm =
RNA_def_pointer(func,
"armature",
"Armature",
"",
"Armature to remove");
1848 "Unlink all usages of this armature before deleting it "
1849 "(WARNING: will also delete objects instancing that armature data)");
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");
1875 parm =
RNA_def_string(func,
"name",
"Action", 0,
"",
"New name for the data-block");
1878 parm =
RNA_def_pointer(func,
"action",
"Action",
"",
"New action data-block");
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");
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");
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");
1920 func,
"particle",
"ParticleSettings",
"",
"New particle settings data-block");
1926 func,
"Remove a particle settings instance from the current blendfile");
1927 parm =
RNA_def_pointer(func,
"particle",
"ParticleSettings",
"",
"Particle Settings to remove");
1934 "Unlink all usages of those particle settings before deleting them");
1939 "Decrement user counter of all datablocks used by this particle settings");
1944 "Make sure interface does not reference this particle settings");
1964 parm =
RNA_def_string(func,
"name",
"Palette", 0,
"",
"New name for the data-block");
1967 parm =
RNA_def_pointer(func,
"palette",
"Palette",
"",
"New palette data-block");
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");
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");
2037 parm =
RNA_def_string(func,
"name",
"GreasePencil", 0,
"",
"New name for the data-block");
2040 parm =
RNA_def_pointer(func,
"grease_pencil",
"GreasePencil",
"",
"New annotation data-block");
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");
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");
2067 srna =
RNA_def_struct(brna,
"BlendDataGreasePencilsV3",
nullptr);
2077 parm =
RNA_def_string(func,
"name",
"GreasePencil", 0,
"",
"New name for the data-block");
2081 func,
"grease_pencil",
"GreasePencilv3",
"",
"New grease pencil data-block");
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");
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");
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");
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");
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");
2148 "Using existing data-block if this file is already loaded");
2150 parm =
RNA_def_pointer(func,
"clip",
"MovieClip",
"",
"New movie clip data-block");
2173 func,
"name",
nullptr,
MAX_ID_NAME - 2,
"Mask",
"Name of new mask data-block");
2176 parm =
RNA_def_pointer(func,
"mask",
"Mask",
"",
"New mask data-block");
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");
2211 parm =
RNA_def_string(func,
"name",
"FreestyleLineStyle", 0,
"",
"New name for the data-block");
2214 parm =
RNA_def_pointer(func,
"linestyle",
"FreestyleLineStyle",
"",
"New line style data-block");
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");
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");
2263 parm =
RNA_def_string(func,
"name",
"Probe", 0,
"",
"New name for the data-block");
2269 parm =
RNA_def_pointer(func,
"lightprobe",
"LightProbe",
"",
"New light probe data-block");
2275 parm =
RNA_def_pointer(func,
"lightprobe",
"LightProbe",
"",
"Light probe to remove");
2282 "Unlink all usages of this light probe before deleting it "
2283 "(WARNING: will also delete objects instancing that light probe data)");
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");
2310 parm =
RNA_def_string(func,
"name",
"Curves", 0,
"",
"New name for the data-block");
2313 parm =
RNA_def_pointer(func,
"curves",
"Curves",
"",
"New curves data-block");
2319 parm =
RNA_def_pointer(func,
"curves",
"Curves",
"",
"Curves data-block to remove");
2326 "Unlink all usages of this curves before deleting it "
2327 "(WARNING: will also delete objects instancing that curves data)");
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");
2354 parm =
RNA_def_string(func,
"name",
"PointCloud", 0,
"",
"New name for the data-block");
2357 parm =
RNA_def_pointer(func,
"pointcloud",
"PointCloud",
"",
"New point cloud data-block");
2363 parm =
RNA_def_pointer(func,
"pointcloud",
"PointCloud",
"",
"Point cloud to remove");
2370 "Unlink all usages of this point cloud before deleting it "
2371 "(WARNING: will also delete objects instancing that point cloud data)");
2376 "Decrement user counter of all datablocks used by this point cloud data");
2381 "Make sure interface does not reference this point cloud data");
2401 parm =
RNA_def_string(func,
"name",
"Volume", 0,
"",
"New name for the data-block");
2404 parm =
RNA_def_pointer(func,
"volume",
"Volume",
"",
"New volume data-block");
2410 parm =
RNA_def_pointer(func,
"volume",
"Volume",
"",
"Volume to remove");
2417 "Unlink all usages of this volume before deleting it "
2418 "(WARNING: will also delete objects instancing that volume data)");
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");
Blender kernel action and pose functionality.
bAction * BKE_action_add(Main *bmain, const char name[])
bArmature * BKE_armature_add(Main *bmain, const char *name)
Brush * BKE_brush_add(Main *bmain, const char *name, eObjectMode ob_mode)
void BKE_brush_init_gpencil_settings(Brush *brush)
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)
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)
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)
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL()
void id_fake_user_clear(ID *id)
@ LIB_ID_FREE_NO_USER_REFCOUNT
void BKE_id_free_ex(Main *bmain, void *idv, int flag_orig, bool use_flag_from_idtag)
General operations, lookup, etc. for blender lights.
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)
Blender kernel freestyle line style functionality.
FreestyleLineStyle * BKE_linestyle_new(struct Main *bmain, const char *name)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
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)
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)
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)
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
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)
bool BKE_scene_can_be_removed(const Main *bmain, const Scene *scene)
Scene * BKE_scene_add(Main *bmain, const char *name)
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)
struct Text * BKE_text_add(struct Main *bmain, const char *name)
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)
struct Tex * BKE_texture_add(struct Main *bmain, const char *name)
VFont * BKE_vfont_load(Main *bmain, const char *filepath)
VFont * BKE_vfont_load_exists(Main *bmain, const char *filepath)
void * BKE_volume_add(Main *bmain, const char *name)
struct World * BKE_world_add(struct Main *bmain, const char *name)
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 BPy_BEGIN_ALLOW_THREADS
#define BPy_END_ALLOW_THREADS
void DEG_relations_tag_update(Main *bmain)
ID and Library types, which are fundamental for SDNA.
#define ID_REAL_USERS(id)
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
void ED_node_tree_propagate_change(const bContext *C, Main *bmain, bNodeTree *ntree)
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)
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)
ccl_device_inline float4 mask(const int4 mask, const float4 a)
bNodeTree * node_tree_add_tree(Main *bmain, const char *name, const char *idname)
const EnumPropertyItem rna_enum_light_type_items[]
const EnumPropertyItem rna_enum_id_type_items[]
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[]
const EnumPropertyItem rna_enum_object_type_curve_items[]
const EnumPropertyItem rna_enum_texture_type_items[]
struct MaterialGPencilStyle * gp_style
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)