diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-11-12 01:15:55 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-11-12 01:17:52 +0300 |
commit | 8b01a6e0f1ea057f52658ab33a4582d51cea031c (patch) | |
tree | 388eeae85fe5e30f8470d4f2018cd543a3a4e879 /source/blender/blenkernel/intern | |
parent | 2dbcb75ed592ee5c821e8512a92b9d083d0c357d (diff) |
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!).
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index d8d700d296c..823901d286f 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -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; } } |