MakeLocal: fix bad (missing) handling of proxy_from uglyness.

Those shall not be considered while checking whether a to-be-made-local
ID will end up fully local, or still be partially used by linked data...
Even less since we already do have special handling of proxies later.

Fixes main remaining issue found with 04_01_H.lighting.blend Agent327
file, and allows us to switch back to optimized post-processing in
make_local code.
This commit is contained in:
Bastien Montagne 2017-05-05 16:15:55 +02:00
parent 198248fa3d
commit 622ce5672a
1 changed files with 14 additions and 5 deletions

View File

@ -1722,10 +1722,19 @@ static void library_make_local_copying_check(ID *id, GSet *loop_tags, MainIDRela
for (; entry != NULL; entry = entry->next) {
ID *par_id = (ID *)entry->id_pointer; /* used_to_user stores ID pointer, not pointer to ID pointer... */
/* Shapekeys are considered 'private' to their owner ID here, and never tagged (since they cannot be linked),
* so we have to switch effective parent to their owner. */
if (GS(par_id->name) == ID_KE) {
par_id = ((Key *)par_id)->from;
/* Our oh-so-beloved 'from' pointers... */
if (entry->usage_flag & IDWALK_CB_LOOPBACK) {
/* We totally disregard Object->proxy_from 'usage' here, this one would only generate fake positives. */
if (GS(par_id->name) == ID_OB) {
BLI_assert(((Object *)par_id)->proxy_from == (Object *)id);
continue;
}
/* Shapekeys are considered 'private' to their owner ID here, and never tagged (since they cannot be linked),
* so we have to switch effective parent to their owner. */
if (GS(par_id->name) == ID_KE) {
par_id = ((Key *)par_id)->from;
}
}
if (par_id->lib == NULL) {
@ -1948,7 +1957,7 @@ void BKE_library_make_local(
/* Note: Keeping both version of the code (old one being safer, since it still has checks against unused IDs)
* for now, we can remove old one once it has been tested for some time in master... */
#if 0
#if 1
/* Step 5: proxy 'remapping' hack. */
for (LinkNode *it = copied_ids; it; it = it->next) {
/* Attempt to re-link copied proxy objects. This allows appending of an entire scene