103static void rna_idname_validate(
const char *name,
char *r_name)
109static void rna_Main_ID_remove(
Main *bmain,
116 ID *
id =
static_cast<ID *
>(id_ptr->
data);
120 "%s '%s' is outside of main database and cannot be removed from it",
142 "%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)",
149static Camera *rna_Main_cameras_new(
Main *bmain,
const char *name)
152 rna_idname_validate(name, safe_name);
162static Scene *rna_Main_scenes_new(
Main *bmain,
const char *name)
165 rna_idname_validate(name, safe_name);
173static void rna_Main_scenes_remove(
210 rna_Main_ID_remove(bmain,
reports, scene_ptr, do_unlink,
true,
true);
215 "Scene '%s' is the last local one, cannot be removed",
225 "Cannot create object in main database with an evaluated data data-block");
230 rna_idname_validate(name, safe_name);
260static Material *rna_Main_materials_new(
Main *bmain,
const char *name)
263 rna_idname_validate(name, safe_name);
273static void rna_Main_materials_gpencil_data(
Main * ,
PointerRNA *id_ptr)
275 ID *
id =
static_cast<ID *
>(id_ptr->
data);
280static void rna_Main_materials_gpencil_remove(
Main * ,
PointerRNA *id_ptr)
282 ID *
id =
static_cast<ID *
>(id_ptr->
data);
296static bNodeTree *rna_Main_nodetree_new(
Main *bmain,
const char *name,
int type)
299 rna_idname_validate(name, safe_name);
314static Mesh *rna_Main_meshes_new(
Main *bmain,
const char *name)
317 rna_idname_validate(name, safe_name);
328static Mesh *rna_Main_meshes_new_from_object(
Main *bmain,
331 bool preserve_all_data_layers,
332 Depsgraph *depsgraph)
334 switch (object->
type) {
347 bmain, depsgraph,
object, preserve_all_data_layers);
354static Light *rna_Main_lights_new(
Main *bmain,
const char *name,
int type)
357 rna_idname_validate(name, safe_name);
368static Image *rna_Main_images_new(
Main *bmain,
379 rna_idname_validate(name, safe_name);
381 float color[4] = {0.0, 0.0, 0.0, 1.0};
399static Image *rna_Main_images_load(
Main *bmain,
401 const char *filepath,
407 if (check_existing) {
417 "Cannot read '%s': %s",
419 errno ? strerror(errno) :
RPT_(
"unsupported image format"));
429static Lattice *rna_Main_lattices_new(
Main *bmain,
const char *name)
432 rna_idname_validate(name, safe_name);
442static Curve *rna_Main_curves_new(
Main *bmain,
const char *name,
int type)
445 rna_idname_validate(name, safe_name);
455static MetaBall *rna_Main_metaballs_new(
Main *bmain,
const char *name)
458 rna_idname_validate(name, safe_name);
468static VFont *rna_Main_fonts_load(
Main *bmain,
470 const char *filepath,
476 if (check_existing) {
486 "Cannot read '%s': %s",
488 errno ? strerror(errno) :
RPT_(
"unsupported font format"));
496static Tex *rna_Main_textures_new(
Main *bmain,
const char *name,
int type)
499 rna_idname_validate(name, safe_name);
510static Brush *rna_Main_brushes_new(
Main *bmain,
const char *name,
int mode)
513 rna_idname_validate(name, safe_name);
523static void rna_Main_brush_gpencil_data(
Main * ,
PointerRNA *id_ptr)
525 ID *
id =
static_cast<ID *
>(id_ptr->
data);
530static World *rna_Main_worlds_new(
Main *bmain,
const char *name)
533 rna_idname_validate(name, safe_name);
543static Collection *rna_Main_collections_new(
Main *bmain,
const char *name)
546 rna_idname_validate(name, safe_name);
555static Speaker *rna_Main_speakers_new(
Main *bmain,
const char *name)
558 rna_idname_validate(name, safe_name);
568static bSound *rna_Main_sounds_load(
Main *bmain,
const char *name,
bool check_existing)
572 if (check_existing) {
586static Text *rna_Main_texts_new(
Main *bmain,
const char *name)
589 rna_idname_validate(name, safe_name);
598static Text *rna_Main_texts_load(
Main *bmain,
600 const char *filepath,
611 "Cannot read '%s': %s",
613 errno ? strerror(errno) :
RPT_(
"unable to load text"));
621static bArmature *rna_Main_armatures_new(
Main *bmain,
const char *name)
624 rna_idname_validate(name, safe_name);
634static bAction *rna_Main_actions_new(
Main *bmain,
const char *name)
637 rna_idname_validate(name, safe_name);
651 rna_idname_validate(name, safe_name);
661static Palette *rna_Main_palettes_new(
Main *bmain,
const char *name)
664 rna_idname_validate(name, safe_name);
676 const char *filepath,
683 if (check_existing) {
690 if (clip !=
nullptr) {
696 "Cannot read '%s': %s",
698 errno ? strerror(errno) :
RPT_(
"unable to load movie clip"));
708static Mask *rna_Main_mask_new(
Main *bmain,
const char *name)
711 rna_idname_validate(name, safe_name);
724 rna_idname_validate(name, safe_name);
734static LightProbe *rna_Main_lightprobe_new(
Main *bmain,
const char *name,
int type)
737 rna_idname_validate(name, safe_name);
750static bGPdata *rna_Main_annotations_new(
Main *bmain,
const char *name)
753 rna_idname_validate(name, safe_name);
763static GreasePencil *rna_Main_grease_pencils_new(
Main *bmain,
const char *name)
766 rna_idname_validate(name, safe_name);
773 return grease_pencil;
776static Curves *rna_Main_hair_curves_new(
Main *bmain,
const char *name)
779 rna_idname_validate(name, safe_name);
789static PointCloud *rna_Main_pointclouds_new(
Main *bmain,
const char *name)
792 rna_idname_validate(name, safe_name);
802static Volume *rna_Main_volumes_new(
Main *bmain,
const char *name)
805 rna_idname_validate(name, safe_name);
816# define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
817 static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \
819 BKE_main_id_tag_listbase(&bmain->_listbase_name, ID_TAG_DOIT, value); \
822RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras,
ID_CA)
823RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes,
ID_SCE)
824RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects,
ID_OB)
825RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials,
ID_MA)
826RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees,
ID_NT)
827RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes,
ID_ME)
828RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights,
ID_LA)
829RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries,
ID_LI)
830RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens,
ID_SCR)
831RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm,
ID_WM)
832RNA_MAIN_ID_TAG_FUNCS_DEF(images, images,
ID_IM)
833RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices,
ID_LT)
835RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs,
ID_MB)
836RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts,
ID_VF)
837RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures,
ID_TE)
838RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brushes,
ID_BR)
839RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds,
ID_WO)
840RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections,
ID_GR)
842RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts,
ID_TXT)
843RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers,
ID_SPK)
844RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds,
ID_SO)
845RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures,
ID_AR)
846RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions,
ID_AC)
847RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles,
ID_PA)
848RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes,
ID_PAL)
849RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils,
ID_GD_LEGACY)
850RNA_MAIN_ID_TAG_FUNCS_DEF(grease_pencils, grease_pencils,
ID_GP)
851RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips,
ID_MC)
852RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks,
ID_MSK)
853RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles,
ID_LS)
854RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles,
ID_CF)
855RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves,
ID_PC)
856RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces,
ID_WS)
857RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes,
ID_LP)
858RNA_MAIN_ID_TAG_FUNCS_DEF(hair_curves, hair_curves,
ID_CV)
859RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds,
ID_PT)
860RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes,
ID_VO)
862# undef RNA_MAIN_ID_TAG_FUNCS_DEF
877 func,
"filepath",
nullptr, 0,
"",
"File path to load image from");
897 parm =
RNA_def_string(func,
"name",
"Camera", 0,
"",
"New name for the data-block");
900 parm =
RNA_def_pointer(func,
"camera",
"Camera",
"",
"New camera data-block");
906 parm =
RNA_def_pointer(func,
"camera",
"Camera",
"",
"Camera to remove");
913 "Unlink all usages of this camera before deleting it "
914 "(WARNING: will also delete objects instancing that camera data)");
919 "Decrement user counter of all datablocks used by this camera");
921 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this camera");
941 parm =
RNA_def_string(func,
"name",
"Scene", 0,
"",
"New name for the data-block");
944 parm =
RNA_def_pointer(func,
"scene",
"Scene",
"",
"New scene data-block");
954 func,
"do_unlink",
true,
"",
"Unlink all usages of this scene before deleting it");
975 parm =
RNA_def_string(func,
"name",
"Object", 0,
"",
"New name for the data-block");
977 parm =
RNA_def_pointer(func,
"object_data",
"ID",
"",
"Object data or None for an empty object");
981 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"New object data-block");
987 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"Object to remove");
991 func,
"do_unlink",
true,
"",
"Unlink all usages of this object before deleting it");
996 "Decrement user counter of all datablocks used by this object");
998 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this object");
1018 parm =
RNA_def_string(func,
"name",
"Material", 0,
"",
"New name for the data-block");
1021 parm =
RNA_def_pointer(func,
"material",
"Material",
"",
"New material data-block");
1024 func =
RNA_def_function(srna,
"create_gpencil_data",
"rna_Main_materials_gpencil_data");
1029 func =
RNA_def_function(srna,
"remove_gpencil_data",
"rna_Main_materials_gpencil_remove");
1037 parm =
RNA_def_pointer(func,
"material",
"Material",
"",
"Material to remove");
1041 func,
"do_unlink",
true,
"",
"Unlink all usages of this material before deleting it");
1046 "Decrement user counter of all datablocks used by this material");
1048 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this material");
1067 parm =
RNA_def_string(func,
"name",
"NodeGroup", 0,
"",
"New name for the data-block");
1074 parm =
RNA_def_pointer(func,
"tree",
"NodeTree",
"",
"New node tree data-block");
1080 parm =
RNA_def_pointer(func,
"tree",
"NodeTree",
"",
"Node tree to remove");
1084 func,
"do_unlink",
true,
"",
"Unlink all usages of this node tree before deleting it");
1089 "Decrement user counter of all datablocks used by this node tree");
1091 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this node tree");
1110 parm =
RNA_def_string(func,
"name",
"Mesh", 0,
"",
"New name for the data-block");
1113 parm =
RNA_def_pointer(func,
"mesh",
"Mesh",
"",
"New mesh data-block");
1116 func =
RNA_def_function(srna,
"new_from_object",
"rna_Main_meshes_new_from_object");
1119 "Add a new mesh created from given object (undeformed geometry if object is original, and "
1120 "final evaluated geometry, with all modifiers etc., if object is evaluated)");
1122 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"Object to create mesh from");
1125 "preserve_all_data_layers",
1128 "Preserve all data layers in the mesh, like UV maps and vertex groups. "
1129 "By default Blender only computes the subset of data layers needed for viewport "
1130 "display and rendering, for better performance.");
1136 "Evaluated dependency graph which is required when preserve_all_data_layers is true");
1141 "Mesh created from object, remove it if it is only used for export");
1154 "Unlink all usages of this mesh before deleting it "
1155 "(WARNING: will also delete objects instancing that mesh data)");
1160 "Decrement user counter of all datablocks used by this mesh data");
1162 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this mesh data");
1182 parm =
RNA_def_string(func,
"name",
"Light", 0,
"",
"New name for the data-block");
1188 parm =
RNA_def_pointer(func,
"light",
"Light",
"",
"New light data-block");
1194 parm =
RNA_def_pointer(func,
"light",
"Light",
"",
"Light to remove");
1201 "Unlink all usages of this light before deleting it "
1202 "(WARNING: will also delete objects instancing that light data)");
1207 "Decrement user counter of all datablocks used by this light data");
1209 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this light data");
1234 parm =
RNA_def_pointer(func,
"library",
"Library",
"",
"Library to remove");
1238 func,
"do_unlink",
true,
"",
"Unlink all usages of this library before deleting it");
1243 "Decrement user counter of all datablocks used by this library");
1245 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this library");
1292 parm =
RNA_def_string(func,
"name",
"Image", 0,
"",
"New name for the data-block");
1294 parm =
RNA_def_int(func,
"width", 1024, 1, INT_MAX,
"",
"Width of the image", 1, INT_MAX);
1296 parm =
RNA_def_int(func,
"height", 1024, 1, INT_MAX,
"",
"Height of the image", 1, INT_MAX);
1300 func,
"float_buffer",
false,
"Float Buffer",
"Create an image with floating-point color");
1301 RNA_def_boolean(func,
"stereo3d",
false,
"Stereo 3D",
"Create left and right views");
1303 func,
"is_data",
false,
"Is Data",
"Create image with non-color data color space");
1304 RNA_def_boolean(func,
"tiled",
false,
"Tiled",
"Create a tiled image");
1306 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"New image data-block");
1313 func,
"filepath",
"File Path", 0,
"",
"Path of the file to load");
1319 "Using existing data-block if this file is already loaded");
1321 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"New image data-block");
1327 parm =
RNA_def_pointer(func,
"image",
"Image",
"",
"Image to remove");
1331 func,
"do_unlink",
true,
"",
"Unlink all usages of this image before deleting it");
1333 func,
"do_id_user",
true,
"",
"Decrement user counter of all datablocks used by this image");
1335 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this image");
1355 parm =
RNA_def_string(func,
"name",
"Lattice", 0,
"",
"New name for the data-block");
1358 parm =
RNA_def_pointer(func,
"lattice",
"Lattice",
"",
"New lattice data-block");
1364 parm =
RNA_def_pointer(func,
"lattice",
"Lattice",
"",
"Lattice to remove");
1371 "Unlink all usages of this lattice before deleting it "
1372 "(WARNING: will also delete objects instancing that lattice data)");
1377 "Decrement user counter of all datablocks used by this lattice data");
1379 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this lattice data");
1398 parm =
RNA_def_string(func,
"name",
"Curve", 0,
"",
"New name for the data-block");
1404 parm =
RNA_def_pointer(func,
"curve",
"Curve",
"",
"New curve data-block");
1410 parm =
RNA_def_pointer(func,
"curve",
"Curve",
"",
"Curve to remove");
1417 "Unlink all usages of this curve before deleting it "
1418 "(WARNING: will also delete objects instancing that curve data)");
1423 "Decrement user counter of all datablocks used by this curve data");
1425 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this curve data");
1444 parm =
RNA_def_string(func,
"name",
"MetaBall", 0,
"",
"New name for the data-block");
1447 parm =
RNA_def_pointer(func,
"metaball",
"MetaBall",
"",
"New metaball data-block");
1453 parm =
RNA_def_pointer(func,
"metaball",
"MetaBall",
"",
"Metaball to remove");
1460 "Unlink all usages of this metaball before deleting it "
1461 "(WARNING: will also delete objects instancing that metaball data)");
1466 "Decrement user counter of all datablocks used by this metaball data");
1468 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this metaball data");
1489 func,
"filepath",
"File Path", 0,
"",
"path of the font to load");
1495 "Using existing data-block if this file is already loaded");
1497 parm =
RNA_def_pointer(func,
"vfont",
"VectorFont",
"",
"New font data-block");
1503 parm =
RNA_def_pointer(func,
"vfont",
"VectorFont",
"",
"Font to remove");
1507 func,
"do_unlink",
true,
"",
"Unlink all usages of this font before deleting it");
1509 func,
"do_id_user",
true,
"",
"Decrement user counter of all datablocks used by this font");
1511 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this font");
1530 parm =
RNA_def_string(func,
"name",
"Texture", 0,
"",
"New name for the data-block");
1536 parm =
RNA_def_pointer(func,
"texture",
"Texture",
"",
"New texture data-block");
1542 parm =
RNA_def_pointer(func,
"texture",
"Texture",
"",
"Texture to remove");
1546 func,
"do_unlink",
true,
"",
"Unlink all usages of this texture before deleting it");
1551 "Decrement user counter of all datablocks used by this texture");
1553 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this texture");
1572 parm =
RNA_def_string(func,
"name",
"Brush", 0,
"",
"New name for the data-block");
1579 "Paint Mode for the new brush");
1581 parm =
RNA_def_pointer(func,
"brush",
"Brush",
"",
"New brush data-block");
1587 parm =
RNA_def_pointer(func,
"brush",
"Brush",
"",
"Brush to remove");
1591 func,
"do_unlink",
true,
"",
"Unlink all usages of this brush before deleting it");
1593 func,
"do_id_user",
true,
"",
"Decrement user counter of all datablocks used by this brush");
1595 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this brush");
1601 func =
RNA_def_function(srna,
"create_gpencil_data",
"rna_Main_brush_gpencil_data");
1620 parm =
RNA_def_string(func,
"name",
"World", 0,
"",
"New name for the data-block");
1623 parm =
RNA_def_pointer(func,
"world",
"World",
"",
"New world data-block");
1629 parm =
RNA_def_pointer(func,
"world",
"World",
"",
"World to remove");
1633 func,
"do_unlink",
true,
"",
"Unlink all usages of this world before deleting it");
1635 func,
"do_id_user",
true,
"",
"Decrement user counter of all datablocks used by this world");
1637 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this world");
1657 parm =
RNA_def_string(func,
"name",
"Collection", 0,
"",
"New name for the data-block");
1660 parm =
RNA_def_pointer(func,
"collection",
"Collection",
"",
"New collection data-block");
1666 parm =
RNA_def_pointer(func,
"collection",
"Collection",
"",
"Collection to remove");
1670 func,
"do_unlink",
true,
"",
"Unlink all usages of this collection before deleting it");
1675 "Decrement user counter of all datablocks used by this collection");
1677 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this collection");
1697 parm =
RNA_def_string(func,
"name",
"Speaker", 0,
"",
"New name for the data-block");
1700 parm =
RNA_def_pointer(func,
"speaker",
"Speaker",
"",
"New speaker data-block");
1706 parm =
RNA_def_pointer(func,
"speaker",
"Speaker",
"",
"Speaker to remove");
1713 "Unlink all usages of this speaker before deleting it "
1714 "(WARNING: will also delete objects instancing that speaker data)");
1719 "Decrement user counter of all datablocks used by this speaker data");
1721 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this speaker data");
1741 parm =
RNA_def_string(func,
"name",
"Text", 0,
"",
"New name for the data-block");
1744 parm =
RNA_def_pointer(func,
"text",
"Text",
"",
"New text data-block");
1754 func,
"do_unlink",
true,
"",
"Unlink all usages of this text before deleting it");
1756 func,
"do_id_user",
true,
"",
"Decrement user counter of all datablocks used by this text");
1758 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this text");
1765 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
1768 func,
"internal",
false,
"Make internal",
"Make text file internal after loading");
1770 parm =
RNA_def_pointer(func,
"text",
"Text",
"",
"New text data-block");
1793 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
1799 "Using existing data-block if this file is already loaded");
1801 parm =
RNA_def_pointer(func,
"sound",
"Sound",
"",
"New text data-block");
1807 parm =
RNA_def_pointer(func,
"sound",
"Sound",
"",
"Sound to remove");
1811 func,
"do_unlink",
true,
"",
"Unlink all usages of this sound before deleting it");
1813 func,
"do_id_user",
true,
"",
"Decrement user counter of all datablocks used by this sound");
1815 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this sound");
1835 parm =
RNA_def_string(func,
"name",
"Armature", 0,
"",
"New name for the data-block");
1838 parm =
RNA_def_pointer(func,
"armature",
"Armature",
"",
"New armature data-block");
1844 parm =
RNA_def_pointer(func,
"armature",
"Armature",
"",
"Armature to remove");
1851 "Unlink all usages of this armature before deleting it "
1852 "(WARNING: will also delete objects instancing that armature data)");
1857 "Decrement user counter of all datablocks used by this armature data");
1859 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this armature data");
1878 parm =
RNA_def_string(func,
"name",
"Action", 0,
"",
"New name for the data-block");
1881 parm =
RNA_def_pointer(func,
"action",
"Action",
"",
"New action data-block");
1887 parm =
RNA_def_pointer(func,
"action",
"Action",
"",
"Action to remove");
1891 func,
"do_unlink",
true,
"",
"Unlink all usages of this action before deleting it");
1896 "Decrement user counter of all datablocks used by this action");
1898 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this action");
1918 "Add a new particle settings instance to the main database");
1919 parm =
RNA_def_string(func,
"name",
"ParticleSettings", 0,
"",
"New name for the data-block");
1923 func,
"particle",
"ParticleSettings",
"",
"New particle settings data-block");
1929 func,
"Remove a particle settings instance from the current blendfile");
1930 parm =
RNA_def_pointer(func,
"particle",
"ParticleSettings",
"",
"Particle Settings to remove");
1937 "Unlink all usages of those particle settings before deleting them");
1942 "Decrement user counter of all datablocks used by this particle settings");
1947 "Make sure interface does not reference this particle settings");
1967 parm =
RNA_def_string(func,
"name",
"Palette", 0,
"",
"New name for the data-block");
1970 parm =
RNA_def_pointer(func,
"palette",
"Palette",
"",
"New palette data-block");
1976 parm =
RNA_def_pointer(func,
"palette",
"Palette",
"",
"Palette to remove");
1980 func,
"do_unlink",
true,
"",
"Unlink all usages of this palette before deleting it");
1985 "Decrement user counter of all datablocks used by this palette");
1987 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this palette");
2040 parm =
RNA_def_string(func,
"name",
"GreasePencil", 0,
"",
"New name for the data-block");
2043 parm =
RNA_def_pointer(func,
"grease_pencil",
"GreasePencil",
"",
"New annotation data-block");
2049 parm =
RNA_def_pointer(func,
"grease_pencil",
"GreasePencil",
"",
"Grease Pencil to remove");
2053 func,
"do_unlink",
true,
"",
"Unlink all usages of this annotation before deleting it");
2058 "Decrement user counter of all datablocks used by this annotation");
2060 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this annotation");
2070 srna =
RNA_def_struct(brna,
"BlendDataGreasePencilsV3",
nullptr);
2080 parm =
RNA_def_string(func,
"name",
"GreasePencil", 0,
"",
"New name for the data-block");
2084 func,
"grease_pencil",
"GreasePencilv3",
"",
"New Grease Pencil data-block");
2090 "Remove a Grease Pencil instance from the current blendfile");
2091 parm =
RNA_def_pointer(func,
"grease_pencil",
"GreasePencilv3",
"",
"Grease Pencil to remove");
2095 func,
"do_unlink",
true,
"",
"Unlink all usages of this Grease Pencil before deleting it");
2100 "Decrement user counter of all datablocks used by this Grease Pencil");
2102 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this Grease Pencil");
2123 parm =
RNA_def_pointer(func,
"clip",
"MovieClip",
"",
"Movie clip to remove");
2127 func,
"do_unlink",
true,
"",
"Unlink all usages of this movie clip before deleting it");
2132 "Decrement user counter of all datablocks used by this movie clip");
2134 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this movie clip");
2141 "Add a new movie clip to the main database from a file "
2142 "(while ``check_existing`` is disabled for consistency with other load functions, "
2143 "behavior with multiple movie-clips using the same file may incorrectly generate proxies)");
2145 func,
"filepath",
"Path",
FILE_MAX,
"",
"path for the data-block");
2151 "Using existing data-block if this file is already loaded");
2153 parm =
RNA_def_pointer(func,
"clip",
"MovieClip",
"",
"New movie clip data-block");
2176 func,
"name",
nullptr,
MAX_ID_NAME - 2,
"Mask",
"Name of new mask data-block");
2179 parm =
RNA_def_pointer(func,
"mask",
"Mask",
"",
"New mask data-block");
2190 func,
"do_unlink",
true,
"",
"Unlink all usages of this mask before deleting it");
2192 func,
"do_id_user",
true,
"",
"Decrement user counter of all datablocks used by this mask");
2194 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this mask");
2214 parm =
RNA_def_string(func,
"name",
"FreestyleLineStyle", 0,
"",
"New name for the data-block");
2217 parm =
RNA_def_pointer(func,
"linestyle",
"FreestyleLineStyle",
"",
"New line style data-block");
2223 parm =
RNA_def_pointer(func,
"linestyle",
"FreestyleLineStyle",
"",
"Line style to remove");
2227 func,
"do_unlink",
true,
"",
"Unlink all usages of this line style before deleting it");
2232 "Decrement user counter of all datablocks used by this line style");
2234 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this line style");
2266 parm =
RNA_def_string(func,
"name",
"Probe", 0,
"",
"New name for the data-block");
2272 parm =
RNA_def_pointer(func,
"lightprobe",
"LightProbe",
"",
"New light probe data-block");
2278 parm =
RNA_def_pointer(func,
"lightprobe",
"LightProbe",
"",
"Light probe to remove");
2285 "Unlink all usages of this light probe before deleting it "
2286 "(WARNING: will also delete objects instancing that light probe data)");
2291 "Decrement user counter of all datablocks used by this light probe");
2293 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this light probe");
2313 parm =
RNA_def_string(func,
"name",
"Curves", 0,
"",
"New name for the data-block");
2316 parm =
RNA_def_pointer(func,
"curves",
"Curves",
"",
"New curves data-block");
2322 parm =
RNA_def_pointer(func,
"curves",
"Curves",
"",
"Curves data-block to remove");
2329 "Unlink all usages of this curves before deleting it "
2330 "(WARNING: will also delete objects instancing that curves data)");
2335 "Decrement user counter of all datablocks used by this curves data");
2337 func,
"do_ui_user",
true,
"",
"Make sure interface does not reference this curves data");
2357 parm =
RNA_def_string(func,
"name",
"PointCloud", 0,
"",
"New name for the data-block");
2360 parm =
RNA_def_pointer(func,
"pointcloud",
"PointCloud",
"",
"New point cloud data-block");
2366 parm =
RNA_def_pointer(func,
"pointcloud",
"PointCloud",
"",
"Point cloud to remove");
2373 "Unlink all usages of this point cloud before deleting it "
2374 "(WARNING: will also delete objects instancing that point cloud data)");
2379 "Decrement user counter of all datablocks used by this point cloud data");
2384 "Make sure interface does not reference this point cloud data");
2404 parm =
RNA_def_string(func,
"name",
"Volume", 0,
"",
"New name for the data-block");
2407 parm =
RNA_def_pointer(func,
"volume",
"Volume",
"",
"New volume data-block");
2413 parm =
RNA_def_pointer(func,
"volume",
"Volume",
"",
"Volume to remove");
2420 "Unlink all usages of this volume before deleting it "
2421 "(WARNING: will also delete objects instancing that volume data)");
2426 "Decrement user counter of all datablocks used by this volume data");
2428 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)
@ LIB_ID_FREE_NO_USER_REFCOUNT
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL()
void id_fake_user_clear(ID *id)
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.
Object groups, one object can be in many groups at once.
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
#define ID_REAL_USERS(id)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
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)