Fix (unreported) error in 'make_local' code of the PartialWriteContext.
Found while investigating solution for #128519. Also added comment about usage of the `MAKE_LOCAL` option itself.
This commit is contained in:
@@ -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,
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user