Fix proxy remapping on make local failing for more than one object.

This commit is contained in:
2019-04-16 01:50:35 +02:00
parent 5ac7675f4c
commit 6830adaaab

View File

@@ -1745,8 +1745,6 @@ void BKE_library_make_local(
Main *bmain, const Library *lib, GHash *old_to_new_ids, const bool untagged_only, const bool set_fake)
{
ListBase *lbarray[MAX_LIBARRAY];
ID *id;
int a;
LinkNode *todo_ids = NULL;
LinkNode *copied_ids = NULL;
@@ -1766,8 +1764,8 @@ void BKE_library_make_local(
#endif
/* Step 1: Detect datablocks to make local. */
for (a = set_listbasepointers(bmain, lbarray); a--; ) {
id = lbarray[a]->first;
for (int a = set_listbasepointers(bmain, lbarray); a--; ) {
ID *id = lbarray[a]->first;
/* Do not explicitly make local non-linkable IDs (shapekeys, in fact), they are assumed to be handled
* by real datablocks responsible of them. */
@@ -1841,7 +1839,7 @@ void BKE_library_make_local(
* which involves more complex checks and might instead create a local copy of original linked ID. */
for (LinkNode *it = todo_ids, *it_next; it; it = it_next) {
it_next = it->next;
id = it->link;
ID *id = it->link;
if (id->tag & LIB_TAG_DOIT) {
/* We know all users of this object are local or will be made fully local, even if currently there are
@@ -1893,7 +1891,7 @@ void BKE_library_make_local(
* using again main->relations mapping, but... this implies BKE_libblock_remap & co to be able to update
* main->relations on the fly. Have to think about it a bit more, and see whether new code is OK first, anyway. */
for (LinkNode *it = copied_ids; it; it = it->next) {
id = it->link;
ID *id = it->link;
BLI_assert(id->newid != NULL);
BLI_assert(id->lib != NULL);
@@ -1917,6 +1915,8 @@ void BKE_library_make_local(
/* Step 5: proxy 'remapping' hack. */
for (LinkNode *it = copied_ids; it; it = it->next) {
ID *id = it->link;
/* Attempt to re-link copied proxy objects. This allows appending of an entire scene
* from another blend file into this one, even when that blend file contains proxified
* armatures that have local references. Since the proxified object needs to be linked