[Bf-blender-cvs] [0452a04f1a1] master: BKE link/append: Add optional blendfile handle to libraries.
Bastien Montagne
noreply at git.blender.org
Tue Nov 23 12:21:42 CET 2021
Commit: 0452a04f1a1840544287810528e2aaab1daca2ce
Author: Bastien Montagne
Date: Wed Nov 10 11:24:59 2021 +0100
Branches: master
https://developer.blender.org/rB0452a04f1a1840544287810528e2aaab1daca2ce
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`.
===================================================================
M source/blender/blenkernel/intern/blendfile_link_append.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list