diff options
author | Bastien Montagne <bastien@blender.org> | 2021-11-10 13:24:59 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-11-23 14:17:16 +0300 |
commit | 0452a04f1a1840544287810528e2aaab1daca2ce (patch) | |
tree | 03a6d9b0ab19f1a66c2a2a76ba266b11068cf768 /source/blender/blenkernel/intern | |
parent | 6c8f73b2202a51cbe64d590808ce1f6ccf7a7cda (diff) |
BKE link/append: Add optional blendfile handle to libraries.
This enables calling code to deal with the blendfile handle themselves,
BKE_blendfile_link then just borrows, uses this handle and does not
release it.
Needed e.g. for python's libcontext system to use new
BKE_blendfile_link_append code.
Part of T91414: Unify link/append between WM operators and BPY context
manager API, and cleanup usages of `BKE_library_make_local`.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/blendfile_link_append.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c b/source/blender/blenkernel/intern/blendfile_link_append.c index 062aa6d34aa..107e89e0e1e 100644 --- a/source/blender/blenkernel/intern/blendfile_link_append.c +++ b/source/blender/blenkernel/intern/blendfile_link_append.c @@ -277,6 +277,9 @@ void BKE_blendfile_link_append_context_library_add(BlendfileLinkAppendContext *l BlendfileLinkAppendContextLibrary *lib_context = BLI_memarena_calloc(lapp_context->memarena, sizeof(*lib_context)); + BlendfileLinkAppendContextLibrary *ctx_lib = BLI_memarena_alloc(lapp_context->memarena, + sizeof(*ctx_lib)); + size_t len = strlen(libname) + 1; char *libpath = BLI_memarena_alloc(lapp_context->memarena, len); BLI_strncpy(libpath, libname, len); |