Blender V4.3
bpy_library_load.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
16#include <Python.h>
17#include <cstddef>
18
19#include "BLI_linklist.h"
20#include "BLI_path_utils.hh"
21#include "BLI_string.h"
22#include "BLI_utildefines.h"
23
25#include "BKE_context.hh"
26#include "BKE_idtype.hh"
27#include "BKE_lib_id.hh"
28#include "BKE_main.hh"
29#include "BKE_report.hh"
30
31#include "DNA_space_types.h" /* FILE_LINK, FILE_RELPATH */
32
33#include "BLO_readfile.hh"
34
35#include "MEM_guardedalloc.h"
36
37#include "bpy_capi_utils.hh"
38#include "bpy_library.hh"
39
43
44/* nifty feature. swap out strings for RNA data */
45#define USE_RNA_DATABLOCKS
46
47#ifdef USE_RNA_DATABLOCKS
48# include "RNA_access.hh"
49# include "bpy_rna.hh"
50#endif
51
53 PyObject_HEAD /* Required Python macro. */
54 /* Collection iterator specific parts. */
56 char abspath[FILE_MAX]; /* absolute path */
57 BlendHandle *blo_handle;
58 /* Referenced by `blo_handle`, so stored here to keep alive for long enough. */
61
62 int flag;
63
66
67 PyObject *dict;
68 /* Borrowed reference to the `bmain`, taken from the RNA instance of #RNA_BlendDataLibraries.
69 * Defaults to #G.main, Otherwise use a temporary #Main when `bmain_is_temp` is true. */
72};
73
74static PyObject *bpy_lib_load(BPy_PropertyRNA *self, PyObject *args, PyObject *kw);
75static PyObject *bpy_lib_enter(BPy_Library *self);
76static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *args);
77static PyObject *bpy_lib_dir(BPy_Library *self);
78
79#if (defined(__GNUC__) && !defined(__clang__))
80# pragma GCC diagnostic push
81# pragma GCC diagnostic ignored "-Wcast-function-type"
82#endif
83
84static PyMethodDef bpy_lib_methods[] = {
85 {"__enter__", (PyCFunction)bpy_lib_enter, METH_NOARGS},
86 {"__exit__", (PyCFunction)bpy_lib_exit, METH_VARARGS},
87 {"__dir__", (PyCFunction)bpy_lib_dir, METH_NOARGS},
88 {nullptr} /* sentinel */
89};
90
91#if (defined(__GNUC__) && !defined(__clang__))
92# pragma GCC diagnostic pop
93#endif
94
96{
97 Py_XDECREF(self->dict);
98 Py_TYPE(self)->tp_free(self);
99}
100
101static PyTypeObject bpy_lib_Type = {
102 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
103 /*tp_name*/ "bpy_lib",
104 /*tp_basicsize*/ sizeof(BPy_Library),
105 /*tp_itemsize*/ 0,
106 /*tp_dealloc*/ (destructor)bpy_lib_dealloc,
107 /*tp_vectorcall_offset*/ 0,
108 /*tp_getattr*/ nullptr,
109 /*tp_setattr*/ nullptr,
110 /*tp_as_async*/ nullptr,
111 /*tp_repr*/ nullptr,
112 /*tp_as_number*/ nullptr,
113 /*tp_as_sequence*/ nullptr,
114 /*tp_as_mapping*/ nullptr,
115 /*tp_hash*/ nullptr,
116 /*tp_call*/ nullptr,
117 /*tp_str*/ nullptr,
118 /*tp_getattro*/ PyObject_GenericGetAttr,
119 /*tp_setattro*/ nullptr,
120 /*tp_as_buffer*/ nullptr,
121 /*tp_flags*/ Py_TPFLAGS_DEFAULT,
122 /*tp_doc*/ nullptr,
123 /*tp_traverse*/ nullptr,
124 /*tp_clear*/ nullptr,
125 /*tp_richcompare*/ nullptr,
126 /*tp_weaklistoffset*/ 0,
127 /*tp_iter*/ nullptr,
128 /*tp_iternext*/ nullptr,
129 /*tp_methods*/ bpy_lib_methods,
130 /*tp_members*/ nullptr,
131 /*tp_getset*/ nullptr,
132 /*tp_base*/ nullptr,
133 /*tp_dict*/ nullptr,
134 /*tp_descr_get*/ nullptr,
135 /*tp_descr_set*/ nullptr,
136 /*tp_dictoffset*/ offsetof(BPy_Library, dict),
137 /*tp_init*/ nullptr,
138 /*tp_alloc*/ nullptr,
139 /*tp_new*/ nullptr,
140 /*tp_free*/ nullptr,
141 /*tp_is_gc*/ nullptr,
142 /*tp_bases*/ nullptr,
143 /*tp_mro*/ nullptr,
144 /*tp_cache*/ nullptr,
145 /*tp_subclasses*/ nullptr,
146 /*tp_weaklist*/ nullptr,
147 /*tp_del*/ nullptr,
148 /*tp_version_tag*/ 0,
149 /*tp_finalize*/ nullptr,
150 /*tp_vectorcall*/ nullptr,
151};
152
154 /* Wrap. */
155 bpy_lib_load_doc,
156 ".. method:: load("
157 "filepath, "
158 "link=False, "
159 "relative=False, "
160 "assets_only=False, "
161 "create_liboverrides=False, "
162 "reuse_liboverrides=False, "
163 "create_liboverrides_runtime=False)\n"
164 "\n"
165 " Returns a context manager which exposes 2 library objects on entering.\n"
166 " Each object has attributes matching bpy.data which are lists of strings to be linked.\n"
167 "\n"
168 " :arg filepath: The path to a blend file.\n"
169 " :type filepath: str | bytes\n"
170 " :arg link: When False reference to the original file is lost.\n"
171 " :type link: bool\n"
172 " :arg relative: When True the path is stored relative to the open blend file.\n"
173 " :type relative: bool\n"
174 " :arg assets_only: If True, only list data-blocks marked as assets.\n"
175 " :type assets_only: bool\n"
176 " :arg create_liboverrides: If True and ``link`` is True, liboverrides will\n"
177 " be created for linked data.\n"
178 " :type create_liboverrides: bool\n"
179 " :arg reuse_liboverrides: If True and ``create_liboverride`` is True,\n"
180 " search for existing liboverride first.\n"
181 " :type reuse_liboverrides: bool\n"
182 " :arg create_liboverrides_runtime: If True and ``create_liboverride`` is True,\n"
183 " create (or search for existing) runtime liboverride.\n"
184 " :type create_liboverrides_runtime: bool\n");
185static PyObject *bpy_lib_load(BPy_PropertyRNA *self, PyObject *args, PyObject *kw)
186{
187 Main *bmain_base = CTX_data_main(BPY_context_get());
188 Main *bmain = static_cast<Main *>(self->ptr.data); /* Typically #G_MAIN */
190 PyC_UnicodeAsBytesAndSize_Data filepath_data = {nullptr};
191 bool is_rel = false, is_link = false, use_assets_only = false;
192 bool create_liboverrides = false, reuse_liboverrides = false,
193 create_liboverrides_runtime = false;
194
195 static const char *_keywords[] = {
196 "filepath",
197 "link",
198 "relative",
199 "assets_only",
200 "create_liboverrides",
201 "reuse_liboverrides",
202 "create_liboverrides_runtime",
203 nullptr,
204 };
205 static _PyArg_Parser _parser = {
207 "O&" /* `filepath` */
208 /* Optional keyword only arguments. */
209 "|$"
210 "O&" /* `link` */
211 "O&" /* `relative` */
212 "O&" /* `assets_only` */
213 "O&" /* `create_liboverrides` */
214 "O&" /* `reuse_liboverrides` */
215 "O&" /* `create_liboverrides_runtime` */
216 ":load",
217 _keywords,
218 nullptr,
219 };
220 if (!_PyArg_ParseTupleAndKeywordsFast(args,
221 kw,
222 &_parser,
224 &filepath_data,
226 &is_link,
228 &is_rel,
230 &use_assets_only,
232 &create_liboverrides,
234 &reuse_liboverrides,
236 &create_liboverrides_runtime))
237 {
238 return nullptr;
239 }
240
241 if (!is_link && create_liboverrides) {
242 PyErr_SetString(PyExc_ValueError, "`link` is False but `create_liboverrides` is True");
243 return nullptr;
244 }
245 if (!create_liboverrides && reuse_liboverrides) {
246 PyErr_SetString(PyExc_ValueError,
247 "`create_liboverrides` is False but `reuse_liboverrides` is True");
248 return nullptr;
249 }
250 if (!create_liboverrides && create_liboverrides_runtime) {
251 PyErr_SetString(PyExc_ValueError,
252 "`create_liboverrides` is False but `create_liboverrides_runtime` is True");
253 return nullptr;
254 }
255
256 ret = PyObject_New(BPy_Library, &bpy_lib_Type);
257
258 STRNCPY(ret->relpath, filepath_data.value);
259 Py_XDECREF(filepath_data.value_coerce);
260
261 STRNCPY(ret->abspath, ret->relpath);
262 BLI_path_abs(ret->abspath, BKE_main_blendfile_path(bmain));
263
264 ret->bmain = bmain;
265 ret->bmain_is_temp = (bmain != bmain_base);
266
267 ret->blo_handle = nullptr;
268 ret->flag = ((is_link ? FILE_LINK : 0) | (is_rel ? FILE_RELPATH : 0) |
269 (use_assets_only ? FILE_ASSETS_ONLY : 0));
270 ret->create_liboverrides = create_liboverrides;
271 ret->liboverride_flags = eBKELibLinkOverride(
272 create_liboverrides ?
273 ((reuse_liboverrides ? BKE_LIBLINK_OVERRIDE_USE_EXISTING_LIBOVERRIDES : 0) |
274 (create_liboverrides_runtime ? BKE_LIBLINK_OVERRIDE_CREATE_RUNTIME : 0)) :
275 0);
276
277 ret->dict = _PyDict_NewPresized(INDEX_ID_MAX);
278
279 return (PyObject *)ret;
280}
281
282static PyObject *_bpy_names(BPy_Library *self, int blocktype)
283{
284 PyObject *list;
285 LinkNode *l, *names;
286 int totnames;
287
289 self->blo_handle, blocktype, (self->flag & FILE_ASSETS_ONLY) != 0, &totnames);
290 list = PyList_New(totnames);
291
292 if (names) {
293 int counter = 0;
294 for (l = names; l; l = l->next) {
295 PyList_SET_ITEM(list, counter, PyUnicode_FromString((char *)l->link));
296 counter++;
297 }
298 BLI_linklist_freeN(names); /* free linklist *and* each node's data */
299 }
300
301 return list;
302}
303
305{
306 PyObject *ret;
307 BPy_Library *self_from;
308 PyObject *from_dict = _PyDict_NewPresized(INDEX_ID_MAX);
309 ReportList *reports = &self->reports;
310 BlendFileReadReport *bf_reports = &self->bf_reports;
311
312 BKE_reports_init(reports, RPT_STORE);
313 memset(bf_reports, 0, sizeof(*bf_reports));
314 bf_reports->reports = reports;
315
316 self->blo_handle = BLO_blendhandle_from_file(self->abspath, bf_reports);
317
318 if (self->blo_handle == nullptr) {
319 if (BPy_reports_to_error(reports, PyExc_IOError, true) != -1) {
320 PyErr_Format(PyExc_IOError, "load: %s failed to open blend file", self->abspath);
321 }
322 return nullptr;
323 }
324
325 int i = 0, code;
326 while ((code = BKE_idtype_idcode_iter_step(&i))) {
328 const char *name_plural = BKE_idtype_idcode_to_name_plural(code);
329 PyObject *str = PyUnicode_FromString(name_plural);
330 PyObject *item;
331
332 PyDict_SetItem(self->dict, str, item = PyList_New(0));
333 Py_DECREF(item);
334 PyDict_SetItem(from_dict, str, item = _bpy_names(self, code));
335 Py_DECREF(item);
336
337 Py_DECREF(str);
338 }
339 }
340
341 /* create a dummy */
342 self_from = PyObject_New(BPy_Library, &bpy_lib_Type);
343 STRNCPY(self_from->relpath, self->relpath);
344 STRNCPY(self_from->abspath, self->abspath);
345
346 self_from->blo_handle = nullptr;
347 self_from->flag = 0;
348 self_from->create_liboverrides = false;
350 self_from->dict = from_dict; /* owns the dict */
351
352 /* return pair */
353 ret = PyTuple_New(2);
354 PyTuple_SET_ITEMS(ret, (PyObject *)self_from, (PyObject *)self);
355 Py_INCREF(self);
356
357 BKE_reports_clear(reports);
358
359 return ret;
360}
361
363 const char *name_plural,
364 const char *idname)
365{
366 PyObject *exc, *val, *tb;
367 PyErr_Fetch(&exc, &val, &tb);
368 if (PyErr_WarnFormat(PyExc_UserWarning,
369 1,
370 "load: '%s' does not contain %s[\"%s\"]",
371 self->abspath,
372 name_plural,
373 idname))
374 {
375 /* Spurious errors can appear at shutdown */
376 if (PyErr_ExceptionMatches(PyExc_Warning)) {
377 PyErr_WriteUnraisable((PyObject *)self);
378 }
379 }
380 PyErr_Restore(exc, val, tb);
381}
382
383static void bpy_lib_exit_warn_type(BPy_Library *self, PyObject *item)
384{
385 PyObject *exc, *val, *tb;
386 PyErr_Fetch(&exc, &val, &tb);
387 if (PyErr_WarnFormat(PyExc_UserWarning,
388 1,
389 "load: '%s' expected a string type, not a %.200s",
390 self->abspath,
391 Py_TYPE(item)->tp_name))
392 {
393 /* Spurious errors can appear at shutdown */
394 if (PyErr_ExceptionMatches(PyExc_Warning)) {
395 PyErr_WriteUnraisable((PyObject *)self);
396 }
397 }
398 PyErr_Restore(exc, val, tb);
399}
400
407
411{
412 /* Since `bpy_lib_exit` loops over all ID types, all items in `lapp_context` end up being looped
413 * over for each ID type, so when it does not match the item can simply be skipped: it either has
414 * already been processed, or will be processed in a later loop. */
415 if (BKE_blendfile_link_append_context_item_idcode_get(lapp_context, item) != data.idcode) {
416 return true;
417 }
418
419 const int py_list_index = POINTER_AS_INT(
421 ID *new_id = BKE_blendfile_link_append_context_item_newid_get(lapp_context, item);
422 ID *liboverride_id = data.py_library->create_liboverrides ?
424 item) :
425 nullptr;
426
427 BLI_assert(py_list_index < data.py_list_size);
428
429 /* Fully invalid items (which got set to `Py_None` already in first loop of `bpy_lib_exit`)
430 * should never be accessed here, since their index should never be set to any item in
431 * `lapp_context`. */
432 PyObject *item_src = PyList_GET_ITEM(data.py_list, py_list_index);
433 BLI_assert(item_src != Py_None);
434
435 PyObject *py_item;
436 if (liboverride_id != nullptr) {
437 PointerRNA newid_ptr = RNA_id_pointer_create(liboverride_id);
438 py_item = pyrna_struct_CreatePyObject(&newid_ptr);
439 }
440 else if (new_id != nullptr) {
441 PointerRNA newid_ptr = RNA_id_pointer_create(new_id);
442 py_item = pyrna_struct_CreatePyObject(&newid_ptr);
443 }
444 else {
445 const char *item_idname = PyUnicode_AsUTF8(item_src);
446 const char *idcode_name_plural = BKE_idtype_idcode_to_name_plural(data.idcode);
447
448 bpy_lib_exit_warn_idname(data.py_library, idcode_name_plural, item_idname);
449
450 py_item = Py_NewRef(Py_None);
451 }
452
453 PyList_SET_ITEM(data.py_list, py_list_index, py_item);
454
455 Py_DECREF(item_src);
456
457 return true;
458}
459
460static PyObject *bpy_lib_exit(BPy_Library *self, PyObject * /*args*/)
461{
462 Main *bmain = self->bmain;
463 const bool do_append = ((self->flag & FILE_LINK) == 0);
464 const bool create_liboverrides = self->create_liboverrides;
465 /* Code in #bpy_lib_load should have raised exception in case of incompatible parameter values.
466 */
467 BLI_assert(!do_append || !create_liboverrides);
468
470
471 /* here appending/linking starts */
472 const int id_tag_extra = self->bmain_is_temp ? int(ID_TAG_TEMP_MAIN) : 0;
473 LibraryLink_Params liblink_params;
474 BLO_library_link_params_init(&liblink_params, bmain, self->flag, id_tag_extra);
475
477 &liblink_params);
478 /* NOTE: Transfers the ownership of the `blo_handle` to the `lapp_context`. */
479 BKE_blendfile_link_append_context_library_add(lapp_context, self->abspath, self->blo_handle);
480 self->blo_handle = nullptr;
481
482 int idcode_step = 0;
483 short idcode;
484 while ((idcode = BKE_idtype_idcode_iter_step(&idcode_step))) {
485 if (!BKE_idtype_idcode_is_linkable(idcode) || (idcode == ID_WS && !do_append)) {
486 continue;
487 }
488
489 const char *name_plural = BKE_idtype_idcode_to_name_plural(idcode);
490 PyObject *ls = PyDict_GetItemString(self->dict, name_plural);
491 // printf("lib: %s\n", name_plural);
492 if (ls == nullptr || !PyList_Check(ls)) {
493 continue;
494 }
495
496 const Py_ssize_t size = PyList_GET_SIZE(ls);
497 if (size == 0) {
498 continue;
499 }
500
501 /* loop */
502 for (Py_ssize_t i = 0; i < size; i++) {
503 PyObject *item_src = PyList_GET_ITEM(ls, i);
504 const char *item_idname = PyUnicode_AsUTF8(item_src);
505
506 // printf(" %s\n", item_idname);
507
508 /* NOTE: index of item in py list is stored in userdata pointer, so that it can be found
509 * later on to replace the ID name by the actual ID pointer. */
510 if (item_idname != nullptr) {
512 lapp_context, item_idname, idcode, POINTER_FROM_INT(i));
514 }
515 else {
516 /* XXX, could complain about this */
517 bpy_lib_exit_warn_type(self, item_src);
518 PyErr_Clear();
519
520#ifdef USE_RNA_DATABLOCKS
521 /* We can replace the item immediately with `None`. */
522 PyObject *py_item = Py_NewRef(Py_None);
523 PyList_SET_ITEM(ls, i, py_item);
524 Py_DECREF(item_src);
525#endif
526 }
527 }
528 }
529
531
532 BKE_blendfile_link(lapp_context, nullptr);
533 if (do_append) {
534 BKE_blendfile_append(lapp_context, nullptr);
535 }
536 else if (create_liboverrides) {
537 BKE_blendfile_override(lapp_context, self->liboverride_flags, nullptr);
538 }
539
541
542/* If enabled, replace named items in given lists by the final matching new ID pointer. */
543#ifdef USE_RNA_DATABLOCKS
544 idcode_step = 0;
545 while ((idcode = BKE_idtype_idcode_iter_step(&idcode_step))) {
546 if (!BKE_idtype_idcode_is_linkable(idcode) || (idcode == ID_WS && !do_append)) {
547 continue;
548 }
549 const char *name_plural = BKE_idtype_idcode_to_name_plural(idcode);
550 PyObject *ls = PyDict_GetItemString(self->dict, name_plural);
551 // printf("lib: %s\n", name_plural);
552 if (ls == nullptr || !PyList_Check(ls)) {
553 continue;
554 }
555
556 const Py_ssize_t size = PyList_GET_SIZE(ls);
557 if (size == 0) {
558 continue;
559 }
560
561 /* Loop over linked items in `lapp_context` to find matching python one in the list, and
562 * replace them with proper ID pointer. */
564 iter_data.idcode = idcode;
565 iter_data.py_library = self;
566 iter_data.py_list = ls;
567 iter_data.py_list_size = size;
569 lapp_context,
570 [&iter_data](BlendfileLinkAppendContext *lapp_context,
571 BlendfileLinkAppendContextItem *item) -> bool {
572 return bpy_lib_exit_lapp_context_items_cb(lapp_context, item, iter_data);
573 },
575 }
576#endif // USE_RNA_DATABLOCKS
577
580
581 BKE_reports_free(&self->reports);
582
583 Py_RETURN_NONE;
584}
585
586static PyObject *bpy_lib_dir(BPy_Library *self)
587{
588 return PyDict_Keys(self->dict);
589}
590
591#if (defined(__GNUC__) && !defined(__clang__))
592# pragma GCC diagnostic push
593# pragma GCC diagnostic ignored "-Wcast-function-type"
594#endif
595
597 "load",
598 (PyCFunction)bpy_lib_load,
599 METH_VARARGS | METH_KEYWORDS,
600 bpy_lib_load_doc,
601};
602
603#if (defined(__GNUC__) && !defined(__clang__))
604# pragma GCC diagnostic pop
605#endif
606
608{
609 if (PyType_Ready(&bpy_lib_Type) < 0) {
610 return -1;
611 }
612
613 return 0;
614}
Main * CTX_data_main(const bContext *C)
bool BKE_idtype_idcode_is_linkable(short idcode)
Definition idtype.cc:201
short BKE_idtype_idcode_iter_step(int *idtype_index)
Definition idtype.cc:379
const char * BKE_idtype_idcode_to_name_plural(short idcode)
Definition idtype.cc:175
void BKE_main_id_tag_all(Main *mainvar, int tag, bool value)
Definition lib_id.cc:1198
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
Definition main.cc:832
void BKE_reports_free(ReportList *reports)
Definition report.cc:69
void BKE_reports_clear(ReportList *reports)
Definition report.cc:81
void BKE_reports_init(ReportList *reports, int flag)
Definition report.cc:54
#define BLI_assert(a)
Definition BLI_assert.h:50
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
#define FILE_MAX
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
external readfile function prototypes.
void BLO_library_link_params_init(LibraryLink_Params *params, Main *bmain, int flag, int id_tag_extra)
Definition readfile.cc:4304
BlendHandle * BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport *reports)
LinkNode * BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype, bool use_assets_only, int *r_tot_names)
@ ID_TAG_TEMP_MAIN
Definition DNA_ID.h:938
@ ID_TAG_PRE_EXISTING
Definition DNA_ID.h:872
#define INDEX_ID_MAX
Definition DNA_ID.h:1328
@ ID_WS
@ FILE_RELPATH
@ FILE_LINK
@ FILE_ASSETS_ONLY
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMLoop * l
short BPy_reports_to_error(ReportList *reports, PyObject *exception, const bool clear)
struct bContext * BPY_context_get(void)
PyObject * self
PyMethodDef BPY_library_load_method_def
static void bpy_lib_dealloc(BPy_Library *self)
static PyObject * bpy_lib_exit(BPy_Library *self, PyObject *args)
static PyMethodDef bpy_lib_methods[]
PyDoc_STRVAR(bpy_lib_load_doc, ".. method:: load(" "filepath, " "link=False, " "relative=False, " "assets_only=False, " "create_liboverrides=False, " "reuse_liboverrides=False, " "create_liboverrides_runtime=False)\n" "\n" " Returns a context manager which exposes 2 library objects on entering.\n" " Each object has attributes matching bpy.data which are lists of strings to be linked.\n" "\n" " :arg filepath: The path to a blend file.\n" " :type filepath: str | bytes\n" " :arg link: When False reference to the original file is lost.\n" " :type link: bool\n" " :arg relative: When True the path is stored relative to the open blend file.\n" " :type relative: bool\n" " :arg assets_only: If True, only list data-blocks marked as assets.\n" " :type assets_only: bool\n" " :arg create_liboverrides: If True and ``link`` is True, liboverrides will\n" " be created for linked data.\n" " :type create_liboverrides: bool\n" " :arg reuse_liboverrides: If True and ``create_liboverride`` is True,\n" " search for existing liboverride first.\n" " :type reuse_liboverrides: bool\n" " :arg create_liboverrides_runtime: If True and ``create_liboverride`` is True,\n" " create (or search for existing) runtime liboverride.\n" " :type create_liboverrides_runtime: bool\n")
static PyObject * bpy_lib_enter(BPy_Library *self)
static PyObject * _bpy_names(BPy_Library *self, int blocktype)
static PyObject * bpy_lib_dir(BPy_Library *self)
static bool bpy_lib_exit_lapp_context_items_cb(BlendfileLinkAppendContext *lapp_context, BlendfileLinkAppendContextItem *item, LibExitLappContextItemsIterData &data)
static PyObject * bpy_lib_load(BPy_PropertyRNA *self, PyObject *args, PyObject *kw)
int BPY_library_load_type_ready()
static void bpy_lib_exit_warn_type(BPy_Library *self, PyObject *item)
static PyTypeObject bpy_lib_Type
static void bpy_lib_exit_warn_idname(BPy_Library *self, const char *name_plural, const char *idname)
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
Definition bpy_rna.cc:7694
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
#define offsetof(t, d)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
#define str(s)
int PyC_ParseUnicodeAsBytesAndSize(PyObject *o, void *p)
int PyC_ParseBool(PyObject *o, void *p)
header-only compatibility defines.
#define PY_ARG_PARSER_HEAD_COMPAT()
header-only utilities
#define PyTuple_SET_ITEMS(op_arg,...)
return ret
PointerRNA RNA_id_pointer_create(ID *id)
struct BMLoop * next
eBKELibLinkOverride liboverride_flags
BlendHandle * blo_handle
char abspath[FILE_MAX]
BlendFileReadReport bf_reports
PyObject * dict
ReportList reports
PyObject_HEAD char relpath[FILE_MAX]
Definition DNA_ID.h:413