diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-08 08:32:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-08 09:14:33 +0300 |
commit | e467c54d58c88316d959f2481dc7484037a4c0be (patch) | |
tree | 4cdf31ed7bac3efeef7f75075920cb23adfaee16 /source/blender/windowmanager/intern | |
parent | 48690d967a7731367cda01ab8dca64e7f4c3f6b5 (diff) |
Refactor: move library linking arguments into a parameter struct
Move arguments to BLO_library_link_{begin/named_part/end} into
a single parameter struct, to ensure arguments always match.
This allows is to skip tagging ID's LIB_TAG_DOIT when it's not needed,
previously it was always cleared just in case it was needed.
This also makes it possible to remove BLO_library_link_named_part_ex
which was only used when tagging was needed.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files_link.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index 6ccc5d79962..8c14055696c 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -250,7 +250,11 @@ static void wm_link_do(WMLinkAppendData *lapp_data, } /* here appending/linking starts */ - mainl = BLO_library_link_begin(bmain, &bh, libname); + struct LibraryLink_Params liblink_params; + BLO_library_link_params_init_with_context( + &liblink_params, bmain, flag, scene, view_layer, v3d); + + mainl = BLO_library_link_begin(&bh, libname, &liblink_params); lib = mainl->curlib; BLI_assert(lib); UNUSED_VARS_NDEBUG(lib); @@ -276,7 +280,7 @@ static void wm_link_do(WMLinkAppendData *lapp_data, continue; } - new_id = BLO_library_link_named_part_ex(mainl, &bh, item->idcode, item->name, flag); + new_id = BLO_library_link_named_part(mainl, &bh, item->idcode, item->name, &liblink_params); if (new_id) { /* If the link is successful, clear item's libs 'todo' flags. @@ -286,7 +290,7 @@ static void wm_link_do(WMLinkAppendData *lapp_data, } } - BLO_library_link_end(mainl, &bh, flag, bmain, scene, view_layer, v3d); + BLO_library_link_end(mainl, &bh, &liblink_params); BLO_blendhandle_close(bh); } } |