Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-11-10 13:24:59 +0300
committerBastien Montagne <bastien@blender.org>2021-11-23 12:38:51 +0300
commitfbb4a7eb434f57e03fd274b107b466919cdd049a (patch)
tree0c4837d2a47259bfa98a7ee55801801734eaae37 /source/blender/windowmanager/intern/wm_files_link.c
parentf6573560623606301d6e249032f42ca47ae438eb (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/windowmanager/intern/wm_files_link.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index 7cb91bf4c0f..00ac1c2ffe6 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -309,7 +309,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
if (!BLI_ghash_haskey(libraries, libname)) {
BLI_ghash_insert(libraries, BLI_strdup(libname), POINTER_FROM_INT(lib_idx));
lib_idx++;
- BKE_blendfile_link_append_context_library_add(lapp_context, libname);
+ BKE_blendfile_link_append_context_library_add(lapp_context, libname, NULL);
}
}
}
@@ -341,7 +341,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
else {
BlendfileLinkAppendContextItem *item;
- BKE_blendfile_link_append_context_library_add(lapp_context, libname);
+ BKE_blendfile_link_append_context_library_add(lapp_context, libname, NULL);
item = BKE_blendfile_link_append_context_item_add(
lapp_context, name, BKE_idtype_idcode_from_name(group), NULL);
BKE_blendfile_link_append_context_item_library_index_enable(lapp_context, item, 0);
@@ -530,7 +530,7 @@ static ID *wm_file_link_append_datablock_ex(Main *bmain,
BKE_blendfile_link_append_context_embedded_blendfile_set(
lapp_context, datatoc_startup_blend, datatoc_startup_blend_size);
- BKE_blendfile_link_append_context_library_add(lapp_context, filepath);
+ BKE_blendfile_link_append_context_library_add(lapp_context, filepath, NULL);
BlendfileLinkAppendContextItem *item = BKE_blendfile_link_append_context_item_add(
lapp_context, id_name, id_code, NULL);
BKE_blendfile_link_append_context_item_library_index_enable(lapp_context, item, 0);
@@ -651,7 +651,7 @@ void WM_lib_reload(Library *lib, bContext *C, ReportList *reports)
BlendfileLinkAppendContext *lapp_context = BKE_blendfile_link_append_context_new(&lapp_params);
- BKE_blendfile_link_append_context_library_add(lapp_context, lib->filepath_abs);
+ BKE_blendfile_link_append_context_library_add(lapp_context, lib->filepath_abs, NULL);
BKE_blendfile_library_relocate(lapp_context, reports, lib, true);
@@ -736,7 +736,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload)
do_reload = true;
lapp_context = BKE_blendfile_link_append_context_new(&lapp_params);
- BKE_blendfile_link_append_context_library_add(lapp_context, path);
+ BKE_blendfile_link_append_context_library_add(lapp_context, path, NULL);
}
else {
int totfiles = 0;
@@ -769,13 +769,13 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload)
}
CLOG_INFO(&LOG, 4, "\tCandidate new lib to reload datablocks from: %s", path);
- BKE_blendfile_link_append_context_library_add(lapp_context, path);
+ BKE_blendfile_link_append_context_library_add(lapp_context, path, NULL);
}
RNA_END;
}
else {
CLOG_INFO(&LOG, 4, "\tCandidate new lib to reload datablocks from: %s", path);
- BKE_blendfile_link_append_context_library_add(lapp_context, path);
+ BKE_blendfile_link_append_context_library_add(lapp_context, path, NULL);
}
}