Core: pass bmain to BKE_library_foreach_ID_link() wherever possible
Pass a non-`nullptr` `bmain` to `BKE_library_foreach_ID_link()` wherever that `bmain` is known at the call site. This will be used in a followup commit. This should not introduce any functional changes. Pull Request: https://projects.blender.org/blender/blender/pulls/123187
This commit is contained in:
@@ -517,7 +517,7 @@ static void libblock_remap_data(
|
||||
id_remap_data.id_owner = (id->flag & LIB_EMBEDDED_DATA) ? BKE_id_owner_get(id) : id;
|
||||
libblock_remap_data_preprocess(id_remap_data.id_owner, remap_type, id_remapper);
|
||||
BKE_library_foreach_ID_link(
|
||||
nullptr, id, foreach_libblock_remap_callback, &id_remap_data, foreach_id_flags);
|
||||
bmain, id, foreach_libblock_remap_callback, &id_remap_data, foreach_id_flags);
|
||||
}
|
||||
else {
|
||||
/* Note that this is a very 'brute force' approach,
|
||||
@@ -542,7 +542,7 @@ static void libblock_remap_data(
|
||||
id_remap_data.id_owner = id_curr;
|
||||
libblock_remap_data_preprocess(id_remap_data.id_owner, remap_type, id_remapper);
|
||||
BKE_library_foreach_ID_link(
|
||||
nullptr, id_curr, foreach_libblock_remap_callback, &id_remap_data, foreach_id_flags);
|
||||
bmain, id_curr, foreach_libblock_remap_callback, &id_remap_data, foreach_id_flags);
|
||||
}
|
||||
FOREACH_MAIN_ID_END;
|
||||
}
|
||||
|
||||
@@ -3193,7 +3193,7 @@ static void lib_link_all(FileData *fd, Main *bmain)
|
||||
* Handling of DNA deprecated data should never be needed in undo case. */
|
||||
const int flag = IDWALK_NO_ORIG_POINTERS_ACCESS | IDWALK_INCLUDE_UI |
|
||||
((fd->flags & FD_FLAGS_IS_MEMFILE) ? 0 : IDWALK_DO_DEPRECATED_POINTERS);
|
||||
BKE_library_foreach_ID_link(nullptr, id, lib_link_cb, &reader, flag);
|
||||
BKE_library_foreach_ID_link(bmain, id, lib_link_cb, &reader, flag);
|
||||
|
||||
after_liblink_id_process(&reader, id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user