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
path: root/source
diff options
context:
space:
mode:
authorJeroen Bakker <jbakker>2021-10-12 10:49:06 +0300
committerJeroen Bakker <jeroen@blender.org>2021-10-12 10:50:04 +0300
commit29e5dc1b197908e09d0872267500b79c8f41c317 (patch)
tree0c4fbf594336f72a12c24c9efcaf318700356035 /source
parent690382bef5c38d9279d72b36660c466114afc774 (diff)
WindowManager: Keep track or the source library when appending.
Keep track of the source library allowing other parts of the code to to make better decisions. This is needed to localize external files. In this case the file paths are updated when `making local`. But we should decide based on the source library if we want to copy the file relative to the new blend file. See D12423. Reviewed By: mont29, Severin Differential Revision: https://developer.blender.org/D12765
Diffstat (limited to 'source')
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index 12ab10e3a70..50ab4f338a6 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -177,6 +177,7 @@ typedef struct WMLinkAppendDataItem {
char append_tag;
ID *new_id;
+ Library *source_library;
void *customdata;
} WMLinkAppendDataItem;
@@ -622,6 +623,7 @@ static int foreach_libblock_append_callback(LibraryIDLinkCallbackData *cb_data)
if (item == NULL) {
item = wm_link_append_data_item_add(data->lapp_data, id->name, GS(id->name), NULL);
item->new_id = id;
+ item->source_library = id->lib;
/* Since we did not have an item for that ID yet, we now user did not selected it explicitly,
* it was rather linked indirectly. This info is important for instantiation of collections. */
item->append_tag |= WM_APPEND_TAG_INDIRECT;
@@ -1004,6 +1006,7 @@ static void wm_link_do(WMLinkAppendData *lapp_data,
* This avoids trying to link same item with other libraries to come. */
BLI_bitmap_set_all(item->libraries, false, lapp_data->num_libraries);
item->new_id = new_id;
+ item->source_library = new_id->lib;
}
}