diff options
author | Bastien Montagne <bastien@blender.org> | 2021-09-27 17:33:41 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-09-27 17:36:07 +0300 |
commit | 7270ba011cd08656c0b18a60e6503223c1f50dcc (patch) | |
tree | bec0112cdb85bde396783ff51436023fc843bc7a /source | |
parent | 4a0ddeb62bb4a438dfa9cedc7ea5a528531eaaee (diff) |
Fix two issues with recent new Append code.
* ID pointer returned by `wm_file_link_append_datablock_ex` was
improperly extracted from `WMLinkAppendDataItem` before append step.
* Code deleting linked IDs when their local matching version was re-used
did not properly clear `LIB_TAG_DOIT` beforehand.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files_link.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index 92335f28d94..ea0b0a9feaa 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -809,6 +809,7 @@ static void wm_append_do(WMLinkAppendData *lapp_data, } /* Remove linked IDs when a local existing data has been reused instead. */ + BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); for (itemlink = lapp_data->items.list; itemlink; itemlink = itemlink->next) { WMLinkAppendDataItem *item = itemlink->link; @@ -822,7 +823,6 @@ static void wm_append_do(WMLinkAppendData *lapp_data, } BLI_assert(ID_IS_LINKED(id)); BLI_assert(id->newid != NULL); - BLI_assert((id->tag & LIB_TAG_DOIT) == 0); id->tag |= LIB_TAG_DOIT; item->new_id = id->newid; @@ -1347,13 +1347,13 @@ static ID *wm_file_link_append_datablock_ex(Main *bmain, /* Link datablock. */ wm_link_do(lapp_data, NULL, bmain, scene, view_layer, v3d); - /* Get linked datablock and free working data. */ - ID *id = item->new_id; - if (do_append) { wm_append_do(lapp_data, NULL, bmain, scene, view_layer, v3d); } + /* Get linked datablock and free working data. */ + ID *id = item->new_id; + wm_link_append_data_free(lapp_data); BKE_main_id_tag_all(bmain, LIB_TAG_PRE_EXISTING, false); |