39 # include "winsock2.h"
44 #define DNA_DEPRECATED_ALLOW
120 #define U (*((const UserDef *)&U))
179 #define USE_BHEAD_READ_ON_DEMAND
182 #define USE_GHASH_BHEAD
185 #define USE_GHASH_RESTORE_POINTER
190 #ifdef USE_DEBUG_PRINT
191 # define DEBUG_PRINTF(...) printf(__VA_ARGS__)
193 # define DEBUG_PRINTF(...)
205 #ifdef USE_BHEAD_READ_ON_DEMAND
215 #define BHEADN_FROM_BHEAD(bh) ((BHeadN *)POINTER_OFFSET(bh, -(int)offsetof(BHeadN, bhead)))
219 #define BHEAD_USE_READ_ON_DEMAND(bhead) ((bhead)->code == DATA)
230 char fixed_buf[1024];
235 vsnprintf(fixed_buf,
sizeof(fixed_buf),
format, args);
238 fixed_buf[
sizeof(fixed_buf) - 1] =
'\0';
242 if (
G.background == 0) {
250 return lib->parent ?
lib->parent->filepath_abs :
"<direct>";
274 #define ENTRIES_CAPACITY(onm) (1ll << (onm)->capacity_exp)
275 #define MAP_CAPACITY(onm) (1ll << ((onm)->capacity_exp + 1))
276 #define SLOT_MASK(onm) (MAP_CAPACITY(onm) - 1)
277 #define DEFAULT_SIZE_EXP 6
278 #define PERTURB_SHIFT 5
281 #define ITER_SLOTS(onm, KEY, SLOT_NAME, INDEX_NAME) \
282 uint32_t hash = BLI_ghashutil_ptrhash(KEY); \
283 uint32_t mask = SLOT_MASK(onm); \
284 uint perturb = hash; \
285 int SLOT_NAME = mask & hash; \
286 int INDEX_NAME = onm->map[SLOT_NAME]; \
287 for (;; SLOT_NAME = mask & ((5 * SLOT_NAME) + 1 + perturb), \
288 perturb >>= PERTURB_SHIFT, \
289 INDEX_NAME = onm->map[SLOT_NAME])
294 if (stored_index == -1) {
295 onm->
map[slot] = index;
322 if (entry->
oldp == addr) {
343 for (
int i = 0; i < onm->
nentries; i++) {
365 if (oldaddr ==
NULL || newaddr ==
NULL) {
374 entry.
oldp = oldaddr;
375 entry.
newp = newaddr;
391 if (increase_users) {
417 for (
int i = 0; i < onm->
nentries; i++) {
419 if (entry->
nr == 0) {
437 #undef ENTRIES_CAPACITY
440 #undef DEFAULT_SIZE_EXP
464 Main *tojoin, *mainl;
466 mainl = mainlist->
first;
467 while ((tojoin = mainl->
next)) {
476 for (
ID *
id = lb_src->
first, *idnext;
id;
id = idnext) {
483 Main *mainvar = lib_main_array[
id->lib->temp_index];
489 printf(
"%s: invalid library for '%s'\n", __func__,
id->
name);
517 lib_main_array[i] = libmain;
528 split_libdata(lbarray[i], lib_main_array, lib_main_array_len);
553 main->curlib->versionfile =
main->versionfile;
554 main->curlib->subversionfile =
main->subversionfile;
562 return bhead->
code <= 0xFFFF;
571 const short id_type_code = bhead->
code & 0xFFFF;
575 #ifdef USE_GHASH_BHEAD
581 bool is_link =
false;
582 int code_prev =
ENDB;
586 if (code_prev != bhead->
code) {
587 code_prev = bhead->
code;
603 if (code_prev != bhead->
code) {
604 code_prev = bhead->
code;
631 for (m = mainlist->
first; m; m = m->
next) {
636 printf(
"blo_find_main: found library %s\n", libname);
663 printf(
"blo_find_main: added new lib %s\n", filepath);
691 if ((bhead->
code & 0xFFFF) == 0) {
705 if ((bhead->
code & 0xFFFF) == 0) {
722 bhead4->
len = bhead8->
len;
728 if (do_endian_swap) {
734 memcpy(&old, &bhead8->
old, 8);
735 bhead4->
old = (int)(old >> 3);
738 bhead4->
nr = bhead8->
nr;
747 bhead8->
len = bhead4->
len;
750 bhead8->
old = bhead4->
old;
752 bhead8->
nr = bhead4->
nr;
778 readsize = fd->
read(fd, &bhead4,
sizeof(bhead4),
NULL);
780 if (readsize ==
sizeof(bhead4) || bhead4.
code ==
ENDB) {
791 memcpy(&bhead, &bhead4,
MIN2(
sizeof(bhead),
sizeof(bhead4)));
801 readsize = fd->
read(fd, &bhead8,
sizeof(bhead8),
NULL);
803 if (readsize ==
sizeof(bhead8) || bhead8.
code ==
ENDB) {
814 memcpy(&bhead, &bhead8,
MIN2(
sizeof(bhead),
sizeof(bhead8)));
834 #ifdef USE_BHEAD_READ_ON_DEMAND
843 new_bhead->
bhead = bhead;
844 off64_t seek_new = fd->
seek(fd, bhead.
len, SEEK_CUR);
845 if (seek_new == -1) {
861 #ifdef USE_BHEAD_READ_ON_DEMAND
866 new_bhead->
bhead = bhead;
903 if (new_bhead ==
NULL) {
908 bhead = &new_bhead->
bhead;
933 new_bhead = new_bhead->
next;
934 if (new_bhead ==
NULL) {
942 bhead = &new_bhead->
bhead;
948 #ifdef USE_BHEAD_READ_ON_DEMAND
964 if (fd->
seek(fd, offset_backup, SEEK_SET) == -1) {
982 return &new_bhead_data->
bhead;
1007 readsize = fd->
read(fd, header,
sizeof(header),
NULL);
1009 if (readsize ==
sizeof(header) &&
STREQLEN(header,
"BLENDER", 7) &&
ELEM(header[7],
'_',
'-') &&
1010 ELEM(header[8],
'v',
'V') &&
1011 (isdigit(header[9]) && isdigit(header[10]) && isdigit(header[11]))) {
1015 if (header[7] ==
'_') {
1017 if (
sizeof(
void *) != 4) {
1022 if (
sizeof(
void *) != 8) {
1035 memcpy(num, header + 9, 3);
1063 subversion = atoi(num);
1069 &bhead[1], bhead->
len, do_endian_swap,
true, r_error_message);
1079 fd->
filesdna,
"ID",
"AssetMetaData",
"*asset_data");
1091 *r_error_message =
"Missing DNA block";
1098 int *blend_thumb =
NULL;
1103 int *
data = (
int *)(bhead + 1);
1105 if (bhead->
len < (
sizeof(
int[2]))) {
1109 if (do_endian_swap) {
1146 bool *
UNUSED(r_is_memchunck_identical))
1171 bool *
UNUSED(r_is_memchunck_identical))
1192 bool *
UNUSED(r_is_memchunck_identical))
1212 bool *
UNUSED(r_is_memchunck_identical))
1229 if (whence == SEEK_CUR) {
1232 else if (whence == SEEK_SET) {
1235 else if (whence == SEEK_END) {
1242 if (new_pos < 0 || new_pos > filedata->
buffersize) {
1255 bool *r_is_memchunck_identical)
1258 static size_t offset = 0;
1260 size_t chunkoffset, readsize, totread;
1262 if (r_is_memchunck_identical !=
NULL) {
1263 *r_is_memchunck_identical =
true;
1278 seek += chunk->
size;
1279 chunk = chunk->
next;
1290 if (seek - offset == chunk->
size) {
1291 offset += chunk->
size;
1292 chunk = chunk->
next;
1296 if (chunk ==
NULL) {
1297 printf(
"illegal read, chunk zero\n");
1301 chunkoffset = seek - offset;
1302 readsize =
size - totread;
1307 if (chunkoffset + readsize > chunk->
size) {
1308 readsize = chunk->
size - chunkoffset;
1312 totread += readsize;
1315 if (r_is_memchunck_identical !=
NULL) {
1324 }
while (totread <
size);
1353 const char *error_message =
NULL;
1356 reports,
RPT_ERROR,
"Failed to read blend file '%s': %s", fd->
relabase, error_message);
1363 reports,
RPT_ERROR,
"Failed to read blend file '%s', not a blend file", fd->
relabase);
1377 size_t buffersize = 0;
1380 gzFile gzfile = (gzFile)Z_NULL;
1386 if (read(
file, header,
sizeof(header)) !=
sizeof(header)) {
1389 "Unable to read '%s': %s",
1391 errno ? strerror(errno) :
TIP_(
"insufficient content"));
1396 if (memcmp(header,
"BLENDER",
sizeof(header)) == 0) {
1401 if (mmap_file !=
NULL) {
1412 if ((read_fn ==
NULL) &&
1414 (header[0] == 0x1f && header[1] == 0x8b)) {
1416 if (gzfile == (gzFile)Z_NULL) {
1419 "Unable to open '%s': %s",
1421 errno ? strerror(errno) :
TIP_(
"unknown error reading file"));
1431 if (read_fn ==
NULL) {
1456 "Unable to open '%s': %s",
1458 errno ? strerror(errno) :
TIP_(
"unknown error reading file"));
1502 bool *
UNUSED(r_is_memchunck_identical))
1510 err = inflate(&filedata->
strm, Z_SYNC_FLUSH);
1512 if (
err == Z_STREAM_END) {
1516 printf(
"fd_read_gzip_from_memory: zlib error\n");
1530 fd->
strm.total_out = 0;
1531 fd->
strm.zalloc = Z_NULL;
1532 fd->
strm.zfree = Z_NULL;
1534 if (inflateInit2(&fd->
strm, (16 + MAX_WBITS)) != Z_OK) {
1551 const char *cp = mem;
1557 if (cp[0] == 0x1f && cp[1] == 0x8b) {
1602 if (fd->
strm.next_in) {
1603 if (inflateEnd(&fd->
strm) != Z_OK) {
1604 printf(
"close gzip stream error\n");
1661 #ifdef USE_GHASH_BHEAD
1686 const char *ext_test[4] = {
".blend",
".ble",
".blend.gz",
NULL};
1706 char *slash =
NULL, *prev_slash =
NULL,
c =
'\0';
1721 strcpy(r_dir, path);
1744 if (slash[1] !=
'\0') {
1747 *r_group = slash + 1;
1751 if (prev_slash && (prev_slash[1] !=
'\0')) {
1754 *r_name = prev_slash + 1;
1779 const int width = fd_data[0];
1780 const int height = fd_data[1];
1789 memcpy(
data->rect, &fd_data[2], sz -
sizeof(*
data));
1854 entry->
nr =
GS(((
ID *)
new)->name);
1868 if (mainptr->curlib) {
1869 fd = mainptr->curlib->filedata;
1890 if (ob->id.lib !=
NULL && ob->proxy_from !=
NULL && ob->proxy_from->id.lib ==
NULL) {
1891 ob->proxy_from =
NULL;
1910 if (ima->packedfile) {
1915 if (imapf->packedfile) {
1922 if (vfont->packedfile) {
1928 if (sound->packedfile) {
1934 if (volume->packedfile) {
1940 if (
lib->packedfile) {
1954 if (entry->
nr > 0) {
1963 imapf->packedfile =
newpackedadr(fd, imapf->packedfile);
1968 vfont->packedfile =
newpackedadr(fd, vfont->packedfile);
1972 sound->packedfile =
newpackedadr(fd, sound->packedfile);
1980 volume->packedfile =
newpackedadr(fd, volume->packedfile);
2021 void *cache_storage_v)
2030 *storage_key = *key;
2040 if (cache_storage ==
NULL) {
2051 if (value ==
NULL) {
2064 void *cache_storage_v)
2069 if (value ==
NULL) {
2159 int blocksize, nblocks;
2162 data = (
char *)(bhead + 1);
2165 nblocks = bhead->
nr;
2178 #ifdef USE_BHEAD_READ_ON_DEMAND
2179 BHead *bh_orig = bh;
2184 #ifdef USE_BHEAD_READ_ON_DEMAND
2198 #ifdef USE_BHEAD_READ_ON_DEMAND
2212 #ifdef USE_BHEAD_READ_ON_DEMAND
2214 memcpy(temp, (bh + 1), bh->
len);
2226 memcpy(temp, (bh + 1), bh->
len);
2231 #ifdef USE_BHEAD_READ_ON_DEMAND
2232 if (bh_orig != bh) {
2247 return (bhead->
len) ? (
const void *)(bhead + 1) :
NULL;
2292 if (nodetree !=
NULL) {
2356 if (nodetree !=
NULL && *nodetree !=
NULL) {
2373 id_old !=
NULL ? &((
Scene *)id_old)->master_collection->id :
NULL,
2392 const ID *id_target,
2393 const ID *id_current,
2394 const bool is_identical)
2399 int recalc = id_target->
recalc;
2401 if (id_current ==
NULL) {
2410 if (!is_identical) {
2419 recalc |= id_current->
recalc;
2450 id->lib = current_library;
2455 id->py_instance =
NULL;
2490 id->recalc_after_undo_push = 0;
2494 id->recalc_after_undo_push = 0;
2504 id->override_library->runtime =
NULL;
2533 block->uid = key->
uidgen++;
2543 #ifdef USE_SETSCENE_CHECK
2547 static bool scene_validate_setscene__liblink(
Scene *sce,
const int totscene)
2556 for (
a = 0, sce_iter = sce; sce_iter->
set; sce_iter = sce_iter->
set,
a++) {
2581 #ifdef USE_SETSCENE_CHECK
2586 if (!scene_validate_setscene__liblink(sce, totscene)) {
2587 printf(
"Found cyclic background scene when linking %s\n", sce->
id.
name + 2);
2596 #undef USE_SETSCENE_CHECK
2621 #ifndef USE_GHASH_RESTORE_POINTER
2633 for (; idn; idn = idn->
next) {
2660 #ifdef USE_GHASH_RESTORE_POINTER
2672 return restore_pointer_by_name_main(mainp,
id, user);
2704 const int cb_flag = cb_data->
cb_flag;
2713 if (
GS((*id_pointer)->name) ==
ID_GR) {
2984 for (; path; path = path_next) {
2985 path_next = path->
next;
3047 ID *workspace_id = (
ID *)workspace;
3048 Scene *oldscene = win->scene;
3053 if (win->scene ==
NULL) {
3054 win->scene = curscene;
3057 STRNCPY(win->view_layer_name, cur_view_layer->
name);
3062 memcpy(&win->scene->cursor, &oldscene->
cursor,
sizeof(win->scene->cursor));
3106 TIP_(
"Library '%s', '%s' had multiple instances, save and reload!"),
3159 if (basepath ==
NULL || basepath[0] ==
'\0') {
3195 *((
short *)ph_id->
name) = idcode;
3218 ID *obdata = ob->data;
3229 return "Data from OB";
3231 return "Data from ME";
3233 return "Data from IP";
3235 return "Data from SCE";
3237 return "Data from MA";
3239 return "Data from TE";
3241 return "Data from CU";
3243 return "Data from GR";
3245 return "Data from AR";
3247 return "Data from AC";
3249 return "Data from LI";
3251 return "Data from MB";
3253 return "Data from IM";
3255 return "Data from LT";
3257 return "Data from LA";
3259 return "Data from CA";
3261 return "Data from KE";
3263 return "Data from WO";
3265 return "Data from SCR";
3267 return "Data from VF";
3269 return "Data from TXT";
3271 return "Data from SPK";
3273 return "Data from LP";
3275 return "Data from SO";
3277 return "Data from NT";
3279 return "Data from BR";
3281 return "Data from PA";
3283 return "Data from PAL";
3285 return "Data from PCRV";
3287 return "Data from GD";
3289 return "Data from WM";
3291 return "Data from MC";
3293 return "Data from MSK";
3295 return "Data from LS";
3297 return "Data from CF";
3299 return "Data from WS";
3301 return "Data from HA";
3303 return "Data from PT";
3305 return "Data from VO";
3307 return "Data from SIM";
3309 return "Data from Lib Block";
3332 bool success =
true;
3360 while (bhead && bhead->
code ==
DATA) {
3370 size_t allocname_size = strlen(allocname) + 1;
3371 char *allocname_buf = malloc(allocname_size);
3372 memcpy(allocname_buf, allocname, allocname_size);
3373 allocname = allocname_buf;
3399 while (bhead && bhead->
code ==
DATA) {
3425 for (libmain = libmain->
next; libmain; libmain = libmain->
next) {
3452 main->curlib ?
main->curlib->id.name :
"<NULL>",
3453 main->curlib ?
main->curlib->filepath :
"<NULL>");
3456 if (id_old !=
NULL) {
3460 if (id_old != bhead->
old) {
3489 const short idcode =
GS(id_old->
name);
3612 if (id_old !=
NULL) {
3635 const bool placeholder_set_indirect_extern,
3665 printf(
"%s: unknown id code '%c%c'\n", __func__, (idcode & 0xff), (idcode >> 8));
3680 ID *id_target = id_old ? id_old :
id;
3695 if (placeholder_set_indirect_extern) {
3710 const char *allocname =
dataname(idcode);
3844 main->is_locked_for_linking =
true;
3847 char build_commit_datetime[32];
3848 time_t temp_time =
main->build_commit_timestamp;
3849 struct tm *tm = (temp_time) ? gmtime(&temp_time) :
NULL;
3851 strftime(build_commit_datetime,
sizeof(build_commit_datetime),
"%Y-%m-%d %H:%M", tm);
3854 BLI_strncpy(build_commit_datetime,
"unknown",
sizeof(build_commit_datetime));
3857 printf(
"read file %s\n Version %d sub %d date %s hash %s\n",
3860 main->subversionfile,
3861 build_commit_datetime,
3878 main->is_locked_for_linking =
false;
3887 main->is_locked_for_linking =
true;
3896 main->is_locked_for_linking =
false;
4028 keymap->modal_items =
NULL;
4029 keymap->poll =
NULL;
4039 if (kmdi->remove_item) {
4042 if (kmdi->add_item) {
4143 switch (bhead->
code) {
4282 if (x1->
old >
x2->old) {
4285 if (x1->
old <
x2->old) {
4367 #ifdef USE_GHASH_BHEAD
4371 *((
short *)idname_full) = idcode;
4372 BLI_strncpy(idname_full + 2, name,
sizeof(idname_full) - 2);
4382 if (
STREQ(idname_test + 2, name)) {
4397 #ifdef USE_GHASH_BHEAD
4429 if (bheadlib ==
NULL) {
4441 TIP_(
"LIB: Data refers to main .blend file: '%s' from %s"),
4491 printf(
"expand_doit: already linked: %s lib: %s\n",
id->
name,
lib->filepath);
4539 if (nodetree !=
NULL) {
4675 view_layer->
basact = base;
4690 const bool do_append = (flag &
FILE_LINK) == 0;
4700 if (ob->id.us == 0) {
4712 if (active_collection ==
NULL) {
4730 const bool set_active =
false;
4781 bool set_active =
false;
4820 const bool set_active = set_selected;
4835 bool do_add_collection = (collection->id.tag &
LIB_TAG_DOIT) != 0;
4836 if (!do_add_collection) {
4844 Object *ob = coll_ob->ob;
4847 do_add_collection =
true;
4852 if (do_add_collection) {
4858 Object *ob = coll_ob->ob;
4879 Main *mainl,
FileData *fd,
const short idcode,
const char *name,
const int flag)
4905 printf(
"append: already linked\n");
4915 else if (use_placeholders) {
4945 int num_directly_linked = 0;
4955 (id_types_mask == 0 ||
4958 num_directly_linked++;
4977 return num_directly_linked;
5035 Main *mainvar,
FileData **fd,
const char *filepath,
const int flag,
const int id_tag_extra)
5044 (*fd)->id_tag_extra = id_tag_extra;
5062 #ifdef USE_GHASH_BHEAD
5072 const int id_tag_extra)
5077 params->id_tag_extra = id_tag_extra;
5083 const int id_tag_extra,
5087 const struct View3D *v3d)
5095 params->context.view_layer = view_layer;
5096 params->context.v3d = v3d;
5110 const char *filepath,
5179 mainvar = (*fd)->mainlist->first;
5196 for (mainvar = ((
Main *)(*fd)->mainlist->first)->
next; mainvar; mainvar = mainvar->
next) {
5209 mainvar = (*fd)->mainlist->first;
5266 params->context.view_layer,
5312 TIP_(
"LIB: %s: '%s' is directly linked from '%s' (parent '%s'), but is a "
5313 "non-linkable data type"),
5331 TIP_(
"LIB: %s: '%s' missing from '%s', parent '%s'"),
5437 TIP_(
"Read packed library: '%s', parent '%s'"),
5449 TIP_(
"Read library: '%s', '%s', parent '%s'"),
5476 #ifdef USE_GHASH_BHEAD
5517 for (
Main *mainptr = mainl->
next; mainptr; mainptr = mainptr->
next) {
5521 printf(
"Reading linked data-blocks from %s (%s)\n",
5522 mainptr->curlib->id.name,
5523 mainptr->curlib->filepath);
5544 for (
Main *mainptr = mainl->
next; mainptr; mainptr = mainptr->
next) {
5552 for (
Main *mainptr = mainl->
next; mainptr; mainptr = mainptr->
next) {
5556 if (mainptr->versionfile) {
5562 if (mainptr->curlib->filedata) {
5563 do_versions(mainptr->curlib->filedata, mainptr->curlib, main_newid);
5573 if (mainptr->curlib->filedata) {
5583 if (mainptr->curlib->filedata) {
5586 mainptr->curlib->filedata =
NULL;
5593 "LIB: %d libraries and %d linked data-blocks are missing, please check the "
5594 "Info and Outliner editors for details",
5703 for (
int i = 0; i < array_size; i++) {
5710 for (
int i = 0; i < array_size; i++) {
5722 for (
int i = 0; i < array_size; i++) {
5732 if (orig_array ==
NULL) {
5743 void *final_array =
NULL;
5745 if (file_pointer_size == current_pointer_size) {
5747 final_array = orig_array;
5749 else if (file_pointer_size == 8 && current_pointer_size == 4) {
5756 else if (file_pointer_size == 4 && current_pointer_size == 8) {
5767 *ptr_p = final_array;
5797 return reader->
main;
void BKE_animdata_blend_read_lib(struct BlendLibReader *reader, struct ID *id, struct AnimData *adt)
void BKE_animdata_blend_read_expand(struct BlendExpander *expander, struct AnimData *adt)
struct AnimData * BKE_animdata_from_id(struct ID *id)
void BKE_asset_metadata_read(struct BlendDataReader *reader, struct AssetMetaData *asset_data)
struct Collection * BKE_collection_add(struct Main *bmain, struct Collection *parent, const char *name)
bool BKE_collection_child_add(struct Main *bmain, struct Collection *parent, struct Collection *child)
bool BKE_collection_object_add(struct Main *bmain, struct Collection *collection, struct Object *ob)
void BKE_collection_blend_read_data(struct BlendDataReader *reader, struct Collection *collection)
void BKE_collection_blend_read_lib(struct BlendLibReader *reader, struct Collection *collection)
bool BKE_collection_has_object(struct Collection *collection, const struct Object *ob)
void BKE_collection_blend_read_expand(struct BlendExpander *expander, struct Collection *collection)
void BKE_collections_after_lib_link(struct Main *bmain)
void BKE_main_collections_parent_relations_rebuild(struct Main *bmain)
void IDP_BlendReadExpand(struct BlendExpander *expander, struct IDProperty *prop)
void IDP_BlendReadLib(struct BlendLibReader *reader, struct IDProperty *prop)
#define IDP_BlendDataRead(reader, prop)
bool BKE_idtype_cache_key_cmp(const void *key_a_v, const void *key_b_v)
short BKE_idtype_idcode_from_index(const int index)
bool BKE_idtype_idcode_is_linkable(const short idcode)
bool BKE_idtype_idcode_is_valid(const short idcode)
void BKE_idtype_id_foreach_cache(struct ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
const char * BKE_idtype_idcode_to_name(const short idcode)
const struct IDTypeInfo * BKE_idtype_get_info_from_id(const struct ID *id)
uint BKE_idtype_cache_key_hash(const void *key_v)
uint64_t BKE_idtype_idcode_to_idfilter(const short idcode)
@ IDTYPE_CACHE_CB_FLAGS_PERSISTENT
struct LayerCollection * BKE_layer_collection_get_active(struct ViewLayer *view_layer)
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
struct ViewLayer * BKE_view_layer_find(const struct Scene *scene, const char *layer_name)
void BKE_lib_libblock_session_uuid_ensure(struct ID *id)
void BKE_main_id_tag_all(struct Main *mainvar, const int tag, const bool value)
void * BKE_libblock_alloc(struct Main *bmain, short type, const char *name, const int flag) ATTR_WARN_UNUSED_RESULT
void * BKE_libblock_alloc_notest(short type) ATTR_WARN_UNUSED_RESULT
void BKE_lib_id_swap_full(struct Main *bmain, struct ID *id_a, struct ID *id_b)
void BKE_id_free(struct Main *bmain, void *idv)
void BKE_libblock_init_empty(struct ID *id) ATTR_NONNULL(1)
void id_us_ensure_real(struct ID *id)
void id_us_plus(struct ID *id)
void BKE_main_id_tag_idcode(struct Main *mainvar, const short type, const int tag, const bool value)
struct ID * BKE_libblock_find_name(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define MAIN_ID_SESSION_UUID_UNSET
void BKE_main_id_refcount_recompute(struct Main *bmain, const bool do_linked_only)
void id_sort_by_name(struct ListBase *lb, struct ID *id, struct ID *id_sorting_hint)
void BKE_lib_override_library_main_update(struct Main *bmain)
void BKE_lib_override_library_main_validate(struct Main *bmain, struct ReportList *reports)
void BKE_library_foreach_ID_link(struct Main *bmain, struct ID *id, LibraryIDLinkCallback callback, void *user_data, int flag)
#define FOREACH_MAIN_ID_END
struct Main * BKE_main_new(void)
#define FOREACH_MAIN_LISTBASE_ID_END
int set_listbasepointers(struct Main *main, struct ListBase *lb[])
#define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id)
#define FOREACH_MAIN_LISTBASE_END
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
#define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb)
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
#define BLEN_THUMB_MEMSIZE(_x, _y)
struct ListBase * which_libbase(struct Main *bmain, short type)
#define BLEN_THUMB_MEMSIZE_IS_VALID(_x, _y)
void BKE_main_free(struct Main *mainvar)
const char * BKE_main_blendfile_path_from_global(void)
struct IDNameLib_Map * BKE_main_idmap_create(struct Main *bmain, const bool create_valid_ids_set, struct Main *old_bmain, const int idmap_types) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
struct ID struct ID struct ID * BKE_main_idmap_lookup_uuid(struct IDNameLib_Map *id_map, const uint session_uuid) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BKE_main_idmap_destroy(struct IDNameLib_Map *id_map) ATTR_NONNULL()
struct Main * BKE_main_idmap_main_get(struct IDNameLib_Map *id_map) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct ID struct ID * BKE_main_idmap_lookup_id(struct IDNameLib_Map *id_map, const struct ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
General operations, lookup, etc. for materials.
void BKE_object_materials_test(struct Main *bmain, struct Object *ob, struct ID *id)
struct bNodeTree * ntreeFromID(struct ID *id)
void ntreeBlendReadData(struct BlendDataReader *reader, struct bNodeTree *ntree)
void ntreeBlendReadLib(struct BlendLibReader *reader, struct bNodeTree *ntree)
struct bNodeTree ** BKE_ntree_ptr_from_id(struct ID *id)
void ntreeBlendReadExpand(struct BlendExpander *expander, struct bNodeTree *ntree)
void ntreeUpdateAllNew(struct Main *main)
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_add_only_object(struct Main *bmain, int type, const char *name) ATTR_NONNULL(1) ATTR_RETURNS_NONNULL
int BKE_object_obdata_to_type(const struct ID *id) ATTR_NONNULL(1)
void BKE_packedfile_blend_read(struct BlendDataReader *reader, struct PackedFile **pf_p)
void BKE_report(ReportList *reports, ReportType type, const char *message)
const char * BKE_report_type_str(ReportType type)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
bool BKE_scene_object_find(struct Scene *scene, struct Object *ob)
void BKE_scene_object_base_flag_sync_from_base(struct Base *base)
bool BKE_screen_blend_read_data(struct BlendDataReader *reader, struct bScreen *screen)
struct WorkSpace * BKE_workspace_active_get(struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
struct bScreen * BKE_workspace_active_screen_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
void BKE_workspace_active_set(struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace) SETTER_ATTRS
struct bScreen * BKE_workspace_layout_screen_get(const struct WorkSpaceLayout *layout) GETTER_ATTRS
#define BLI_STATIC_ASSERT(a, msg)
BLI_INLINE void BLI_endian_switch_uint64(uint64_t *val) ATTR_NONNULL(1)
void BLI_endian_switch_double_array(double *val, const int size) ATTR_NONNULL(1)
void BLI_endian_switch_int32_array(int *val, const int size) ATTR_NONNULL(1)
void BLI_endian_switch_uint32_array(unsigned int *val, const int size) ATTR_NONNULL(1)
void BLI_endian_switch_float_array(float *val, const int size) ATTR_NONNULL(1)
BLI_INLINE void BLI_endian_switch_int32(int *val) ATTR_NONNULL(1)
int BLI_open(const char *filename, int oflag, int pmode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int64_t BLI_lseek(int fd, int64_t offset, int whence)
bool BLI_is_dir(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void * BLI_gzopen(const char *filename, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
GHash * BLI_ghash_str_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_haskey(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_str_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void ** BLI_ghash_lookup_p(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
bool BLI_remlink_safe(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void * BLI_findstring(const struct ListBase *listbase, const char *id, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void BLI_memarena_free(struct MemArena *ma) ATTR_NONNULL(1)
#define BLI_MEMARENA_STD_BUFSIZE
void * BLI_memarena_alloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
struct MemArena * BLI_memarena_new(const size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) ATTR_MALLOC
void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter) ATTR_NONNULL()
void * BLI_mempool_iterstep(BLI_mempool_iter *iter) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_mmap_read(BLI_mmap_file *file, void *dest, size_t offset, size_t length) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_mmap_file * BLI_mmap_open(int fd) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_mmap_free(BLI_mmap_file *file) ATTR_NONNULL(1)
bool BLI_path_extension_check_array(const char *str, const char **ext_array) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
const char * BLI_path_basename(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
bool BLI_path_is_rel(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
void BLI_path_normalize(const char *relabase, char *path) ATTR_NONNULL(2)
void BLI_path_rel(char *file, const char *relfile) ATTR_NONNULL()
const char * BLI_path_slash_rfind(const char *string) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
#define STRNCPY(dst, src)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define STREQLEN(a, b, n)
#define POINTER_AS_UINT(i)
#define UNUSED_VARS_NDEBUG(...)
#define POINTER_FROM_UINT(i)
#define POINTER_OFFSET(v, ofs)
Compatibility-like things for windows.
defines for blend-file codes.
#define BLEN_THUMB_MEMSIZE_FILE(_x, _y)
Utils ensuring .blend file (i.e. Main) is in valid state during write and/or read process.
bool BLO_main_validate_shapekeys(struct Main *bmain, struct ReportList *reports)
#define BLO_read_data_address(reader, ptr_p)
void(* BlendReadListFn)(BlendDataReader *reader, void *data)
#define BLO_read_id_address(reader, lib, id_ptr_p)
#define BLO_expand(expander, id)
external readfile function prototypes.
void(* BLOExpandDoitCallback)(void *fdhandle, struct Main *mainvar, void *idv)
@ BLO_LIBLINK_USE_PLACEHOLDERS
@ BLO_LIBLINK_NEEDS_ID_TAG_DOIT
@ BLO_LIBLINK_FORCE_INDIRECT
@ BLO_READ_SKIP_UNDO_OLD_MAIN
struct BlendHandle BlendHandle
#define BLO_EMBEDDED_STARTUP_BLEND
void DEG_id_tag_update(struct ID *id, int flag)
#define ID_FAKE_USERS(id)
@ ID_RECALC_COPY_ON_WRITE
@ LIB_TAG_UNDO_OLD_ID_REUSED
@ LIB_TAG_ID_LINK_PLACEHOLDER
#define ID_IS_LINKED(_id)
#define ID_LINK_PLACEHOLDER
@ SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC
Object groups, one object can be in many groups at once.
blenloader genfile private function prototypes
void DNA_sdna_free(struct SDNA *sdna)
struct SDNA * DNA_sdna_from_data(const void *data, const int data_len, bool do_endian_swap, bool data_alloc, const char **r_error_message)
struct DNA_ReconstructInfo * DNA_reconstruct_info_create(const struct SDNA *oldsdna, const struct SDNA *newsdna, const char *compare_flags)
void DNA_struct_switch_endian(const struct SDNA *sdna, int struct_nr, char *data)
void * DNA_struct_reconstruct(const struct DNA_ReconstructInfo *reconstruct_info, int old_struct_nr, int blocks, const void *old_blocks)
const char * DNA_struct_get_compareflags(const struct SDNA *sdna, const struct SDNA *newsdna)
void DNA_reconstruct_info_free(struct DNA_ReconstructInfo *reconstruct_info)
const struct SDNA * DNA_sdna_current_get(void)
int DNA_elem_offset(struct SDNA *sdna, const char *stype, const char *vartype, const char *name)
#define OB_DATA_SUPPORT_ID(_id_type)
#define TSE_IS_REAL_ID(_tse)
#define SCE_READFILE_LIBLINK_NEED_SETSCENE_CHECK
@ SPREADSHEET_CONTEXT_OBJECT
#define SCRIPT_SET_NULL(_script)
@ FILE_TAG_REBUILD_MAIN_FILES
@ SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR
@ FILE_COLLECTION_INSTANCE
@ USER_MENU_TYPE_OPERATOR
struct DrawDataList * DRW_drawdatalist_from_id(struct ID *id)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
ListBase seqbase_clipboard
DEGForeachIDComponentCallback callback
#define pf(_x, _i)
Prefetch 64.
int SEQ_iterator_seqbase_recursive_apply(ListBase *seqbase, int(*apply_fn)(Sequence *seq, void *), void *arg)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
size_t(* MEM_allocN_len)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
int main(int argc, char **argv)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void blo_do_versions_oldnewmap_insert(OldNewMap *onm, const void *oldaddr, void *newaddr, int nr)
void BLO_read_float3_array(BlendDataReader *reader, int array_size, float **ptr_p)
void BLO_expand_main(void *fdhandle, Main *mainvar)
static void add_loose_objects_to_scene(Main *mainvar, Main *bmain, Scene *scene, ViewLayer *view_layer, const View3D *v3d, Library *lib, const short flag)
static void read_libraries(FileData *basefd, ListBase *mainlist)
void BLO_reportf_wrap(ReportList *reports, ReportType type, const char *format,...)
static BHead * read_libblock(FileData *fd, Main *main, BHead *bhead, const int tag, const bool placeholder_set_indirect_extern, ID **r_id)
void blo_make_packed_pointer_map(FileData *fd, Main *oldmain)
static ssize_t fd_read_from_mmap(FileData *filedata, void *buffer, size_t size, bool *UNUSED(r_is_memchunck_identical))
static void lib_link_scenes_check_set(Main *bmain)
struct BlendLibReader BlendLibReader
static void link_glob_list(FileData *fd, ListBase *lb)
static void bh8_from_bh4(BHead *bhead, BHead4 *bhead4)
static BHead * blo_bhead_read_full(FileData *fd, BHead *thisblock)
static void lib_link_all(FileData *fd, Main *bmain)
void blo_cache_storage_end(FileData *fd)
static void convert_pointer_array_32_to_64(BlendDataReader *UNUSED(reader), uint array_size, const uint32_t *src, uint64_t *dst)
static void restore_pointer_user(ID *id, ID *newid, ePointerUserMode user)
static void oldnewmap_clear_map(OldNewMap *onm)
void BLO_expand_id(BlendExpander *expander, ID *id)
static void after_liblink_merged_bmain_process(Main *bmain)
static void direct_link_library(FileData *fd, Library *lib, Main *main)
static void direct_link_id_override_property_cb(BlendDataReader *reader, void *data)
void BLO_library_link_end(Main *mainl, BlendHandle **bh, const struct LibraryLink_Params *params)
BlendFileData * blo_read_file_internal(FileData *fd, const char *filepath)
static ID * link_named_part(Main *mainl, FileData *fd, const short idcode, const char *name, const int flag)
static void convert_pointer_array_64_to_32(BlendDataReader *reader, uint array_size, const uint64_t *src, uint32_t *dst)
static void lib_link_window_scene_data_restore(wmWindow *win, Scene *scene, ViewLayer *view_layer)
static void blo_cache_storage_entry_clear_in_old(ID *UNUSED(id), const IDCacheKey *key, void **cache_p, uint UNUSED(flags), void *cache_storage_v)
static void read_file_bhead_idname_map_create(FileData *fd)
static int direct_link_id_restore_recalc_exceptions(const ID *id_current)
struct BLOCacheStorage BLOCacheStorage
static int lib_link_main_data_restore_cb(LibraryIDLinkCallbackData *cb_data)
struct BlendExpander BlendExpander
static ssize_t fd_read_gzip_from_file(FileData *filedata, void *buffer, size_t size, bool *UNUSED(r_is_memchunck_identical))
static void split_main_newid(Main *mainptr, Main *main_newid)
static void link_global(FileData *fd, BlendFileData *bfd)
void * BLO_read_get_new_packed_address(BlendDataReader *reader, const void *old_address)
void BLO_library_link_params_init(struct LibraryLink_Params *params, struct Main *bmain, const int flag, const int id_tag_extra)
static bool read_libblock_is_identical(FileData *fd, BHead *bhead)
void * BLO_read_get_new_data_address_no_us(BlendDataReader *reader, const void *old_address)
static BLOExpandDoitCallback expand_doit
void blo_lib_link_restore(Main *oldmain, Main *newmain, wmWindowManager *curwm, Scene *curscene, ViewLayer *cur_view_layer)
static int direct_link_id_restore_recalc(const FileData *fd, const ID *id_target, const ID *id_current, const bool is_identical)
static void lib_link_clipboard_restore(struct IDNameLib_Map *id_map)
static ID * create_placeholder(Main *mainvar, const short idcode, const char *idname, const int tag)
static void * read_struct(FileData *fd, BHead *bh, const char *blockname)
void BLO_library_link_params_init_with_context(struct LibraryLink_Params *params, struct Main *bmain, const int flag, const int id_tag_extra, struct Scene *scene, struct ViewLayer *view_layer, const struct View3D *v3d)
Main * BLO_library_link_begin(BlendHandle **bh, const char *filepath, const struct LibraryLink_Params *params)
int BLO_library_link_copypaste(Main *mainl, BlendHandle *bh, const uint64_t id_types_mask)
static void do_versions_userdef(FileData *UNUSED(fd), BlendFileData *bfd)
static bool blo_bhead_is_id(const BHead *bhead)
static FileData * blo_decode_and_check(FileData *fd, ReportList *reports)
static void * restore_pointer_by_name(struct IDNameLib_Map *id_map, ID *id, ePointerUserMode user)
static Main * library_link_begin(Main *mainvar, FileData **fd, const char *filepath, const int flag, const int id_tag_extra)
static void direct_link_id_embedded_id(BlendDataReader *reader, Library *current_library, ID *id, ID *id_old)
void BLO_read_glob_list(BlendDataReader *reader, ListBase *list)
static int has_linked_ids_to_read(Main *mainvar)
static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID *id_old)
static int lib_link_seq_clipboard_cb(Sequence *seq, void *arg_pt)
static void library_link_clear_tag(Main *mainvar, const int flag)
static void split_libdata(ListBase *lb_src, Main **lib_main_array, const uint lib_main_array_len)
void BLO_read_double_array(BlendDataReader *reader, int array_size, double **ptr_p)
static void add_main_to_main(Main *mainvar, Main *from)
bool BLO_read_data_is_undo(BlendDataReader *reader)
static void do_versions_after_linking(Main *main, ReportList *reports)
static void direct_link_id_common(BlendDataReader *reader, Library *current_library, ID *id, ID *id_old, const int tag)
static void * oldnewmap_lookup_and_inc(OldNewMap *onm, const void *addr, bool increase_users)
#define ENTRIES_CAPACITY(onm)
static BHead * find_bhead(FileData *fd, void *old)
void BLO_read_float_array(BlendDataReader *reader, int array_size, float **ptr_p)
void BLO_read_int32_array(BlendDataReader *reader, int array_size, int32_t **ptr_p)
static const char * dataname(short id_code)
void BLO_main_expander(BLOExpandDoitCallback expand_doit_func)
#define DEBUG_PRINTF(...)
FileData * blo_filedata_from_file(const char *filepath, ReportList *reports)
static void library_link_end(Main *mainl, FileData **fd, Main *bmain, const int flag, Scene *scene, ViewLayer *view_layer, const View3D *v3d)
static void lib_link_main_data_restore(struct IDNameLib_Map *id_map, Main *newmain)
ReportList * BLO_read_data_reports(BlendDataReader *reader)
static void blo_cache_storage_entry_register(ID *id, const IDCacheKey *key, void **UNUSED(cache_p), uint UNUSED(flags), void *cache_storage_v)
static BHead * find_bhead_from_idname(FileData *fd, const char *idname)
static bool object_in_any_collection(Main *bmain, Object *ob)
void BLO_read_list(BlendDataReader *reader, struct ListBase *list)
static ssize_t fd_read_gzip_from_memory(FileData *filedata, void *buffer, size_t size, bool *UNUSED(r_is_memchunck_identical))
static void * newdataadr_no_us(FileData *fd, const void *adr)
struct OldNewMap OldNewMap
struct BlendDataReader BlendDataReader
static void add_loose_object_data_to_scene(Main *mainvar, Main *bmain, Scene *scene, ViewLayer *view_layer, const View3D *v3d, const short flag)
void * blo_do_versions_newlibadr(FileData *fd, const void *lib, const void *adr)
static void sort_bhead_old_map(FileData *fd)
static bool read_libblock_undo_restore_linked(FileData *fd, Main *main, const ID *id, BHead *bhead)
static void fix_relpaths_library(const char *basepath, Main *main)
static BHead * find_previous_lib(FileData *fd, BHead *bhead)
static void expand_doit_library(void *fdhandle, Main *mainvar, void *old)
static void * newdataadr(FileData *fd, const void *adr)
static bool read_libblock_undo_restore(FileData *fd, Main *main, BHead *bhead, const int tag, ID **r_id_old)
bool BLO_read_lib_is_undo(BlendLibReader *reader)
static void expand_id_embedded_id(BlendExpander *expander, ID *id)
static FileData * read_library_file_data(FileData *basefd, ListBase *mainlist, Main *mainl, Main *mainptr)
void * BLO_read_get_new_data_address(BlendDataReader *reader, const void *old_address)
ReportList * BLO_read_lib_reports(BlendLibReader *reader)
static bool read_libblock_undo_restore_library(FileData *fd, Main *main, const ID *id)
static void oldnewmap_free(OldNewMap *onm)
static void * oldnewmap_liblookup(OldNewMap *onm, const void *addr, const void *lib)
static void lib_link_id_embedded_id(BlendLibReader *reader, ID *id)
void BLO_read_uint32_array(BlendDataReader *reader, int array_size, uint32_t **ptr_p)
static OldNewMap * oldnewmap_new(void)
static void expand_id(BlendExpander *expander, ID *id)
static void oldnewmap_insert(OldNewMap *onm, const void *oldaddr, void *newaddr, int nr)
void blo_clear_proxy_pointers_from_lib(Main *oldmain)
static int * read_file_thumbnail(FileData *fd)
void BLO_read_data_globmap_add(BlendDataReader *reader, void *oldaddr, void *newaddr)
static BHead * read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
static void * newpackedadr(FileData *fd, const void *adr)
static FileData * filedata_new(void)
BlendThumbnail * BLO_thumbnail_from_file(const char *filepath)
ID * BLO_read_get_new_id_address(BlendLibReader *reader, Library *lib, ID *id)
static void read_library_linked_id(FileData *basefd, FileData *fd, Main *mainvar, ID *id, ID **r_id)
static void read_library_linked_ids(FileData *basefd, FileData *fd, ListBase *mainlist, Main *mainvar)
void BLO_read_list_cb(BlendDataReader *reader, ListBase *list, BlendReadListFn callback)
static void do_versions(FileData *fd, Library *lib, Main *main)
#define ITER_SLOTS(onm, KEY, SLOT_NAME, INDEX_NAME)
#define BHEADN_FROM_BHEAD(bh)
static bool object_in_any_scene(Main *bmain, Object *ob)
BHead * blo_bhead_first(FileData *fd)
static bool library_link_idcode_needs_tag_check(const short idcode, const int flag)
static void change_link_placeholder_to_real_ID_pointer_fd(FileData *fd, const void *old, void *new)
AssetMetaData * blo_bhead_id_asset_data_address(const FileData *fd, const BHead *bhead)
bool BLO_library_path_explode(const char *path, char *r_dir, char **r_group, char **r_name)
bool BLO_read_requires_endian_switch(BlendDataReader *reader)
FileData * blo_filedata_from_memory(const void *mem, int memsize, ReportList *reports)
static int fd_read_gzip_from_memory_init(FileData *fd)
static void direct_link_keymapitem(BlendDataReader *reader, wmKeyMapItem *kmi)
void * BLO_library_read_struct(FileData *fd, BHead *bh, const char *blockname)
void blo_split_main(ListBase *mainlist, Main *main)
static int verg_bheadsort(const void *v1, const void *v2)
static bool read_file_dna(FileData *fd, const char **r_error_message)
static ssize_t fd_read_from_memory(FileData *filedata, void *buffer, size_t size, bool *UNUSED(r_is_memchunck_identical))
void blo_do_versions_key_uidgen(Key *key)
BHead * blo_bhead_next(FileData *fd, BHead *thisblock)
static void placeholders_ensure_valid(Main *bmain)
static BHead * find_bhead_from_code_name(FileData *fd, const short idcode, const char *name)
void blo_cache_storage_init(FileData *fd, Main *bmain)
void blo_make_old_idmap_from_main(FileData *fd, Main *bmain)
static BHeadN * get_bhead(FileData *fd)
Main * BLO_read_lib_get_main(BlendLibReader *reader)
static void oldnewmap_clear(OldNewMap *onm)
const char * blo_bhead_id_name(const FileData *fd, const BHead *bhead)
FileData * blo_filedata_from_memfile(MemFile *memfile, const struct BlendFileReadParams *params, ReportList *reports)
static void oldnewmap_insert_or_replace(OldNewMap *onm, OldNew entry)
static void decode_blender_header(FileData *fd)
static void read_libblock_undo_restore_at_old_address(FileData *fd, Main *main, ID *id, ID *id_old)
static void bh4_from_bh8(BHead *bhead, BHead8 *bhead8, bool do_endian_swap)
void blo_end_packed_pointer_map(FileData *fd, Main *oldmain)
static void lib_link_library(BlendLibReader *UNUSED(reader), Library *UNUSED(lib))
#define MAP_CAPACITY(onm)
#define BHEAD_USE_READ_ON_DEMAND(bhead)
static void read_library_clear_weak_links(FileData *basefd, ListBase *mainlist, Main *mainvar)
static off64_t fd_seek_data_from_file(FileData *filedata, off64_t offset, int whence)
static FileData * blo_filedata_from_file_open(const char *filepath, ReportList *reports)
static void change_link_placeholder_to_real_ID_pointer(ListBase *mainlist, FileData *basefd, void *old, void *new)
bool BLO_has_bfile_extension(const char *str)
static FileData * blo_filedata_from_file_descriptor(const char *filepath, ReportList *reports, int file)
static void lib_link_id(BlendLibReader *reader, ID *id)
BHead * blo_bhead_prev(FileData *UNUSED(fd), BHead *thisblock)
static ID * is_yet_read(FileData *fd, Main *mainvar, BHead *bhead)
static void lib_link_seq_clipboard_pt_restore(ID *id, struct IDNameLib_Map *id_map)
static void switch_endian_bh4(BHead4 *bhead)
void BLO_read_pointer_array(BlendDataReader *reader, void **ptr_p)
static ssize_t fd_read_data_from_file(FileData *filedata, void *buffer, size_t size, bool *UNUSED(r_is_memchunck_identical))
static OldNew * oldnewmap_lookup_entry(const OldNewMap *onm, const void *addr)
static void * newlibadr(FileData *fd, const void *lib, const void *adr)
static BHead * read_global(BlendFileData *bfd, FileData *fd, BHead *bhead)
static void switch_endian_bh8(BHead8 *bhead)
static bool blo_bhead_read_data(FileData *fd, BHead *thisblock, void *buf)
static Main * blo_find_main(FileData *fd, const char *filepath, const char *relabase)
ID * BLO_library_link_named_part(Main *mainl, BlendHandle **bh, const short idcode, const char *name, const struct LibraryLink_Params *params)
static void switch_endian_structs(const struct SDNA *filesdna, BHead *bhead)
void blo_filedata_free(FileData *fd)
static void lib_link_wm_xr_data_restore(struct IDNameLib_Map *id_map, wmXrData *xr_data)
static void insert_packedmap(FileData *fd, PackedFile *pf)
static bool blo_bhead_is_id_valid_type(const BHead *bhead)
static void oldnewmap_insert_index_in_map(OldNewMap *onm, const void *ptr, int index)
static const char * library_parent_filepath(Library *lib)
static void object_base_instance_init(Object *ob, bool set_selected, bool set_active, ViewLayer *view_layer, const View3D *v3d)
static void read_libblock_undo_restore_identical(FileData *fd, Main *main, const ID *UNUSED(id), ID *id_old, const int tag)
static void read_file_version(FileData *fd, Main *main)
void blo_cache_storage_old_bmain_clear(FileData *fd, Main *bmain_old)
static void add_collections_to_scene(Main *mainvar, Main *bmain, Scene *scene, ViewLayer *view_layer, const View3D *v3d, Library *lib, const short flag)
static ssize_t fd_read_from_memfile(FileData *filedata, void *buffer, size_t size, bool *r_is_memchunck_identical)
static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map, Main *newmain, WorkSpaceLayout *layout)
BHead * blo_read_asset_data_block(FileData *fd, BHead *bhead, AssetMetaData **r_asset_data)
void blo_add_library_pointer_map(ListBase *old_mainlist, FileData *fd)
static FileData * blo_filedata_from_file_minimal(const char *filepath)
void blo_join_main(ListBase *mainlist)
void * blo_read_get_new_globaldata_address(FileData *fd, const void *adr)
static off64_t fd_seek_from_mmap(FileData *filedata, off64_t offset, int whence)
static BHead * read_data_into_datamap(FileData *fd, BHead *bhead, const char *allocname)
static void direct_link_id_override_property_operation_cb(BlendDataReader *reader, void *data)
static void oldnewmap_increase_size(OldNewMap *onm)
static void blo_cache_storage_entry_restore_in_new(ID *UNUSED(id), const IDCacheKey *key, void **cache_p, uint flags, void *cache_storage_v)
static const void * peek_struct_undo(FileData *fd, BHead *bhead)
void do_versions_after_linking_250(struct Main *bmain)
ssize_t() FileDataReadFn(struct FileData *filedata, void *buffer, size_t size, bool *r_is_memchunk_identical)
@ FD_FLAGS_FILE_POINTSIZE_IS_4
@ FD_FLAGS_POINTSIZE_DIFFERS
void blo_do_versions_pre250(struct FileData *fd, struct Library *lib, struct Main *bmain)
void blo_do_versions_dna(struct SDNA *sdna, const int versionfile, const int subversionfile)
void do_versions_after_linking_290(struct Main *bmain, struct ReportList *reports)
void blo_do_versions_250(struct FileData *fd, struct Library *lib, struct Main *bmain)
off64_t() FileDataSeekFn(struct FileData *filedata, off64_t offset, int whence)
void blo_do_versions_cycles(struct FileData *fd, struct Library *lib, struct Main *bmain)
void do_versions_after_linking_270(struct Main *bmain)
void do_versions_after_linking_260(struct Main *bmain)
void blo_do_versions_260(struct FileData *fd, struct Library *lib, struct Main *bmain)
void do_versions_after_linking_280(struct Main *bmain, struct ReportList *reports)
void blo_do_versions_290(struct FileData *fd, struct Library *lib, struct Main *bmain)
void do_versions_after_linking_cycles(struct Main *bmain)
void blo_do_versions_270(struct FileData *fd, struct Library *lib, struct Main *bmain)
#define SIZEOFBLENDERHEADER
void blo_do_versions_userdef(struct UserDef *userdef)
void blo_do_versions_280(struct FileData *fd, struct Library *lib, struct Main *bmain)
struct SELECTID_Context context
unsigned __int64 uint64_t
bool is_memchunk_identical
unsigned short local_view_bits
struct bScreen * curscreen
struct ViewLayer * cur_view_layer
struct DNA_ReconstructInfo * reconstruct_info
int library_id_missing_count
struct OldNewMap * globmap
struct OldNewMap * libmap
const struct SDNA * memsdna
struct OldNewMap * datamap
struct ReportList * reports
struct GHash * bhead_idname_hash
struct OldNewMap * packedmap
struct BLI_mmap_file * mmap_file
struct BLOCacheStorage * cache_storage
int library_file_missing_count
struct BHeadSort * bheadmap
struct IDNameLib_Map * old_idmap
struct ViewLayer * cur_view_layer
uint64_t build_commit_timestamp
struct bScreen * curscreen
unsigned int id_session_uuid
char * subitem_local_name
char * subitem_reference_name
IDTypeBlendReadUndoPreserve blend_read_undo_preserve
IDTypeBlendReadExpandFunction blend_read_expand
IDTypeForeachCacheFunction foreach_cache
IDTypeBlendReadDataFunction blend_read_data
IDTypeBlendReadLibFunction blend_read_lib
struct AssetMetaData * asset_data
int recalc_after_undo_push
IDOverrideLibrary * override_library
unsigned int session_uuid
int recalc_up_to_undo_push
struct Collection * collection
struct PackedFile * packedfile
struct FileData * filedata
BlendThumbnail * blen_thumb
uint64_t build_commit_timestamp
struct Collection * instance_collection
struct Object * proxy_from
struct RegionView3D * localvd
struct Collection * master_collection
struct Object * scene_camera
SpaceAction_Runtime runtime
struct MovieClipScopes scopes
struct wmTimer * previews_timer
SpaceGraph_Runtime runtime
struct bNodeTree * edittree
struct bNodeTree * nodetree
struct TreeStoreElem search_tse
struct BLI_mempool * treestore
struct ListBase user_keymaps
struct ListBase autoexec_paths
struct ListBase user_keyconfig_prefs
struct ListBase user_menus
struct ListBase asset_libraries
unsigned short local_view_uuid
struct Object * ob_center
Object * base_pose_object
struct Collection * filter_grp
struct bNodeTree * nodetree
struct bNodeTreePath * next
struct WorkSpaceInstanceHook * workspace_hook
XrSessionSettings session_settings