104static void rna_idname_validate(
const char *
name,
char *r_name)
110static void rna_Main_ID_remove(
Main *bmain,
117 ID *
id =
static_cast<ID *
>(id_ptr->
data);
121 "%s '%s' is outside of main database and cannot be removed from it",
143 "%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)",
150static ID *rna_Main_pack_linked_ids_hierarchy(
struct BlendData *blenddata,
163 Main *bmain =
reinterpret_cast<Main *
>(blenddata);
166 ID *packed_root_id = root_id->
newid;
169 return packed_root_id;
175 rna_idname_validate(
name, safe_name);
185static Scene *rna_Main_scenes_new(
Main *bmain,
const char *
name)
188 rna_idname_validate(
name, safe_name);
196static void rna_Main_scenes_remove(
212 if (sad->
scene == scene) {
250 rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink,
true,
true);
255 "Scene '%s' is the last local one, cannot be removed",
265 "Cannot create object in main database with an evaluated data data-block");
270 rna_idname_validate(
name, safe_name);
303 rna_idname_validate(
name, safe_name);
315static void rna_Main_materials_gpencil_data(
Main * ,
PointerRNA *id_ptr)
317 ID *
id =
static_cast<ID *
>(id_ptr->
data);
322static void rna_Main_materials_gpencil_remove(
Main * ,
PointerRNA *id_ptr)
324 ID *
id =
static_cast<ID *
>(id_ptr->
data);
341 rna_idname_validate(
name, safe_name);
356static Mesh *rna_Main_meshes_new(
Main *bmain,
const char *
name)
359 rna_idname_validate(
name, safe_name);
370static Mesh *rna_Main_meshes_new_from_object(
Main *bmain,
373 bool preserve_all_data_layers,
376 switch (object->
type) {
389 bmain,
depsgraph,
object, preserve_all_data_layers);
396static Light *rna_Main_lights_new(
Main *bmain,
const char *
name,
int type)
399 rna_idname_validate(
name, safe_name);
410static Image *rna_Main_images_new(
Main *bmain,
421 rna_idname_validate(
name, safe_name);
423 float color[4] = {0.0, 0.0, 0.0, 1.0};
441static Image *rna_Main_images_load(
Main *bmain,
443 const char *filepath,
449 if (check_existing) {
459 "Cannot read '%s': %s",
461 errno ? strerror(errno) :
RPT_(
"unsupported image format"));
474 rna_idname_validate(
name, safe_name);
484static Curve *rna_Main_curves_new(
Main *bmain,
const char *
name,
int type)
487 rna_idname_validate(
name, safe_name);
500 rna_idname_validate(
name, safe_name);
510static VFont *rna_Main_fonts_load(
Main *bmain,
512 const char *filepath,
518 if (check_existing) {
528 "Cannot read '%s': %s",
530 errno ? strerror(errno) :
RPT_(
"unsupported font format"));
538static Tex *rna_Main_textures_new(
Main *bmain,
const char *
name,
int type)
541 rna_idname_validate(
name, safe_name);
552static Brush *rna_Main_brushes_new(
Main *bmain,
const char *
name,
int mode)
555 rna_idname_validate(
name, safe_name);
565static void rna_Main_brush_gpencil_data(
Main * ,
PointerRNA *id_ptr)
567 ID *
id =
static_cast<ID *
>(id_ptr->
data);
572static World *rna_Main_worlds_new(
Main *bmain,
const char *
name)
575 rna_idname_validate(
name, safe_name);
590 rna_idname_validate(
name, safe_name);
602 rna_idname_validate(
name, safe_name);
612static bSound *rna_Main_sounds_load(
Main *bmain,
const char *
name,
bool check_existing)
616 if (check_existing) {
630static Text *rna_Main_texts_new(
Main *bmain,
const char *
name)
633 rna_idname_validate(
name, safe_name);
642static Text *rna_Main_texts_load(
Main *bmain,
644 const char *filepath,
655 "Cannot read '%s': %s",
657 errno ? strerror(errno) :
RPT_(
"unable to load text"));
668 rna_idname_validate(
name, safe_name);
681 rna_idname_validate(
name, safe_name);
695 rna_idname_validate(
name, safe_name);
708 rna_idname_validate(
name, safe_name);
720 const char *filepath,
727 if (check_existing) {
734 if (clip !=
nullptr) {
740 "Cannot read '%s': %s",
742 errno ? strerror(errno) :
RPT_(
"unable to load movie clip"));
752static Mask *rna_Main_mask_new(
Main *bmain,
const char *
name)
755 rna_idname_validate(
name, safe_name);
768 rna_idname_validate(
name, safe_name);
781 rna_idname_validate(
name, safe_name);
797 rna_idname_validate(
name, safe_name);
810 rna_idname_validate(
name, safe_name);
817 return grease_pencil;
820static Curves *rna_Main_hair_curves_new(
Main *bmain,
const char *
name)
823 rna_idname_validate(
name, safe_name);
836 rna_idname_validate(
name, safe_name);
849 rna_idname_validate(
name, safe_name);
860# define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
861 static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \
863 BKE_main_id_tag_listbase(&bmain->_listbase_name, ID_TAG_DOIT, value); \
866RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras,
ID_CA)
867RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes,
ID_SCE)
868RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects,
ID_OB)
869RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials,
ID_MA)
870RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees,
ID_NT)
871RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes,
ID_ME)
872RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights,
ID_LA)
873RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries,
ID_LI)
874RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens,
ID_SCR)
875RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm,
ID_WM)
876RNA_MAIN_ID_TAG_FUNCS_DEF(images, images,
ID_IM)
877RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices,
ID_LT)
879RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs,
ID_MB)
880RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts,
ID_VF)
881RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures,
ID_TE)
882RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brushes,
ID_BR)
883RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds,
ID_WO)
884RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections,
ID_GR)
886RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts,
ID_TXT)
887RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers,
ID_SPK)
888RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds,
ID_SO)
889RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures,
ID_AR)
890RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions,
ID_AC)
891RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles,
ID_PA)
892RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes,
ID_PAL)
893RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils,
ID_GD_LEGACY)
894RNA_MAIN_ID_TAG_FUNCS_DEF(grease_pencils, grease_pencils,
ID_GP)
895RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips,
ID_MC)
896RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks,
ID_MSK)
897RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles,
ID_LS)
898RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles,
ID_CF)
899RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves,
ID_PC)
900RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces,
ID_WS)
901RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes,
ID_LP)
902RNA_MAIN_ID_TAG_FUNCS_DEF(hair_curves, hair_curves,
ID_CV)
903RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds,
ID_PT)
904RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes,
ID_VO)
906# undef RNA_MAIN_ID_TAG_FUNCS_DEF
921 func,
"filepath",
nullptr, 0,
"",
"File path to load image from");
927 func =
RNA_def_function(srna,
"pack_linked_ids_hierarchy",
"rna_Main_pack_linked_ids_hierarchy");
929 func,
"Pack the given linked ID and its dependencies into current blendfile");
931 parm =
RNA_def_pointer(func,
"root_id",
"ID",
"",
"Root linked ID to pack");
933 parm =
RNA_def_pointer(func,
"packed_id",
"ID",
"",
"The packed ID matching the given root ID");
950 parm =
RNA_def_string(func,
"name",
"Camera", 0,
"",
"New name for the data-block");
953 parm =
RNA_def_pointer(func,
"camera",
"Camera",
"",
"New camera data-block");
959 parm =
RNA_def_pointer(func,
"camera",
"Camera",
"",
"Camera to remove");
966 "Unlink all usages of this camera before deleting it "
967 "(WARNING: will also delete objects instancing that camera data)");
972 "Decrement user counter of all data-blocks used by this camera");
974 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this camera");
994 parm =
RNA_def_string(func,
"name",
"Scene", 0,
"",
"New name for the data-block");
997 parm =
RNA_def_pointer(func,
"scene",
"Scene",
"",
"New scene data-block");
1003 parm =
RNA_def_pointer(func,
"scene",
"Scene",
"",
"Scene to remove");
1007 func,
"do_unlink",
true,
"",
"Unlink all usages of this scene before deleting it");
1028 parm =
RNA_def_string(func,
"name",
"Object", 0,
"",
"New name for the data-block");
1030 parm =
RNA_def_pointer(func,
"object_data",
"ID",
"",
"Object data or None for an empty object");
1034 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"New object data-block");
1040 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"Object to remove");
1044 func,
"do_unlink",
true,
"",
"Unlink all usages of this object before deleting it");
1049 "Decrement user counter of all data-blocks used by this object");
1051 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this object");
1071 parm =
RNA_def_string(func,
"name",
"Material", 0,
"",
"New name for the data-block");
1074 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");
1169 func =
RNA_def_function(srna,
"new_from_object",
"rna_Main_meshes_new_from_object");
1172 "Add a new mesh created from given object (undeformed geometry if object is original, and "
1173 "final evaluated geometry, with all modifiers etc., if object is evaluated)");
1175 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"Object to create mesh from");
1178 "preserve_all_data_layers",
1181 "Preserve all data layers in the mesh, like UV maps and vertex groups. "
1182 "By default Blender only computes the subset of data layers needed for viewport "
1183 "display and rendering, for better performance.");
1189 "Evaluated dependency graph which is required when preserve_all_data_layers is true");
1194 "Mesh created from object, remove it if it is only used for export");
1207 "Unlink all usages of this mesh before deleting it "
1208 "(WARNING: will also delete objects instancing that mesh data)");
1213 "Decrement user counter of all data-blocks used by this mesh data");
1215 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this mesh data");
1235 parm =
RNA_def_string(func,
"name",
"Light", 0,
"",
"New name for the data-block");
1241 parm =
RNA_def_pointer(func,
"light",
"Light",
"",
"New light data-block");
1247 parm =
RNA_def_pointer(func,
"light",
"Light",
"",
"Light to remove");
1254 "Unlink all usages of this light before deleting it "
1255 "(WARNING: will also delete objects instancing that light data)");
1260 "Decrement user counter of all data-blocks used by this light data");
1262 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this light data");
1287 parm =
RNA_def_pointer(func,
"library",
"Library",
"",
"Library to remove");
1291 func,
"do_unlink",
true,
"",
"Unlink all usages of this library before deleting it");
1296 "Decrement user counter of all data-blocks used by this library");
1298 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this library");
1345 parm =
RNA_def_string(func,
"name",
"Image", 0,
"",
"New name for the data-block");
1347 parm =
RNA_def_int(func,
"width", 1024, 1, INT_MAX,
"",
"Width of the image", 1, INT_MAX);
1349 parm =
RNA_def_int(func,
"height", 1024, 1, INT_MAX,
"",
"Height of the image", 1, INT_MAX);
1353 func,
"float_buffer",
false,
"Float Buffer",
"Create an image with floating-point color");
1354 RNA_def_boolean(func,
"stereo3d",
false,
"Stereo 3D",
"Create left and right views");
1356 func,
"is_data",
false,
"Is Data",
"Create image with non-color data color space");
1357 RNA_def_boolean(func,
"tiled",
false,
"Tiled",
"Create a tiled image");
1359 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"New image data-block");
1366 func,
"filepath",
"File Path", 0,
"",
"Path of the file to load");
1372 "Using existing data-block if this file is already loaded");
1374 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"New image data-block");
1380 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"Image to remove");
1384 func,
"do_unlink",
true,
"",
"Unlink all usages of this image before deleting it");
1389 "Decrement user counter of all data-blocks used by this image");
1391 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this image");
1411 parm =
RNA_def_string(func,
"name",
"Lattice", 0,
"",
"New name for the data-block");
1414 parm =
RNA_def_pointer(func,
"lattice",
"Lattice",
"",
"New lattice data-block");
1420 parm =
RNA_def_pointer(func,
"lattice",
"Lattice",
"",
"Lattice to remove");
1427 "Unlink all usages of this lattice before deleting it "
1428 "(WARNING: will also delete objects instancing that lattice data)");
1433 "Decrement user counter of all data-blocks used by this lattice data");
1435 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this lattice data");
1454 parm =
RNA_def_string(func,
"name",
"Curve", 0,
"",
"New name for the data-block");
1460 parm =
RNA_def_pointer(func,
"curve",
"Curve",
"",
"New curve data-block");
1466 parm =
RNA_def_pointer(func,
"curve",
"Curve",
"",
"Curve to remove");
1473 "Unlink all usages of this curve before deleting it "
1474 "(WARNING: will also delete objects instancing that curve data)");
1479 "Decrement user counter of all data-blocks used by this curve data");
1481 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this curve data");
1500 parm =
RNA_def_string(func,
"name",
"MetaBall", 0,
"",
"New name for the data-block");
1503 parm =
RNA_def_pointer(func,
"metaball",
"MetaBall",
"",
"New metaball data-block");
1509 parm =
RNA_def_pointer(func,
"metaball",
"MetaBall",
"",
"Metaball to remove");
1516 "Unlink all usages of this metaball before deleting it "
1517 "(WARNING: will also delete objects instancing that metaball data)");
1522 "Decrement user counter of all data-blocks used by this metaball data");
1524 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this metaball data");
1545 func,
"filepath",
"File Path", 0,
"",
"path of the font to load");
1551 "Using existing data-block if this file is already loaded");
1553 parm =
RNA_def_pointer(func,
"vfont",
"VectorFont",
"",
"New font data-block");
1559 parm =
RNA_def_pointer(func,
"vfont",
"VectorFont",
"",
"Font to remove");
1563 func,
"do_unlink",
true,
"",
"Unlink all usages of this font before deleting it");
1565 func,
"do_id_user",
true,
"",
"Decrement user counter of all data-blocks used by this font");
1567 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this font");
1586 parm =
RNA_def_string(func,
"name",
"Texture", 0,
"",
"New name for the data-block");
1592 parm =
RNA_def_pointer(func,
"texture",
"Texture",
"",
"New texture data-block");
1598 parm =
RNA_def_pointer(func,
"texture",
"Texture",
"",
"Texture to remove");
1602 func,
"do_unlink",
true,
"",
"Unlink all usages of this texture before deleting it");
1607 "Decrement user counter of all data-blocks used by this texture");
1609 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this texture");
1628 parm =
RNA_def_string(func,
"name",
"Brush", 0,
"",
"New name for the data-block");
1635 "Paint Mode for the new brush");
1637 parm =
RNA_def_pointer(func,
"brush",
"Brush",
"",
"New brush data-block");
1643 parm =
RNA_def_pointer(func,
"brush",
"Brush",
"",
"Brush to remove");
1647 func,
"do_unlink",
true,
"",
"Unlink all usages of this brush before deleting it");
1652 "Decrement user counter of all data-blocks used by this brush");
1654 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this brush");
1660 func =
RNA_def_function(srna,
"create_gpencil_data",
"rna_Main_brush_gpencil_data");
1679 parm =
RNA_def_string(func,
"name",
"World", 0,
"",
"New name for the data-block");
1682 parm =
RNA_def_pointer(func,
"world",
"World",
"",
"New world data-block");
1688 parm =
RNA_def_pointer(func,
"world",
"World",
"",
"World to remove");
1692 func,
"do_unlink",
true,
"",
"Unlink all usages of this world before deleting it");
1697 "Decrement user counter of all data-blocks used by this world");
1699 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this world");
1719 parm =
RNA_def_string(func,
"name",
"Collection", 0,
"",
"New name for the data-block");
1722 parm =
RNA_def_pointer(func,
"collection",
"Collection",
"",
"New collection data-block");
1728 parm =
RNA_def_pointer(func,
"collection",
"Collection",
"",
"Collection to remove");
1732 func,
"do_unlink",
true,
"",
"Unlink all usages of this collection before deleting it");
1737 "Decrement user counter of all data-blocks used by this collection");
1739 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this collection");
1759 parm =
RNA_def_string(func,
"name",
"Speaker", 0,
"",
"New name for the data-block");
1762 parm =
RNA_def_pointer(func,
"speaker",
"Speaker",
"",
"New speaker data-block");
1768 parm =
RNA_def_pointer(func,
"speaker",
"Speaker",
"",
"Speaker to remove");
1775 "Unlink all usages of this speaker before deleting it "
1776 "(WARNING: will also delete objects instancing that speaker data)");
1781 "Decrement user counter of all data-blocks used by this speaker data");
1783 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this speaker data");
1803 parm =
RNA_def_string(func,
"name",
"Text", 0,
"",
"New name for the data-block");
1806 parm =
RNA_def_pointer(func,
"text",
"Text",
"",
"New text data-block");
1816 func,
"do_unlink",
true,
"",
"Unlink all usages of this text before deleting it");
1818 func,
"do_id_user",
true,
"",
"Decrement user counter of all data-blocks used by this text");
1820 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this text");
1827 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
1830 func,
"internal",
false,
"Make internal",
"Make text file internal after loading");
1832 parm =
RNA_def_pointer(func,
"text",
"Text",
"",
"New text data-block");
1855 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
1861 "Using existing data-block if this file is already loaded");
1863 parm =
RNA_def_pointer(func,
"sound",
"Sound",
"",
"New text data-block");
1869 parm =
RNA_def_pointer(func,
"sound",
"Sound",
"",
"Sound to remove");
1873 func,
"do_unlink",
true,
"",
"Unlink all usages of this sound before deleting it");
1878 "Decrement user counter of all data-blocks used by this sound");
1880 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this sound");
1900 parm =
RNA_def_string(func,
"name",
"Armature", 0,
"",
"New name for the data-block");
1903 parm =
RNA_def_pointer(func,
"armature",
"Armature",
"",
"New armature data-block");
1909 parm =
RNA_def_pointer(func,
"armature",
"Armature",
"",
"Armature to remove");
1916 "Unlink all usages of this armature before deleting it "
1917 "(WARNING: will also delete objects instancing that armature data)");
1922 "Decrement user counter of all data-blocks used by this armature data");
1924 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this armature data");
1943 parm =
RNA_def_string(func,
"name",
"Action", 0,
"",
"New name for the data-block");
1946 parm =
RNA_def_pointer(func,
"action",
"Action",
"",
"New action data-block");
1952 parm =
RNA_def_pointer(func,
"action",
"Action",
"",
"Action to remove");
1956 func,
"do_unlink",
true,
"",
"Unlink all usages of this action before deleting it");
1961 "Decrement user counter of all data-blocks used by this action");
1963 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this action");
1983 "Add a new particle settings instance to the main database");
1984 parm =
RNA_def_string(func,
"name",
"ParticleSettings", 0,
"",
"New name for the data-block");
1988 func,
"particle",
"ParticleSettings",
"",
"New particle settings data-block");
1994 func,
"Remove a particle settings instance from the current blendfile");
1995 parm =
RNA_def_pointer(func,
"particle",
"ParticleSettings",
"",
"Particle Settings to remove");
2002 "Unlink all usages of those particle settings before deleting them");
2007 "Decrement user counter of all data-blocks used by this particle settings");
2012 "Make sure interface does not reference this particle settings");
2032 parm =
RNA_def_string(func,
"name",
"Palette", 0,
"",
"New name for the data-block");
2035 parm =
RNA_def_pointer(func,
"palette",
"Palette",
"",
"New palette data-block");
2041 parm =
RNA_def_pointer(func,
"palette",
"Palette",
"",
"Palette to remove");
2045 func,
"do_unlink",
true,
"",
"Unlink all usages of this palette before deleting it");
2050 "Decrement user counter of all data-blocks used by this palette");
2052 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this palette");
2105 parm =
RNA_def_string(func,
"name",
"Annotation", 0,
"",
"New name for the data-block");
2108 parm =
RNA_def_pointer(func,
"annotation",
"Annotation",
"",
"New annotation data-block");
2114 parm =
RNA_def_pointer(func,
"annotation",
"Annotation",
"",
"Grease Pencil to remove");
2118 func,
"do_unlink",
true,
"",
"Unlink all usages of this annotation before deleting it");
2123 "Decrement user counter of all data-blocks used by this annotation");
2125 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this annotation");
2135 srna =
RNA_def_struct(brna,
"BlendDataGreasePencilsV3",
nullptr);
2145 parm =
RNA_def_string(func,
"name",
"GreasePencil", 0,
"",
"New name for the data-block");
2149 func,
"grease_pencil",
"GreasePencil",
"",
"New Grease Pencil data-block");
2155 "Remove a Grease Pencil instance from the current blendfile");
2156 parm =
RNA_def_pointer(func,
"grease_pencil",
"GreasePencil",
"",
"Grease Pencil to remove");
2160 func,
"do_unlink",
true,
"",
"Unlink all usages of this Grease Pencil before deleting it");
2165 "Decrement user counter of all data-blocks used by this Grease Pencil");
2167 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this Grease Pencil");
2188 parm =
RNA_def_pointer(func,
"clip",
"MovieClip",
"",
"Movie clip to remove");
2192 func,
"do_unlink",
true,
"",
"Unlink all usages of this movie clip before deleting it");
2197 "Decrement user counter of all data-blocks used by this movie clip");
2199 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this movie clip");
2206 "Add a new movie clip to the main database from a file "
2207 "(while ``check_existing`` is disabled for consistency with other load functions, "
2208 "behavior with multiple movie-clips using the same file may incorrectly generate proxies)");
2210 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
2216 "Using existing data-block if this file is already loaded");
2218 parm =
RNA_def_pointer(func,
"clip",
"MovieClip",
"",
"New movie clip data-block");
2241 func,
"name",
nullptr,
MAX_ID_NAME - 2,
"Mask",
"Name of new mask data-block");
2244 parm =
RNA_def_pointer(func,
"mask",
"Mask",
"",
"New mask data-block");
2255 func,
"do_unlink",
true,
"",
"Unlink all usages of this mask before deleting it");
2257 func,
"do_id_user",
true,
"",
"Decrement user counter of all data-blocks used by this mask");
2259 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this mask");
2279 parm =
RNA_def_string(func,
"name",
"FreestyleLineStyle", 0,
"",
"New name for the data-block");
2282 parm =
RNA_def_pointer(func,
"linestyle",
"FreestyleLineStyle",
"",
"New line style data-block");
2288 parm =
RNA_def_pointer(func,
"linestyle",
"FreestyleLineStyle",
"",
"Line style to remove");
2292 func,
"do_unlink",
true,
"",
"Unlink all usages of this line style before deleting it");
2297 "Decrement user counter of all data-blocks used by this line style");
2299 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this line style");
2331 parm =
RNA_def_string(func,
"name",
"Probe", 0,
"",
"New name for the data-block");
2337 parm =
RNA_def_pointer(func,
"lightprobe",
"LightProbe",
"",
"New light probe data-block");
2343 parm =
RNA_def_pointer(func,
"lightprobe",
"LightProbe",
"",
"Light probe to remove");
2350 "Unlink all usages of this light probe before deleting it "
2351 "(WARNING: will also delete objects instancing that light probe data)");
2356 "Decrement user counter of all data-blocks used by this light probe");
2358 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this light probe");
2378 parm =
RNA_def_string(func,
"name",
"Curves", 0,
"",
"New name for the data-block");
2381 parm =
RNA_def_pointer(func,
"curves",
"Curves",
"",
"New curves data-block");
2387 parm =
RNA_def_pointer(func,
"curves",
"Curves",
"",
"Curves data-block to remove");
2394 "Unlink all usages of this curves before deleting it "
2395 "(WARNING: will also delete objects instancing that curves data)");
2400 "Decrement user counter of all data-blocks used by this curves data");
2402 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this curves data");
2422 parm =
RNA_def_string(func,
"name",
"PointCloud", 0,
"",
"New name for the data-block");
2425 parm =
RNA_def_pointer(func,
"pointcloud",
"PointCloud",
"",
"New point cloud data-block");
2431 parm =
RNA_def_pointer(func,
"pointcloud",
"PointCloud",
"",
"Point cloud to remove");
2438 "Unlink all usages of this point cloud before deleting it "
2439 "(WARNING: will also delete objects instancing that point cloud data)");
2444 "Decrement user counter of all data-blocks used by this point cloud data");
2449 "Make sure interface does not reference this point cloud data");
2469 parm =
RNA_def_string(func,
"name",
"Volume", 0,
"",
"New name for the data-block");
2472 parm =
RNA_def_pointer(func,
"volume",
"Volume",
"",
"New volume data-block");
2478 parm =
RNA_def_pointer(func,
"volume",
"Volume",
"",
"Volume to remove");
2485 "Unlink all usages of this volume before deleting it "
2486 "(WARNING: will also delete objects instancing that volume data)");
2491 "Decrement user counter of all data-blocks used by this volume data");
2493 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.
struct Camera * BKE_camera_add(struct Main *bmain, const char *name)
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
void CTX_data_scene_set(bContext *C, Scene *scene)
Scene * CTX_data_scene(const bContext *C)
Curve * BKE_curve_add(Main *bmain, const char *name, int type)
Low-level operations for curves that cannot be defined in the C++ header yet.
struct Curves * BKE_curves_add(struct Main *bmain, const char *name)
display list (or rather multi purpose list) stuff.
struct bGPdata * BKE_gpencil_data_addnew(struct Main *bmain, const char name[])
Low-level operations for grease pencil.
GreasePencil * BKE_grease_pencil_add(Main *bmain, const char *name)
const char * BKE_idtype_idcode_to_name(short idcode)
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 BKE_main_id_newptr_and_tag_clear(Main *bmain)
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.
Light * BKE_light_add(Main *bmain, const char *name) ATTR_WARN_UNUSED_RESULT
General operations for probes.
struct LightProbe * BKE_lightprobe_add(struct Main *bmain, const char *name)
void BKE_lightprobe_type_set(struct LightProbe *probe, short lightprobe_type)
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()
void BKE_main_ensure_invariants(Main &bmain, std::optional< blender::Span< ID * > > modified_ids=std::nullopt)
struct Mask * BKE_mask_new(struct Main *bmain, const char *name)
General operations, lookup, etc. for materials.
void BKE_gpencil_material_attr_init(Material *ma)
void BKE_object_materials_sync_length(Main *bmain, Object *ob, ID *id)
Material * BKE_material_add(Main *bmain, const char *name)
MetaBall * BKE_mball_add(Main *bmain, const char *name)
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.
PointCloud * BKE_pointcloud_add(Main *bmain, const char *name)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
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.
struct Speaker * 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)
Volume * BKE_volume_add(Main *bmain, const char *name)
struct World * BKE_world_add(struct Main *bmain, const char *name)
#define LISTBASE_FOREACH(type, var, list)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
int BLI_str_utf8_invalid_strip(char *str, size_t str_len) ATTR_NONNULL(1)
#define 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_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 ED_node_shader_default(const bContext *C, Main *bmain, ID *id)
wmOperatorStatus ED_screen_animation_play(bContext *C, int sync, int mode)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
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)
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
BMesh const char void * data
BPy_StructRNA * depsgraph
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void pack_linked_id_hierarchy(Main &bmain, ID &root_id)
bNodeTree * node_tree_add_tree(Main *bmain, StringRef name, StringRef 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_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_api_main(StructRNA *srna)
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_dummy_DEFAULT_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)