BKE_library_make_local(): some minor improvements.
Do not set 'real user' to groups every time we run the first clearing loop. And do fully clear properly LIB_TAG_DOIT (this is not yet enforced in existing code, but would love to get to that stage in future, so let's do it at least with new code!).
This commit is contained in:
@@ -1745,6 +1745,12 @@ void BKE_library_make_local(
|
||||
if (old_to_new_ids) {
|
||||
BLI_ghash_insert(old_to_new_ids, id, id->newid);
|
||||
}
|
||||
|
||||
/* Special hack for groups... Thing is, since we can't instantiate them here, we need to ensure
|
||||
* they remain 'alive' (only instantiation is a real group 'user'... *sigh* See T49722. */
|
||||
if (GS(id->name) == ID_GR && (id->tag & LIB_TAG_INDIRECT) != 0) {
|
||||
id_us_ensure_real(id->newid);
|
||||
}
|
||||
}
|
||||
|
||||
/* Step 5: remove datablocks that have been copied to be localized and are no more used in the end...
|
||||
@@ -1794,11 +1800,6 @@ void BKE_library_make_local(
|
||||
ob->proxy = ob->proxy_from = ob->proxy_group = NULL;
|
||||
}
|
||||
}
|
||||
/* Special hack for groups... Thing is, since we can't instantiate them here, we need to ensure
|
||||
* they remain 'alive' (only instantiation is a real group 'user'... *sigh* See T49722. */
|
||||
else if (GS(id->name) == ID_GR && (id->tag & LIB_TAG_INDIRECT) != 0) {
|
||||
id_us_ensure_real(id->newid);
|
||||
}
|
||||
|
||||
if (!is_local) {
|
||||
if (!is_lib) { /* Not used at all, we can free it! */
|
||||
@@ -1852,6 +1853,7 @@ void BKE_library_make_local(
|
||||
#endif
|
||||
((LinkNode *)it->link)->link = NULL; /* Not strictly necessary, but safer (see T49903)... */
|
||||
it->link = NULL;
|
||||
id->tag &= ~LIB_TAG_DOIT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user