diff --git a/source/blender/blenkernel/BKE_blendfile.hh b/source/blender/blenkernel/BKE_blendfile.hh index d10ff48c9bf..b0b75998b70 100644 --- a/source/blender/blenkernel/BKE_blendfile.hh +++ b/source/blender/blenkernel/BKE_blendfile.hh @@ -236,6 +236,11 @@ class PartialWriteContext : NonCopyable, NonMovable { * * \warning By default, when #ADD_DEPENDENCIES is defined, this will also apply to all * dependencies as well. + * + * \note Often required when only a small subset of the ID dependencies are also added to the + * context (i.e. many of the added data's ID pointers are set to `nullptr`). Otherwise, some + * areas not expecting nullptr (like LibOverride data) may assert or error on load of the + * partial written blendfile. */ MAKE_LOCAL = 1 << 0, /** diff --git a/source/blender/blenkernel/intern/blendfile.cc b/source/blender/blenkernel/intern/blendfile.cc index 329f411c332..4cbf89c82dc 100644 --- a/source/blender/blenkernel/intern/blendfile.cc +++ b/source/blender/blenkernel/intern/blendfile.cc @@ -1779,7 +1779,7 @@ void PartialWriteContext::make_local(ID *ctx_id, const int make_local_flags) /* Making an ID local typically resets its session UID, here we want to keep the same value. */ const uint ctx_id_session_uid = ctx_id->session_uid; BKE_main_idmap_remove_id(this->bmain.id_map, ctx_id); - BKE_main_idmap_insert_id(matching_uid_map_, ctx_id); + BKE_main_idmap_remove_id(matching_uid_map_, ctx_id); BKE_lib_id_make_local(&this->bmain, ctx_id, make_local_flags);