109static void rna_idname_validate(
const char *name,
char *r_name)
115static void rna_Main_ID_remove(
Main *bmain,
122 ID *
id =
static_cast<ID *
>(id_ptr->data);
126 "%s '%s' is outside of main database and cannot be removed from it",
136 light_probe =
reinterpret_cast<LightProbe *
>(ob->data);
149 "Cannot remove volume light probes while light probe baking is running");
156 id_ptr->invalidate();
167 id_ptr->invalidate();
173 "%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)",
180static ID *rna_Main_pack_linked_ids_hierarchy(
struct BlendData *blenddata,
193 Main *bmain =
reinterpret_cast<Main *
>(blenddata);
196 ID *packed_root_id = root_id->
newid;
199 return packed_root_id;
202static Camera *rna_Main_cameras_new(
Main *bmain,
const char *name)
205 rna_idname_validate(name, safe_name);
215static Scene *rna_Main_scenes_new(
Main *bmain,
const char *name)
218 rna_idname_validate(name, safe_name);
226static void rna_Main_scenes_remove(
230 Scene *scene =
static_cast<Scene *
>(scene_ptr->data);
236 rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink,
true,
true);
241 rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink,
true,
true);
248 "Scene '%s' is the last local one, cannot be removed",
257 "Cannot create object in main database with an evaluated data data-block");
262 rna_idname_validate(name, safe_name);
292static Material *rna_Main_materials_new(
Main *bmain,
const char *name)
295 rna_idname_validate(name, safe_name);
307static void rna_Main_materials_gpencil_data(
Main * ,
PointerRNA *id_ptr)
309 ID *
id =
static_cast<ID *
>(id_ptr->data);
310 Material *ma = id_cast<Material *>(
id);
314static void rna_Main_materials_gpencil_remove(
Main * ,
PointerRNA *id_ptr)
316 ID *
id =
static_cast<ID *
>(id_ptr->data);
317 Material *ma = id_cast<Material *>(
id);
319 MEM_SAFE_DELETE(ma->gp_style);
330static bNodeTree *rna_Main_nodetree_new(
Main *bmain,
const char *name,
int type)
333 rna_idname_validate(name, safe_name);
348static Mesh *rna_Main_meshes_new(
Main *bmain,
const char *name)
351 rna_idname_validate(name, safe_name);
362static Mesh *rna_Main_meshes_new_from_object(
Main *bmain,
365 bool preserve_all_data_layers,
366 Depsgraph *depsgraph)
381 bmain, depsgraph,
object, preserve_all_data_layers);
388static Light *rna_Main_lights_new(
Main *bmain,
const char *name,
int type)
391 rna_idname_validate(name, safe_name);
402static Image *rna_Main_images_new(
Main *bmain,
413 rna_idname_validate(name, safe_name);
415 float color[4] = {0.0, 0.0, 0.0, 1.0};
433static Image *rna_Main_images_load(
Main *bmain,
435 const char *filepath,
441 if (check_existing) {
451 "Cannot read '%s': %s",
453 errno ? strerror(errno) :
RPT_(
"unsupported image format"));
463static Lattice *rna_Main_lattices_new(
Main *bmain,
const char *name)
466 rna_idname_validate(name, safe_name);
476static Curve *rna_Main_curves_new(
Main *bmain,
const char *name,
int type)
479 rna_idname_validate(name, safe_name);
489static MetaBall *rna_Main_metaballs_new(
Main *bmain,
const char *name)
492 rna_idname_validate(name, safe_name);
502static VFont *rna_Main_fonts_load(
Main *bmain,
504 const char *filepath,
510 if (check_existing) {
520 "Cannot read '%s': %s",
522 errno ? strerror(errno) :
RPT_(
"unsupported font format"));
530static Tex *rna_Main_textures_new(
Main *bmain,
const char *name,
int type)
533 rna_idname_validate(name, safe_name);
544static Brush *rna_Main_brushes_new(
Main *bmain,
const char *name,
int mode)
547 rna_idname_validate(name, safe_name);
557static void rna_Main_brush_gpencil_data(
Main * ,
PointerRNA *id_ptr)
559 ID *
id =
static_cast<ID *
>(id_ptr->data);
564static World *rna_Main_worlds_new(
Main *bmain,
const char *name)
567 rna_idname_validate(name, safe_name);
579static Collection *rna_Main_collections_new(
Main *bmain,
const char *name)
582 rna_idname_validate(name, safe_name);
591static Speaker *rna_Main_speakers_new(
Main *bmain,
const char *name)
594 rna_idname_validate(name, safe_name);
604static bSound *rna_Main_sounds_load(
Main *bmain,
const char *name,
bool check_existing)
608 if (check_existing) {
622static Text *rna_Main_texts_new(
Main *bmain,
const char *name)
625 rna_idname_validate(name, safe_name);
634static Text *rna_Main_texts_load(
Main *bmain,
636 const char *filepath,
647 "Cannot read '%s': %s",
649 errno ? strerror(errno) :
RPT_(
"unable to load text"));
657static bArmature *rna_Main_armatures_new(
Main *bmain,
const char *name)
660 rna_idname_validate(name, safe_name);
670static bAction *rna_Main_actions_new(
Main *bmain,
const char *name)
673 rna_idname_validate(name, safe_name);
687 rna_idname_validate(name, safe_name);
697static Palette *rna_Main_palettes_new(
Main *bmain,
const char *name)
700 rna_idname_validate(name, safe_name);
707 return static_cast<Palette *
>(palette);
712 const char *filepath,
719 if (check_existing) {
726 if (clip !=
nullptr) {
732 "Cannot read '%s': %s",
734 errno ? strerror(errno) :
RPT_(
"unable to load movie clip"));
744static Mask *rna_Main_mask_new(
Main *bmain,
const char *name)
747 rna_idname_validate(name, safe_name);
760 rna_idname_validate(name, safe_name);
770static LightProbe *rna_Main_lightprobe_new(
Main *bmain,
const char *name,
int type)
773 rna_idname_validate(name, safe_name);
786static bGPdata *rna_Main_annotations_new(
Main *bmain,
const char *name)
789 rna_idname_validate(name, safe_name);
799static GreasePencil *rna_Main_grease_pencils_new(
Main *bmain,
const char *name)
802 rna_idname_validate(name, safe_name);
809 return grease_pencil;
812static Curves *rna_Main_hair_curves_new(
Main *bmain,
const char *name)
815 rna_idname_validate(name, safe_name);
825static PointCloud *rna_Main_pointclouds_new(
Main *bmain,
const char *name)
828 rna_idname_validate(name, safe_name);
838static Volume *rna_Main_volumes_new(
Main *bmain,
const char *name)
841 rna_idname_validate(name, safe_name);
852# define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
853 static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \
855 BKE_main_id_tag_listbase(&bmain->_listbase_name.cast<ID>(), ID_TAG_DOIT, value); \
858RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras,
ID_CA)
859RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes,
ID_SCE)
860RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects,
ID_OB)
861RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials,
ID_MA)
862RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees,
ID_NT)
863RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes,
ID_ME)
864RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights,
ID_LA)
865RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries,
ID_LI)
866RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens,
ID_SCR)
867RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers,
wm,
ID_WM)
868RNA_MAIN_ID_TAG_FUNCS_DEF(images, images,
ID_IM)
869RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices,
ID_LT)
871RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs,
ID_MB)
872RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts,
ID_VF)
873RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures,
ID_TE)
875RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds,
ID_WO)
876RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections,
ID_GR)
878RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts,
ID_TXT)
879RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers,
ID_SPK)
880RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds,
ID_SO)
881RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures,
ID_AR)
882RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions,
ID_AC)
883RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles,
ID_PA)
884RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes,
ID_PAL)
885RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils,
ID_GD_LEGACY)
886RNA_MAIN_ID_TAG_FUNCS_DEF(grease_pencils, grease_pencils,
ID_GP)
887RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips,
ID_MC)
888RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks,
ID_MSK)
889RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles,
ID_LS)
890RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles,
ID_CF)
891RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves,
ID_PC)
892RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces,
ID_WS)
893RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes,
ID_LP)
894RNA_MAIN_ID_TAG_FUNCS_DEF(hair_curves, hair_curves,
ID_CV)
895RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds,
ID_PT)
896RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes,
ID_VO)
898# undef RNA_MAIN_ID_TAG_FUNCS_DEF
917 func,
"filepath",
nullptr, 0,
"",
"File path to load image from");
923 func =
RNA_def_function(srna,
"pack_linked_ids_hierarchy",
"rna_Main_pack_linked_ids_hierarchy");
925 func,
"Pack the given linked ID and its dependencies into current blendfile");
927 parm =
RNA_def_pointer(func,
"root_id",
"ID",
"",
"Root linked ID to pack");
929 parm =
RNA_def_pointer(func,
"packed_id",
"ID",
"",
"The packed ID matching the given root ID");
946 parm =
RNA_def_string(func,
"name",
"Camera", 0,
"",
"New name for the data-block");
949 parm =
RNA_def_pointer(func,
"camera",
"Camera",
"",
"New camera data-block");
956 parm =
RNA_def_pointer(func,
"camera",
"Camera",
"",
"Camera to remove");
963 "Unlink all usages of this camera before deleting it "
964 "(WARNING: will also delete objects instancing that camera data)");
969 "Decrement user counter of all data-blocks used by this camera");
971 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this camera");
991 parm =
RNA_def_string(func,
"name",
"Scene", 0,
"",
"New name for the data-block");
994 parm =
RNA_def_pointer(func,
"scene",
"Scene",
"",
"New scene data-block");
1001 parm =
RNA_def_pointer(func,
"scene",
"Scene",
"",
"Scene to remove");
1005 func,
"do_unlink",
true,
"",
"Unlink all usages of this scene before deleting it");
1026 parm =
RNA_def_string(func,
"name",
"Object", 0,
"",
"New name for the data-block");
1028 parm =
RNA_def_pointer(func,
"object_data",
"ID",
"",
"Object data or None for an empty object");
1032 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"New object data-block");
1039 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"Object to remove");
1043 func,
"do_unlink",
true,
"",
"Unlink all usages of this object before deleting it");
1048 "Decrement user counter of all data-blocks used by this object");
1050 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this object");
1070 parm =
RNA_def_string(func,
"name",
"Material", 0,
"",
"New name for the data-block");
1073 parm =
RNA_def_pointer(func,
"material",
"Material",
"",
"New material data-block");
1077 func =
RNA_def_function(srna,
"create_gpencil_data",
"rna_Main_materials_gpencil_data");
1082 func =
RNA_def_function(srna,
"remove_gpencil_data",
"rna_Main_materials_gpencil_remove");
1090 parm =
RNA_def_pointer(func,
"material",
"Material",
"",
"Material to remove");
1094 func,
"do_unlink",
true,
"",
"Unlink all usages of this material before deleting it");
1099 "Decrement user counter of all data-blocks used by this material");
1101 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this material");
1120 parm =
RNA_def_string(func,
"name",
"NodeGroup", 0,
"",
"New name for the data-block");
1127 parm =
RNA_def_pointer(func,
"tree",
"NodeTree",
"",
"New node tree data-block");
1133 parm =
RNA_def_pointer(func,
"tree",
"NodeTree",
"",
"Node tree to remove");
1137 func,
"do_unlink",
true,
"",
"Unlink all usages of this node tree before deleting it");
1142 "Decrement user counter of all data-blocks used by this node tree");
1144 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this node tree");
1163 parm =
RNA_def_string(func,
"name",
"Mesh", 0,
"",
"New name for the data-block");
1166 parm =
RNA_def_pointer(func,
"mesh",
"Mesh",
"",
"New mesh data-block");
1170 func =
RNA_def_function(srna,
"new_from_object",
"rna_Main_meshes_new_from_object");
1173 "Add a new mesh created from given object (undeformed geometry if object is original, and "
1174 "final evaluated geometry, with all modifiers etc., if object is evaluated)");
1176 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"Object to create mesh from");
1179 "preserve_all_data_layers",
1182 "Preserve all data layers in the mesh, like UV maps and vertex groups. "
1183 "By default Blender only computes the subset of data layers needed for viewport "
1184 "display and rendering, for better performance.");
1190 "Evaluated dependency graph which is required when preserve_all_data_layers is true");
1195 "Mesh created from object, remove it if it is only used for export");
1209 "Unlink all usages of this mesh before deleting it "
1210 "(WARNING: will also delete objects instancing that mesh data)");
1215 "Decrement user counter of all data-blocks used by this mesh data");
1217 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this mesh data");
1237 parm =
RNA_def_string(func,
"name",
"Light", 0,
"",
"New name for the data-block");
1243 parm =
RNA_def_pointer(func,
"light",
"Light",
"",
"New light data-block");
1250 parm =
RNA_def_pointer(func,
"light",
"Light",
"",
"Light to remove");
1257 "Unlink all usages of this light before deleting it "
1258 "(WARNING: will also delete objects instancing that light data)");
1263 "Decrement user counter of all data-blocks used by this light data");
1265 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this light data");
1290 parm =
RNA_def_pointer(func,
"library",
"Library",
"",
"Library to remove");
1294 func,
"do_unlink",
true,
"",
"Unlink all usages of this library before deleting it");
1299 "Decrement user counter of all data-blocks used by this library");
1301 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this library");
1348 parm =
RNA_def_string(func,
"name",
"Image", 0,
"",
"New name for the data-block");
1356 func,
"float_buffer",
false,
"Float Buffer",
"Create an image with floating-point color");
1357 RNA_def_boolean(func,
"stereo3d",
false,
"Stereo 3D",
"Create left and right views");
1359 func,
"is_data",
false,
"Is Data",
"Create image with non-color data color space");
1360 RNA_def_boolean(func,
"tiled",
false,
"Tiled",
"Create a tiled image");
1362 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"New image data-block");
1370 func,
"filepath",
"File Path", 0,
"",
"Path of the file to load");
1376 "Using existing data-block if this file is already loaded");
1378 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"New image data-block");
1385 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"Image to remove");
1389 func,
"do_unlink",
true,
"",
"Unlink all usages of this image before deleting it");
1394 "Decrement user counter of all data-blocks used by this image");
1396 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this image");
1416 parm =
RNA_def_string(func,
"name",
"Lattice", 0,
"",
"New name for the data-block");
1419 parm =
RNA_def_pointer(func,
"lattice",
"Lattice",
"",
"New lattice data-block");
1426 parm =
RNA_def_pointer(func,
"lattice",
"Lattice",
"",
"Lattice to remove");
1433 "Unlink all usages of this lattice before deleting it "
1434 "(WARNING: will also delete objects instancing that lattice data)");
1439 "Decrement user counter of all data-blocks used by this lattice data");
1441 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this lattice data");
1460 parm =
RNA_def_string(func,
"name",
"Curve", 0,
"",
"New name for the data-block");
1466 parm =
RNA_def_pointer(func,
"curve",
"Curve",
"",
"New curve data-block");
1473 parm =
RNA_def_pointer(func,
"curve",
"Curve",
"",
"Curve to remove");
1480 "Unlink all usages of this curve before deleting it "
1481 "(WARNING: will also delete objects instancing that curve data)");
1486 "Decrement user counter of all data-blocks used by this curve data");
1488 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this curve data");
1507 parm =
RNA_def_string(func,
"name",
"MetaBall", 0,
"",
"New name for the data-block");
1510 parm =
RNA_def_pointer(func,
"metaball",
"MetaBall",
"",
"New metaball data-block");
1517 parm =
RNA_def_pointer(func,
"metaball",
"MetaBall",
"",
"Metaball to remove");
1524 "Unlink all usages of this metaball before deleting it "
1525 "(WARNING: will also delete objects instancing that metaball data)");
1530 "Decrement user counter of all data-blocks used by this metaball data");
1532 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this metaball data");
1553 func,
"filepath",
"File Path", 0,
"",
"path of the font to load");
1559 "Using existing data-block if this file is already loaded");
1561 parm =
RNA_def_pointer(func,
"vfont",
"VectorFont",
"",
"New font data-block");
1568 parm =
RNA_def_pointer(func,
"vfont",
"VectorFont",
"",
"Font to remove");
1572 func,
"do_unlink",
true,
"",
"Unlink all usages of this font before deleting it");
1574 func,
"do_id_user",
true,
"",
"Decrement user counter of all data-blocks used by this font");
1576 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this font");
1595 parm =
RNA_def_string(func,
"name",
"Texture", 0,
"",
"New name for the data-block");
1601 parm =
RNA_def_pointer(func,
"texture",
"Texture",
"",
"New texture data-block");
1608 parm =
RNA_def_pointer(func,
"texture",
"Texture",
"",
"Texture to remove");
1612 func,
"do_unlink",
true,
"",
"Unlink all usages of this texture before deleting it");
1617 "Decrement user counter of all data-blocks used by this texture");
1619 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this texture");
1638 parm =
RNA_def_string(func,
"name",
"Brush", 0,
"",
"New name for the data-block");
1645 "Paint Mode for the new brush");
1647 parm =
RNA_def_pointer(func,
"brush",
"Brush",
"",
"New brush data-block");
1654 parm =
RNA_def_pointer(func,
"brush",
"Brush",
"",
"Brush to remove");
1658 func,
"do_unlink",
true,
"",
"Unlink all usages of this brush before deleting it");
1663 "Decrement user counter of all data-blocks used by this brush");
1665 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this brush");
1671 func =
RNA_def_function(srna,
"create_gpencil_data",
"rna_Main_brush_gpencil_data");
1690 parm =
RNA_def_string(func,
"name",
"World", 0,
"",
"New name for the data-block");
1693 parm =
RNA_def_pointer(func,
"world",
"World",
"",
"New world data-block");
1700 parm =
RNA_def_pointer(func,
"world",
"World",
"",
"World to remove");
1704 func,
"do_unlink",
true,
"",
"Unlink all usages of this world before deleting it");
1709 "Decrement user counter of all data-blocks used by this world");
1711 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this world");
1731 parm =
RNA_def_string(func,
"name",
"Collection", 0,
"",
"New name for the data-block");
1734 parm =
RNA_def_pointer(func,
"collection",
"Collection",
"",
"New collection data-block");
1741 parm =
RNA_def_pointer(func,
"collection",
"Collection",
"",
"Collection to remove");
1745 func,
"do_unlink",
true,
"",
"Unlink all usages of this collection before deleting it");
1750 "Decrement user counter of all data-blocks used by this collection");
1752 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this collection");
1772 parm =
RNA_def_string(func,
"name",
"Speaker", 0,
"",
"New name for the data-block");
1775 parm =
RNA_def_pointer(func,
"speaker",
"Speaker",
"",
"New speaker data-block");
1782 parm =
RNA_def_pointer(func,
"speaker",
"Speaker",
"",
"Speaker to remove");
1789 "Unlink all usages of this speaker before deleting it "
1790 "(WARNING: will also delete objects instancing that speaker data)");
1795 "Decrement user counter of all data-blocks used by this speaker data");
1797 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this speaker data");
1817 parm =
RNA_def_string(func,
"name",
"Text", 0,
"",
"New name for the data-block");
1820 parm =
RNA_def_pointer(func,
"text",
"Text",
"",
"New text data-block");
1831 func,
"do_unlink",
true,
"",
"Unlink all usages of this text before deleting it");
1833 func,
"do_id_user",
true,
"",
"Decrement user counter of all data-blocks used by this text");
1835 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this text");
1842 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
1845 func,
"internal",
false,
"Make internal",
"Make text file internal after loading");
1847 parm =
RNA_def_pointer(func,
"text",
"Text",
"",
"New text data-block");
1871 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
1877 "Using existing data-block if this file is already loaded");
1879 parm =
RNA_def_pointer(func,
"sound",
"Sound",
"",
"New text data-block");
1886 parm =
RNA_def_pointer(func,
"sound",
"Sound",
"",
"Sound to remove");
1890 func,
"do_unlink",
true,
"",
"Unlink all usages of this sound before deleting it");
1895 "Decrement user counter of all data-blocks used by this sound");
1897 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this sound");
1917 parm =
RNA_def_string(func,
"name",
"Armature", 0,
"",
"New name for the data-block");
1920 parm =
RNA_def_pointer(func,
"armature",
"Armature",
"",
"New armature data-block");
1927 parm =
RNA_def_pointer(func,
"armature",
"Armature",
"",
"Armature to remove");
1934 "Unlink all usages of this armature before deleting it "
1935 "(WARNING: will also delete objects instancing that armature data)");
1940 "Decrement user counter of all data-blocks used by this armature data");
1942 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this armature data");
1961 parm =
RNA_def_string(func,
"name",
"Action", 0,
"",
"New name for the data-block");
1964 parm =
RNA_def_pointer(func,
"action",
"Action",
"",
"New action data-block");
1971 parm =
RNA_def_pointer(func,
"action",
"Action",
"",
"Action to remove");
1975 func,
"do_unlink",
true,
"",
"Unlink all usages of this action before deleting it");
1980 "Decrement user counter of all data-blocks used by this action");
1982 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this action");
2002 "Add a new particle settings instance to the main database");
2003 parm =
RNA_def_string(func,
"name",
"ParticleSettings", 0,
"",
"New name for the data-block");
2007 func,
"particle",
"ParticleSettings",
"",
"New particle settings data-block");
2014 func,
"Remove a particle settings instance from the current blendfile");
2015 parm =
RNA_def_pointer(func,
"particle",
"ParticleSettings",
"",
"Particle Settings to remove");
2022 "Unlink all usages of those particle settings before deleting them");
2027 "Decrement user counter of all data-blocks used by this particle settings");
2032 "Make sure interface does not reference this particle settings");
2052 parm =
RNA_def_string(func,
"name",
"Palette", 0,
"",
"New name for the data-block");
2055 parm =
RNA_def_pointer(func,
"palette",
"Palette",
"",
"New palette data-block");
2062 parm =
RNA_def_pointer(func,
"palette",
"Palette",
"",
"Palette to remove");
2066 func,
"do_unlink",
true,
"",
"Unlink all usages of this palette before deleting it");
2071 "Decrement user counter of all data-blocks used by this palette");
2073 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this palette");
2126 parm =
RNA_def_string(func,
"name",
"Annotation", 0,
"",
"New name for the data-block");
2129 parm =
RNA_def_pointer(func,
"annotation",
"Annotation",
"",
"New annotation data-block");
2136 parm =
RNA_def_pointer(func,
"annotation",
"Annotation",
"",
"Grease Pencil to remove");
2140 func,
"do_unlink",
true,
"",
"Unlink all usages of this annotation before deleting it");
2145 "Decrement user counter of all data-blocks used by this annotation");
2147 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this annotation");
2157 srna =
RNA_def_struct(brna,
"BlendDataGreasePencilsV3",
nullptr);
2167 parm =
RNA_def_string(func,
"name",
"GreasePencil", 0,
"",
"New name for the data-block");
2171 func,
"grease_pencil",
"GreasePencil",
"",
"New Grease Pencil data-block");
2178 "Remove a Grease Pencil instance from the current blendfile");
2179 parm =
RNA_def_pointer(func,
"grease_pencil",
"GreasePencil",
"",
"Grease Pencil to remove");
2183 func,
"do_unlink",
true,
"",
"Unlink all usages of this Grease Pencil before deleting it");
2188 "Decrement user counter of all data-blocks used by this Grease Pencil");
2190 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this Grease Pencil");
2211 parm =
RNA_def_pointer(func,
"clip",
"MovieClip",
"",
"Movie clip to remove");
2215 func,
"do_unlink",
true,
"",
"Unlink all usages of this movie clip before deleting it");
2220 "Decrement user counter of all data-blocks used by this movie clip");
2222 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this movie clip");
2229 "Add a new movie clip to the main database from a file "
2230 "(while ``check_existing`` is disabled for consistency with other load functions, "
2231 "behavior with multiple movie-clips using the same file may incorrectly generate proxies)");
2233 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
2239 "Using existing data-block if this file is already loaded");
2241 parm =
RNA_def_pointer(func,
"clip",
"MovieClip",
"",
"New movie clip data-block");
2265 func,
"name",
nullptr,
MAX_ID_NAME - 2,
"Mask",
"Name of new mask data-block");
2268 parm =
RNA_def_pointer(func,
"mask",
"Mask",
"",
"New mask data-block");
2280 func,
"do_unlink",
true,
"",
"Unlink all usages of this mask before deleting it");
2282 func,
"do_id_user",
true,
"",
"Decrement user counter of all data-blocks used by this mask");
2284 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this mask");
2304 parm =
RNA_def_string(func,
"name",
"FreestyleLineStyle", 0,
"",
"New name for the data-block");
2307 parm =
RNA_def_pointer(func,
"linestyle",
"FreestyleLineStyle",
"",
"New line style data-block");
2314 parm =
RNA_def_pointer(func,
"linestyle",
"FreestyleLineStyle",
"",
"Line style to remove");
2318 func,
"do_unlink",
true,
"",
"Unlink all usages of this line style before deleting it");
2323 "Decrement user counter of all data-blocks used by this line style");
2325 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this line style");
2357 parm =
RNA_def_string(func,
"name",
"Probe", 0,
"",
"New name for the data-block");
2363 parm =
RNA_def_pointer(func,
"lightprobe",
"LightProbe",
"",
"New light probe data-block");
2370 parm =
RNA_def_pointer(func,
"lightprobe",
"LightProbe",
"",
"Light probe to remove");
2377 "Unlink all usages of this light probe before deleting it "
2378 "(WARNING: will also delete objects instancing that light probe data)");
2383 "Decrement user counter of all data-blocks used by this light probe");
2385 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this light probe");
2405 parm =
RNA_def_string(func,
"name",
"Curves", 0,
"",
"New name for the data-block");
2408 parm =
RNA_def_pointer(func,
"curves",
"Curves",
"",
"New curves data-block");
2415 parm =
RNA_def_pointer(func,
"curves",
"Curves",
"",
"Curves data-block to remove");
2422 "Unlink all usages of this curves before deleting it "
2423 "(WARNING: will also delete objects instancing that curves data)");
2428 "Decrement user counter of all data-blocks used by this curves data");
2430 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this curves data");
2450 parm =
RNA_def_string(func,
"name",
"PointCloud", 0,
"",
"New name for the data-block");
2453 parm =
RNA_def_pointer(func,
"pointcloud",
"PointCloud",
"",
"New point cloud data-block");
2460 parm =
RNA_def_pointer(func,
"pointcloud",
"PointCloud",
"",
"Point cloud to remove");
2467 "Unlink all usages of this point cloud before deleting it "
2468 "(WARNING: will also delete objects instancing that point cloud data)");
2473 "Decrement user counter of all data-blocks used by this point cloud data");
2478 "Make sure interface does not reference this point cloud data");
2498 parm =
RNA_def_string(func,
"name",
"Volume", 0,
"",
"New name for the data-block");
2501 parm =
RNA_def_pointer(func,
"volume",
"Volume",
"",
"New volume data-block");
2508 parm =
RNA_def_pointer(func,
"volume",
"Volume",
"",
"Volume to remove");
2515 "Unlink all usages of this volume before deleting it "
2516 "(WARNING: will also delete objects instancing that volume data)");
2521 "Decrement user counter of all data-blocks used by this volume data");
2523 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this volume data");
Blender kernel action and pose functionality.
Camera data-block and utility functions.
Low-level operations for curves that cannot be defined in the C++ header yet.
Low-level operations for grease pencil.
General operations, lookup, etc. for blender lights.
General operations for probes.
Blender kernel freestyle line style functionality.
General operations, lookup, etc. for materials.
General operations, lookup, etc. for blender objects.
General operations for point clouds.
General operations for speakers.
ID and Library types, which are fundamental for SDNA.
#define ID_IS_PACKED(_id)
#define ID_IS_LINKED(_id)
#define ID_REAL_USERS(id)
Object groups, one object can be in many groups at once.
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
Set< ID * > pack_linked_id_hierarchy(Main &bmain, ID &root_id)
bNodeTree * node_tree_add_tree(Main *bmain, StringRef name, StringRef idname)
void node_tree_shader_default(const bContext *C, Main *bmain, ID *id)
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
const char * BKE_idtype_idcode_to_name(short idcode)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_main_cachefiles(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_main_volumes(BlenderRNA *brna, PropertyRNA *cprop)
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)
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
struct Text * BKE_text_add(struct Main *bmain, const char *name)
Mesh * BKE_mesh_new_from_object_to_bmain(Main *bmain, Depsgraph *depsgraph, Object *object, bool preserve_all_data_layers)
void RNA_def_main_grease_pencil(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop)
bArmature * BKE_armature_add(Main *bmain, const char *name)
void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
struct Curves * BKE_curves_add(struct Main *bmain, const char *name)
void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_id_type_items[]
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
Scene * BKE_scene_find_replacement(const Main &bmain, const Scene &scene, FunctionRef< bool(const Scene &scene)> scene_validate_cb=nullptr)
void BKE_id_delete(Main *bmain, void *idv, const BKEIDDeleteOptions &options={}) ATTR_NONNULL()
void RNA_def_main_lights(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
bool BKE_scene_can_be_removed(const Main *bmain, const Scene *scene)
void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_lightprobes(BlenderRNA *brna, PropertyRNA *cprop)
Mask * BKE_mask_new(Main *bmain, const char *name)
Volume * BKE_volume_add(Main *bmain, const char *name)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_lightprobes_type_items[]
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 BKE_id_free_ex(Main *bmain, void *idv, int flag_orig, bool use_flag_from_idtag)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void BKE_brush_init_gpencil_settings(Brush *brush)
void RNA_api_main(StructRNA *srna)
const EnumPropertyItem rna_enum_light_type_items[]
Curve * BKE_curve_add(Main *bmain, const char *name, ObjectType type)
bAction * BKE_action_add(Main *bmain, const char name[])
@ LIB_ID_FREE_NO_USER_REFCOUNT
bSound * BKE_sound_new_file_exists(Main *bmain, const char *filepath, short stream_index=0)
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_paintcurves(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_object_type_curve_items[]
struct bGPdata * BKE_annotations_data_addnew(struct Main *bmain, const char name[])
void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop)
GreasePencil * BKE_grease_pencil_add(Main *bmain, const char *name)
void RNA_def_main_collections(BlenderRNA *brna, PropertyRNA *cprop)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
void RNA_def_main_palettes(BlenderRNA *brna, PropertyRNA *cprop)
bool ED_scene_replace_active_for_deletion(bContext &C, Main &bmain, Scene &scene, Scene *scene_new=nullptr)
void BKE_gpencil_material_attr_init(Material *ma)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void BKE_lightprobe_type_set(struct LightProbe *probe, eLightProbeType lightprobe_type)
struct Text * BKE_text_load_ex(struct Main *bmain, const char *filepath, const char *relbase, bool is_internal) ATTR_NONNULL(1
void RNA_def_main_annotations(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Image * BKE_image_load_exists(Main *bmain, const char *filepath, bool check_open=true, bool *r_exists=nullptr)
bke::bNodeTreeType * rna_node_tree_type_from_enum(int value)
void BKE_report(ReportList *reports, eReportType type, const char *message)
BMesh const char void * data
void BKE_object_materials_sync_length(Main *bmain, Object *ob, ID *id)
bool WM_jobs_has_running(const wmWindowManager *window_manager, const void *owner, const eWM_JobType type, const eWM_JobFlag exclude_flags)
struct Camera * BKE_camera_add(struct Main *bmain, const char *name)
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
void BKE_main_ensure_invariants(Main &bmain, std::optional< Span< ID * > > modified_ids=std::nullopt)
PointCloud * BKE_pointcloud_add(Main *bmain, const char *name)
char char size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
bSound * BKE_sound_new_file(Main *bmain, const char *filepath, short stream_index=0)
struct LightProbe * BKE_lightprobe_add(struct Main *bmain, const char *name)
Scene * BKE_scene_add(Main *bmain, const char *name)
void RNA_def_main_workspaces(BlenderRNA *brna, PropertyRNA *cprop)
FreestyleLineStyle * BKE_linestyle_new(struct Main *bmain, const char *name)
void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_texture_type_items[]
void RNA_def_main_pointclouds(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
bool RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **r_identifier)
void RNA_def_main_hair_curves(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
MovieClip * BKE_movieclip_file_add_exists(Main *bmain, const char *filepath)
void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
VFont * BKE_vfont_load_exists(Main *bmain, const char *filepath)
int BKE_object_obdata_to_type(const ID *id) ATTR_NONNULL(1)
const EnumPropertyItem rna_enum_object_mode_items[]
void BKE_texture_type_set(struct Tex *tex, eTex_Type type)
struct World * BKE_world_add(struct Main *bmain, const char *name)
void BKE_main_id_newptr_and_tag_clear(Main *bmain)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
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_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Light * BKE_light_add(Main *bmain, const char *name) ATTR_WARN_UNUSED_RESULT
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
MetaBall * BKE_mball_add(Main *bmain, const char *name)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
ID_Type GS(const char *name)
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
struct Tex * BKE_texture_add(struct Main *bmain, const char *name)
const EnumPropertyItem * rna_node_tree_type_itemf(void *data, bool(*poll)(void *data, bke::bNodeTreeType *), bool *r_free)
struct Speaker * BKE_speaker_add(struct Main *bmain, const char *name)
VFont * BKE_vfont_load(Main *bmain, const char *filepath)
void DEG_relations_tag_update(Main *bmain)
void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
Material * BKE_material_add(Main *bmain, const char *name)
Object * BKE_object_add_only_object(Main *bmain, ObjectType type, const char *name) ATTR_RETURNS_NONNULL
Mesh * BKE_mesh_add(Main *bmain, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
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)
void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop)
Lattice * BKE_lattice_add(Main *bmain, const char *name)
Brush * BKE_brush_add(Main *bmain, const char *name, eObjectMode ob_mode)
void id_fake_user_clear(ID *id)
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
int BLI_str_utf8_invalid_strip(char *str, size_t str_len) ATTR_NONNULL(1)
MovieClip * BKE_movieclip_file_add(Main *bmain, const char *filepath)
Palette * BKE_palette_add(Main *bmain, const char *name)
Image * BKE_image_load(Main *bmain, const char *filepath, bool check_open=true)
void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)